The kernel then (amongst other things) loads the kernel objects (drivers).pygmy_giant wrote:Hi
I'm counting the days until my pi arives (10) and want to use it in a robot.
I therefore only need input via the SD card on boot and output to the GPIO pins.
So why bother with a full operating system?
I understand the Pi loads the firmware on power-up which then loads the kernel (or any binary called kernel.img) but what does the kernel then load?
No, from what I gather, Frank Buss's code is a kernel object (.ko) which means you need a Linux kernelpygmy_giant wrote: I am interested in using Frank Buss's kernel incorporating I2C drivers (see: http://www.raspberrypi.org/phpBB3/viewt ... driver+I2C ) but do I really nead a full os?
Can't I just write and compile the programming to operate the robot and have the kernel load and run it? If so, what should I call my robot's custom 'os' so that the kernal can find and load it?
what are the potential banana skins?
I suspect you misunderstood.pygmy_giant wrote:Thanks for explaining about the kernel objects.
I guess I do really want to write my own 'mini os' - what should I call it so that the kernel loads it?
Personally I prefer FasmARM, but it's up to you if you want to use GCC.pygmy_giant wrote:
Is there any reason I can't write it in C++ and compile it with GCC ?
OK, if I understand correctly, Frank has made a kernel or a kernel module (.ko) that is loadedpygmy_giant wrote:Interesting.
Given that I am committed to using Frank's kernel and his I2C driver kernel objects, but need nothing else, how can I get his kernel to then execute my own robot control binary?
Is there a filename that I can give it that garuntees the kernel will run it?
Code: Select all
#!bin/sh
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local startup commands in here. Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant.conf > /dev/null 2>&1 &
/etc/rc.d/rc.FireWall start &
YourBinaryName
Code: Select all
sleep 2
YourBinaryName
Many ways to trim the "fat" on any distro but I'm not an expert on that.pygmy_giant wrote:Thanks Dave_G_2 - again, interesting.
I don't want bloat - I want to create a real-time control system for my robot.
I only ever want one user space program to run on boot and all I want to do is access the GPIO pins via Frank's I2C driver kernel objects.
I don't need to play Quake III arena.
I was hoping I could just have: firmware -> kernel -> init
Is that possible?
If not, what is the minimum I could get away with and how would I go about amputating extraneous appendages?
You could, but if the kernel you intend to use is not truly realtime, then it's only a compromisepygmy_giant wrote:Thanks again - you seem to have answered alot of my question ...
I think I can also monkey about with 'latencies' ?
It certainly does not sound like fun at all porting a whole OS.pygmy_giant wrote:I have found many ARM RTOS's mentioned on the web but none Pi compatible - I have been told that it would be easiest to adapt one built for the ARM11, but I do not have the expertese.
If you don't need a GUI, go with Arch as it does not boot into X, then start chopping away atpygmy_giant wrote: I can see value in the de-bloat approach - wonder which distro would be best to start with...
Looks like a lot of work.pygmy_giant wrote: ...alternatively there is 'Linux From Scratch' : http://www.linuxfromscratch.org/
Couldn't agree more and that is why I want to code my own very simple OS specially for usepygmy_giant wrote: either way I think there is a need for a minimal real-time (ish) distro...
Dave_G_2 has given you some good advice.pygmy_giant wrote:dexos: http://www.dex-os.com/ - likey looky
I looked at assembly language when I had a bbc micro back in the day and got scared.
Arm architecture seems to suggest an assembly language that is lower level than x86 (!)
Are there modern macro-assemblers that resemble higher level languages that someone like me who is used to C++ / php might find intelligible?
Code: Select all
include 'FBasic_L.inc'
CLS
COLOR 11
LOCATE 2,1
PRINT "This app is written in Macro Basic, for Linux "
COLOR 12
LOCATE 2,2
PRINT "With the ease of Basic and the power of ASM "
COLOR 15
LOCATE 2,3
PRINT "It user's the basic commands:"
PRINT " "
PRINT " CLS"
PRINT " SCREEN"
PRINT " COLOR"
PRINT " LOCATE"
PRINT " PRINT"
PRINT " GOSUB"
PRINT " RETURN"
PRINT " SLEEP"
PRINT " END"
PRINT " "
GOSUB TestSub
SLEEP
END
TestSub:
PRINT " Press any key to quit."
RETURN
If DexOS can let us have FBasic_L.inc as a starting point then why not make a BBC or ZX80/1 type BASIC?pygmy_giant wrote:That code sample has made me nostalgic as it does resemble BBC basic - ahh - the smell of an overheating powerpack, loading from tape, flashing colors that could induce epilepsy, economic programming ... simpler times ... how did it all get so ... complex?
Code: Select all
OUT 4,1 ; make GPIO #4 high
OUT 6,0 ; make GPIO #6 low
A = IN(2) ; read GPIO #2
PRINT A : print the result
Nope. It uses FASM's macro system, which, if it's not actually Turing-complete, is extremely close to being so. That said, it doesn't seem to[1] abuse it *too* much (only using the if/else constructs as far as I can tell), and the transforms it carries out could probably be reduced to repetitive text replacements.pygmy_giant wrote:I am guessing the Mbasic Macro Assembler in essance performs find and replace operations on text to expand higher level code into pure assembly language according to the rules given to it. I anticipate it uses Grep / Regular Expressions and conditional substitutions.
Code: Select all
A = INN(2)
^ Invalid operation code "A"
^ Unexpected character "="
Link: Unresolved label "INN"