User talk:Wmb@firmworks.com

From OLPC
Jump to navigation Jump to search

recurse, yum

Hi! In lesson 4, I might have only used the definition of factorial that used the word 'recurse', and just skipped 'recursive'. 'recurse' is ever so much nicer, don't you think?

<Mitch> I don't have a strong opinion about recurse vs. recursive. Both get the job done.

Thanks for the awesome intro to forth!

<Mitch> You're welcome, glad you like it.

Questions on building Forth firmware

How do I build the firmware? I want to add some new words and some games.

westfield@potter-pod.com

Mike Westfield

Answer:

svn co svn://openbios.org/openfirmware
cd openfirmware/cpu/x86/pc/olpc/build
make

The whole process takes less than a minute if you have a reasonably fast Internet connection.

You can put new "fload" commands in openfirmware/cpu/x86/pc/olpc/fw.bth to include the files defining your new features.

Thanks.

What I am trying to do is automatically, during a boot, over-clock my XO. What file can I modify to execute my new word or words?


Answer:

  1. If you want to build a new firmware image, you can cause it to execute your new words automatically by calling them inside the definition "startup", which is defined in the file "openfirmware/cpu/x86/pc/olpc/fw.bth
  2. Alternatively, you can do it without building new firmware simply by putting your new definitions inside the file "/boot/olpc.fth" on the boot device (which is typically the NAND FLASH, but might also be a USB key or SD card). On a system with security turned off, OFW boots by interpreting Forth source code from that file. That file normally contains code to look for updates, then sets up the cmdline and ramdisk and re-executes the "boot" command to load the kernel. You can add any additional code that you want to it. On a USB key or SD card, the "/boot/" directory is just "/boot/", but on NAND FLASH, "/boot" is a symlink to "/versions/boot/current/boot", and there is some additional trickery at the OS level to switch versions, so you may need to dig around to find the actual location of /boot/olpc.fth under Linux.


How do I get this new build into my XO?

Answer:

Put the new image on a USB key (for example in a file named "new.rom") and type:

 ok flash u:\new.rom

Thanks for all of the help. I modified the /boot/olpc.fth file and I now run at 564.942 MHz. per "cat /proc/cpuinfo" and I have been running memtest at that speed for several hours with no error. Memtest reports a memory speed of 512 Mbs.