using kboot for booting

Werner Almesberger werner at
Thu Apr 24 15:25:38 CEST 2008

Sean Chiang wrote:
> kboot = minimize uboot(firmware) with 2-stage booting?

Instead of the current

u-boot -> system

you get two choices

1) first-stage -> system
2) first-stage -> kboot -> system

Choice 1 is much simpler than u-boot, faster, but also very limited
in what you can do. This is the way the system normally boots.

Choice 2 is for special scenarios: switching to a different kernel,
recovery, or booting from special media. This is slower than u-boot
and also involves much more code. It's also a lot more flexible,
since it can basically do anything Linux can do.

The big advantages are that you get the enormous flexibility of choice
2 basically for free (you still have to configure any such setup, and
maybe add some special packages, but you don't have to actually write
or port all the code that does it), and that almost all of the code we
use there is "mainstream" code that's kept in good shape by others and
that is also used by everyone else.

E.g., we once noticed that we had a problem with ext2 in u-boot. Such
things can happen there because of the comparably small user base and
because ext2 isn't used very often in embedded environments. Now
imagine the mainline kernel. It's almost impossible that a change that
flat out kills ext2 or ext3 would get into any released kernel at all,
and if it did, this would be found and fixed within hours.

> what else would get from kboot, a diagnostic environment with rich utility?

Yes. You can even chroot to your rootfs and do things there. E.g., if
your system doesn't boot because you made some mistake in the startup
files, you can just edit them from kboot.

- Werner

More information about the openmoko-kernel mailing list