Research Pre Boot Process

From WebOS Internals

Bootloader & kernel startup

When the pre is starting it loads the boot.bin image into ram. This is the booloader bootie which loads the linux kernel. The Linux kernel is loaded with the following cmdline (which is build out of the env vars from bootie):

The nova-installer-image-castle.uImage image uses a initrd an not an initramfs. Somehow bootie detects if the kernel which is loaded has an initrd build in. If yes, then bootie changes the cmdline for the kernel to the env var bootargs-ramdisk.

You can even boot a kernel from your local host with novacom. First, log in with novaterm and run tellbootie recover. Wait for the USB logo to appear, then boot the kernel as follows:

novacom boot mem://< uImage-kexecboot-2.6.24-r50-palmpre.bin

novacom loads the kernel into ram and then boots it. The kernel is loaded with the same cmdline as mentioned above. Note that this does not write the kernel to the Pre's storage, and the next time the device is rebooted the original kernel is loaded. If the Palm logo displays but does not start glowing, your kernel has probably locked up during boot. You can also run tail -f /var/log/messages to see if the devices is re-recognised during bootup; as soon as novacom goes online you should be able to novaterm in. Note that if the device is in airline mode (phone disabled) the kernel may fail to boot.

General

On startup /dev/root is mounted as rootfs. Then /sbin/init is called which mounts /dev/mapper/store-root as the new rootfs. Finally the init script on /dev/root calls the init script in /sbin /dev/mapper/store-root.

The init script on /dev/mapper/store-root starts upstart or the miniboot.sh script in /etc.

Networking

When upstart is starting it executes a script called usbctrl whichs load the right usb driver and configuration for novacom or usbnetworking. Depending which machine is used the g_composite driver is loaded with a different product id.