Slimline Open Firmware provides a largely machine-independent BIOS, illustrating what is needed to initialize and boot Linux. Three of the original SLOF developers discuss the development and usage of SLOF, initialization/boot source code for the PowerPC based on the Open Firmware standard.
Love this paragraph, under “The gritty details”:
“The paflof part, it’s executable code, like three kilobytes of it or something. It’s a Forth engine and it works like a virtual machine. The core engine is pre-compiled because that is the code that has to interpret the rest of the Forth code during runtime; it can’t compile itself. That doesn’t work. And that part is pre-compiled by a fairly nasty Perl script. [Laughter.]”
So you have a Forth engine, only ~3KB big. With such a smallish piece of code, why not write that engine in itself (self-hosting, able to compile a new copy/next version of itself, you get the idea)? But no, that’s too simple! Let’s use a nasty Perl script to produce C code, and put that through GCC to obtain the desired 3K of runtime code. Brilliant…
I can understand that Perl & GCC are used to bootstrap this Forth engine, to get something working. But once you have that Forth engine working, why not use it to further develop itself? Replace that Perl & C code with some Forth, and take Perl/GCC out of the development cycle. As if it’s impossible to code a Forth engine in Forth! Sheesshh….
But anyway: interesting stuff. Is anyone else getting the feeling that Free/OSS is sloooowwwlyyyy moving into BIOS/firmware space as well? (SLOF, LinuxBIOS and similar projects).
–The history of mankind is a long record of obstacles placed in the way of the more efficient for the benefit of the less efficient. -Ludwig von Mises