Iris runs from SD card

Bas Wijnen wijnen at debian.org
Fri Jul 9 09:01:32 EDT 2010


Hello,

This is the moment you've all been waiting for! :-)

Iris can now run from SD card.  In this e-mail I'll explain how to test
this yourself, and what you can see it do.  Don't expect too much yet:
it's still mostly a demonstration that it can run at all.

Contents:
1. Quick guide to make it work.
2. Explanation of what's happening.
3. Explanation of what you can tweak.


	1. Quick guide to make it work.

- Buy a micro-SD card.
- Make sure the first primary partition is formatted as fat.
- Download
  http://downloads.qi-hardware.com/people/bas/20100709-iris-sd.tar.gz
- Extract it onto the fat partition of the SD card.
- Boot the Ben NanoNote with the S key pressed.
- Wait about 20 seconds.
- Press F8 to turn the screen on.
- Use Cursor keys, enter and F8 to control the count-down timer.
- Use the power button to reboot the Ben.

Disclaimer: My own Ben (prototype) doesn't have u-boot installed, so I
could not test the fifth step.  However, if I boot the kernel which is
in the uimage using hardware usb boot, things work for me.

Disclaimer 2: While I didn't try to make Iris write to nand or SD,
please back things up before trying.  This is very experimental, and may
break anything.


	2. Explanation of what's happening.

In uimage is Iris bundled with startup drivers for sd, partition and
fat, and a bootstrapping program.  Those are all started at boot.

The bootstrapping program receives and passes capabilities of the
drivers to each other (sd->partition->fat) and used the fat capability
to load "elfload.elf" and "init.elf".  It starts elfload.elf and uses it
to start "init.elf".  It passes the fat and elfload capability to init.

Init loads "init.config", reads it, and does what it says.  Before
starting any of the programs, it kills all the boot drivers and the
bootstrapper.  In case of the init.config in the tarball, it loads
several drivers and programs, and receives and passes capabilities
between them.  The result is:

gpio powerbutton = system request (handled by init).
lcd framebuffer and brightness, buzzer, gpio keyboard, alarm -> gui
gpio sd detect -> sd -> partition
partition 0 -> fat -> test
partition 1, 2 and 3 are not used.
nand is running but receives and takes no capabilities.

In other words, the running programs are gui, which is the front end for
alarm, test, which prints the directory tree of the file system, and
nand, which prints the contents of the start of the nand flash.  All
this "printing" happens on the serial port.  If you don't have it
connected, you can only see alarm.  Due to all the other things (and the
serial port, which is waited for), it takes about 20 seconds to boot
everything.


	3. Explanation of what you can tweak.

If you have no cross compiler installed, you can only tweak init.config.
For example, you can make test display the contents of the second
partition instead of (or in addition to) the first.  Note that the boot
process is hard-coded to use the first partition.

If you do have a cross compiler, you can change programs, or create new
ones[1] (and add them to init.config).  If you want to do this, I think
it's easiest to start hacking "test" or "alarm".  Those are fairly
high-level, only using the functionality of the others.  Writing a
driver isn't so easy, but if you want to give it a try, please go ahead.
:-)

Please send comments, questions and reports about things working or not
working to this list (or me, if you prefer that).

Thanks,
Bas

[1] Note that Iris is written in pythonic C++.  This means that the
source is first preprocessed with pypp (pythonic preprocessor) and then
compiled with g++.  If you want to hack on it, you can either change the
source, or change the generated .cc file.  If you use the --clean switch
on pypp, it will not print #line lines, and it is (almost) normal C++
source.  Please see http://en.qi-hardware.com/wiki/Iris for instructions
on compiling.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20100709/63d815a8/attachment.pgp>


More information about the discussion mailing list


interactive