Bootie

From WebOS Internals
Revision as of 07:55, 27 August 2011 by Tmzt (talk | contribs) (change formatting on example in multimage section)
Jump to navigation Jump to search

Current Version: 191.4 introduced with WebOS 1.4.1
Old version : 145.2.6 introduced with WebOS 1.0.3

Bootie is the stage3 bootloader of webOS devices. It is unpacked from the end of boot.bin, and loaded to **0x82000000** in memory. Bootie looks very similar to iBoot from the iPhoneOS devices.

Getting into bootie mode is as easy as holding the volume-up key while plugging the phone into USB while the phone is in the "off" state. The novaterm/novaproxy programs can then be used to talk to bootie.

Running Bootie commands

The following is an example of using novaterm to run the bootie command "help":

] help 
command list:
	nduid           : get the device id
	usb             : usb transfer commands
	lboot           : boot linux image
	klog            : klog commands
	printenv        : print all of the environment variables
	getenv          : read an environment variable
	setenv          : set an environment variable
	reset           : reset the device
	script          : run a script at specified address
	run             : run a script at from an environment variable
	return          : return from current script
	help            : this list
	version         : get bootie version
        battery         : battery status (found in webOS 1.4.1 and not in 1.0.3)
	charging        : commands to set charging states 
	fsboot          : boot current image based on environment
	chainboot       : boot another bootloader image based on environment
	go              : Jump to a given address with the given arguments
	cpurev          : read the cpu revision (found in webOS 1.0.3 but not in 1.4.1)
	diag            : perform diag operations: write, boot, verify
	poweroff        : power off completely

The Bootie Environment

The default environment of Pre phones during boot follows:

] getenv
T   ? = 0
T   chargebypass = 0
T   framebuffer = 0x8f600000
T   boardtype = castle-dvt3
    installer = trenchcoat
T   klog_len = 0x100000
T   klog_addr = 0x8ff00000
T   logofile = boot/logo.tga
T   bootaddress = 0x81000000
T   bootfile = uImage
T   bootfs = ext2
T   bootdevice = mmc0p1
T   bootargs-ramdisk = root=/dev/ram0 ramdisk=32768 ro
T   bootargs = root=b302 rootdelay=2 ro
T   bootconsole = tty1
    autoboot = fsboot

The boot environment on a TouchPad (3.0.2) follows:

T   ? = -1000
T   framebuffer = 0x7f600000
    installer = trenchcoat
    checkbatt = 1
T   chargebypass = 1
T   klog_len = 0x100000
T   klog_addr = 0x7ff00000
T   tablet_wod_support = 0x0
T   extended_timeout = 0x0
T   chainbootdevice = mmc0
T   bootaddress = 0x41000000
T   bootdevice = mmc0p12
T   bootfile = uImage
T   bootfs = ext2
T   bootargs-ramdisk = root=/dev/ram0 rw
T   bootargs = root=/dev/mmcblk0p13 rootwait ro
T   bootconsole = ttyS0,115200n8
T   autoboot = fsboot
T   boardtype = topaz-Wifi-pvt

Additional commands

In addition to the commands listed by the help command displayed above, bootie supports the command get which will return the contents of a file, for example:

 novacom get file://klog

Image formats accepted

It looks like Bootie accepts images generated with mkimage from u-boot tools.

There are apparently two kinds of images:

  • simple images are just the uImage as produced by kernel build process.
  • multi images that have both the kernel and a ramdisk. Both the kernel and the ramdisk must be processed with mkimage first (kernel is processed by the build). It is important to pass -C none to mkimage when generating the ramdisk file, otherwise Bootie refuses to recognize it. Then generate the multi image like this:
mkimage -A arm -T multi -C none -n 'test-multi-image' -d arch/arm/boot/uImage:/tmp/uRamdisk /tmp/uMulti

When Bootie detects such a multi image, it uses bootargs-ramdisk variable as kernel argument instead of just bootargs, so no need to do any extra actions when trying to feed such a multi-image into the Bootie.