Topic: chumbyone bootloader

In preparation for getting a Chumby One for the purposes of porting Symbian OS to it, I thought I'd poke around your open source archive. I found the bootstream archive which, since it looks like it's designed to be poked on to the start of an SD card, I'm assuming is the bootloader source for the chumby one. Is that correct?

The top level makefile refers to a which presumably defines a bunch of variables used in the makefile. I can't seem to find that file in any of the packages available. Is it in the source distribution somewhere and I'm just missing it, or is not there either deliberately or by an oversight? I could probably reconstruct it from scratch, but it's a bit of a pain.

Re: chumbyone bootloader

Symbian OS?  That'd be really cool smile

I believe the contents of should be something along the lines of:

export CONFIGNAME=falconwing
export CNPLATFORM=falconwing
export ARCH=arm
export TARGET=$(ARCH)-linux

Anyway, about the boot process.

So to start with, the first partition on the SD card is a sort of config block that contains a really simple filesystem.  You can list information in this partition by running "config_util".  It contains information about which partition to boot from, as well as containing the actual bootloader and kernel images.

I need to post this somewhere on the wiki, but yes, broadly speeking Bootstream is the start of the bootloader.  It's located on the ROM of the i.MX233, and is responsible for reading data off of the SD card.  It reads some binary blobs we got from Freescale, which do things like turn on the DRAM, and then it reads a very small program we wrote called chumby_stub.  This stub program does exactly three things: (1) it modifies a DRAM timing parameter, (2) it sets up audio so we don't have ground loops when plugged into an amp, and (3) it reads "boot" off of the SD card and jumps to it.

The blobs are hard to modify.  Because chumby_stub is part of the blobs, it'll also be hard to modify.  Blobs are also limited to 32k of on-chip RAM.  chumby_boot is very easy to modify, and runs in DRAM, so you should probably take a look at that. smile

You should be able to compile chumby_boot without too much trouble.  It lives in bootstream-1.0/src/chumby_boot/.  You might need to change your CROSS_COMPILE target if your C compiler has a different name.  Aside from that, you should just be able to go into that directory and type "make".  It'll save the output in bootstream-1.0/src/images/.  The file you're going to want to burn is chumby_boot.rom.

To burn chumby_boot.rom to the disk, you're going to want to use config_util again.  Copy chumby_boot.rom to your chumby one (e.g. to /mnt/storage/), then run something like the following and reboot:

config_util --cmd=putblock --block=boot < /mnt/storage/chumby_boot.rom

Before you start development, I'd recommend at least making a backup of the first partition.  It should be about 16 megs uncompressed.  You can do this with dd on a Linux machine: pop the card into a machine, figure out which sdX partition it shows up as, and run "dd if=/dev/sdX1 of=boot.bin".  That'll make it easy to go back to an older version if something breaks.  Or you could make an image of the entire card, which would permanently give you an image to revert to even if the entire card were blown away, or if you wanted to switch to a different development card while you work on the port.

3 (edited by cdavies 2009-12-01 01:18:30)

Re: chumbyone bootloader

Thanks for the info. That was basically going to be my strategy anyway, preserve as much of the init that you've already helpfully written in the bootloader as possible, but rip out the linux loader and replace it with a Symbian image loader. Then just copy anything else that needs doing from linux_prep in to the Symbian baseport's DoInitialiseHardware routine and with any luck it'll all work fine.

I was thinking of just using a totally different SD card for the Symbian work, so I can just plug in the Linux card any time I feel like having it just work. As long as I can find a compatible one, it's not like SD cards are terribly expensive these days.

Edit: Oh, one thing I forgot to ask... Is there any significant amount of extra space inside the case? It'd be nice if I could at least pack a level shifter for the serial port away inside the thing.