Testing Open Firmware on OLPC
An OLPC Open Firmware image is available for internal testing. It boots
from a USB storage device, so you don't have to reprogram the OLPC FLASH to
try it out. Once OFW is running, it can then boot Linux from the same or
another USB storage device.
It works on both A and B OPLC boards.
Supported Features
The following features and capabilities are fairly well tested.
- Booting Linux from USB storage
- PS/2 keyboard and mouse
- USB keyboard
- GX video output
- Serial console
- All standard Open Firmware interactive commands
- Loading custom pre-boot mod scripts from USB storage
Partially Supported ...
These features are present in the build but need some work.
- USB network devices (only AX8817x-based devices for now)
- TCP/IPv4 - NFS, HTTP, HTTPD (core code is mature but needs a NIC)
- Graphical boot menu (needs icon and colormap cleanup)
Coming Soon ...
The code for these features is written, but not included in this build
because it needs more testing and polish.
- NAND FLASH/JFFS2 (Mostly working, needs polish)
- DCON (Mostly working, needs polish)
- SPI FLASH programming (Needs support for the new parts)
- CaFe NAND (Waiting for the FPGA to be fixed)
- CaFe SD (Needs polish)
- SPI FLASH programming (Needs support for the new parts)
- Marvell wireless (Written but completely untested)
- Non-volatile storage of configuration variables (I don't want to touch the FLASH or CMOS RAM in this version)
Completely Missing
Not yet written...
Installing Open Firmware
Get ofw-061011-1916.tgz and extract it with
tar xfz ofw-061011-1916.tgz
The tarball contains a binary file ofw-<VERSION>.bzi and a text file ofwmods.fth .
Copy both to a USB FLASH key that contains an ext3 file system (i.e. an OLPB boot disk). E.g.:
$ mount /dev/sda1 /key
$ cp ofw-061011-1916.bzi /key/boot/ofw.bzi
$ cp ofwmods.fth /key/boot
Modify /key/boot/olpc-boot.sh to add the following lines before the /sbin/kbl-kexec line:
if [ -f /key/boot/ofw.bzi ] ; then
/sbin/kbl-kexec /key/boot/ofw.bzi ""
fi
Running Open Firmware
Open Firmware can use either the GX video and a keyboard (USB or PS/2) or
a serial console (115200,8,n,1). A serial console gives you much more
flexibility for debugging (scroll, cut and paste, capture output), but
keyboard/screen is fine for routine use. USB keyboard takes priority over
PS/2, and if neither is present, serial is used.
Insert the USB key and turn on the power. LinuxBIOS should boot Open
Firmware, which then gives you 6 seconds to type a key before auto-booting
Linux.
If you interrupt the auto-boot by typing a key, you will get an 'ok' prompt.
Some Things You Can Do
- Boot Linux with boot
- List the device tree with show-devs
- Go into a device node with, for example, dev /pci/isa/i8042/keyboard
- List the node's properties .properties
- List the node's methods (driver procedures) with words
- Decompile a method with, for example, see open
- Look at config variables with printenv
- Change a config variable with, for example, setenv input-device com1
- Modify the kernel arguments with editenv boot-file
- Switch to the serial port with com1 io
- Switch to the keyboard with keyboard input
- Switch to the screen with screen output
- Switch to both keyboard and screen with ks-io
- Look at the USB disk contents with dir disk:\boot\
- Look at a file with more disk:\boot\olpc-boot.sh
- Try the graphical menu with menu (it needs work...)
- Write, compile, and debug Forth programs
- Serial-download Forth programs with dl (^D to end)
- Run Forth programs from disk with, for example fload disk:\myfile.fth
The command line editor has full intra-line editing and history (arrow keys),
and command completion (TAB). Emacs control keys also work.
You can make persistent changes by editing the file /boot/ofwmods.fth (on
another system). That file is loaded just before auto-booting. You can
use it to override the configuration variables that control Linux booting,
fixup hardware settings, or whatever.
http://firmworks.com/QuickRef.html shows a lot more things you can do. It
includes a Forth language reference.
Last edited: 2006-10-11