dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Rockbox from flash questions from a user's point of view

Re: Rockbox from flash questions from a user's point of view

From: <>
Date: Mon, 7 Jul 2003 07:46:09 +0200 (MEST)

> This is a feature we are all looking forward to. I'm trying to figure
> out how it will work from a user's point of view.

I'll try my best to document it for the release, don' worry. ;-)

> We will have a safety
> (permanent) copy of Rockbox. I would think that copy wouldn't even need
> to play music, just make the unit smart enough to look for firmware on
> the hard drive and enable USB in case we need to load firmware, and show
> on the screen what's going on.

Currently, the "safe mode" copy of Rockbox is the full thing, too. But
you're correct, a version that does rolo and allows USB access would be

I found a nice compression algorithm I'm now using for the boot loader, it's
called UCL. It compresses a rockbox image to about 58% original size, that's
even a bit better than zip with maximum compression. The best thing about it
is that the decompression is just a small and fast function. (Takes 544
bytes of code, to be precise, in plain ANSI-C.) Decompression is done in a
fraction of a second, not increasing boot time, because we still have to wait for
the disk.

With header, bootloader and 2 full rockbox images the total firmware
currently sums up to 182kB. The flash chip has 256kB, as you see no space problem
yet. Right now it is even possible to have one of the images uncompressed, but
that's total 247kB already.
> How will we load firmware, from a special archos.mod,ajbrec.ajz that
> checks ROM version and loads another file into ROM? I would assume it
> would have to be a version of Rockbox flagged as flashable. I wouldn't
> want to try and flash EVERY daily build.

I'm using the plugin feature to do that. The plugin I've already completed
is the first one you'll need, it reprograms the whole flash with the full
firmware. So this is the dangerous one and contains a lot of checks. But in the
ideal world you'll only need to do that once. The release packet will contain:
- "ajbrec.ajz" with a plugin-capable firmware (to make shure we all run the
same version to do the flashing and that it's compatible with the plugin)
- "firmware_flash.rock" being the plugin with the flash programming code
- "firmware_rec.bin" as the future content of your flash chip.
So you'll first backup your original firmware with the debug menu, then copy
it to the PC and the other way copy all 3 release files to your root dir,
restart the box, run the plugin. After some checks and warnings it reprograms
the chip and verifies that. You should delete the files afterwards, first to
avoid any accidents, second because you don't want ajbrec.ajz to be rolo'ed on
startup. When you power-cycle the box you'll be hopefully directly in
rockbox. When you hold F1 during powerup you'll get the "Safe Mode" copy of

When for any reason you'd like to revert to the original firmware, you can
do like above, but copy and rename your backup to be firmware_rec.bin on the
box this time.

The second plugin is not yet done. It will reprogram only the second rockbox
image, not touching any other byte. Not much safety checking necessary here.
A bare bone version would require a UCL-compressed rockbox image. If you
start from a .ajz file, you'll need to descramble it to become rockbox.bin
again, then run uclpack on it to compress it to rockbox.ucl. Copy the compressed
file to the box and run the plugin to write it into flash. After power-cycle
it will get started. If it doesn't run at all, you can redo with F1 pressed
and program a better image.

A more luxurious version of the plugin could do the descrambling and
compression by itself, but that's hard to do because a plugin is very limited with
memory (32kB for code and data). Currently I'm doing one flash sector (4096
bytes) at a time. Don't know how slow the compression algorithm would be on the
box. If flashing becomes very popular, the build process could generate
rockbox.ucl right away.

Now I've written half of the documentation already, good that you've asked.


+++ GMX - Mail, Messaging & more +++
Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!
Received on 2003-07-07

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy