5 ms·
Not sure how many people remember, but back in the PowerPC days of Macintosh, the OpenFirmware chips actually contained a Forth interpreter implemented in hardw
by jballanc 13y ago
Not sure how many people remember, but back in the PowerPC days of Macintosh, the OpenFirmware chips actually contained a Forth interpreter implemented in hardware. It always struck me that, should the need arise, you could use the Forth interpreter to write a bootstrap C compiler, then use that to build a proper C compiler and from there compile and load a minimal kernel. In other words, starting with bare metal you could, in theory, get to a fully functional desktop computer...
...one of these days maybe I'll actually have the time to find out if that really works in practice.
- rbanffy 13y agoThe OLPC XO machines also have it, as well as SPARC-based Sun workstations.
- astrobe_ 13y agoThe thing that really stop you is to find good documentation about your hardware. Displaying a character on screen or sending a packet over the network without using system or BIOS calls will require you to pages after pages of very technical and not always well written documentation. That said you can pick a very old PC with a functional floppy drive, and write a Forth interpreter under DOS in assembler. Then, you "just" have to replace the system call to DOS to read/write blocks to/from your blockfile with BIOS calls to read/write floppy disk sectors. You can even do that under DOS, provided you don't have anything valuable on your hard disk. This DOS-based Boostrap Forth should feature at least an editor, a mini-assembler and a self-compiler. Once you have that, you can make a bootable disk that boots on your standalone Forth interpreter (which has therefore been promoted to the rank of 'OS' ;-). With a very old 5MHz 8086 "laptop" featuring an half-broken single density floppy disk drive, one can boot, make a change in the kernel, recompile, then reboot and test the change within a minute. Those machines were power monsters. It's a pity that CGA cards didn't have shaders ;-).