Added boot process information to help someone find out what really happens.
[bootos.git] / BOOT
blobacef1662e47263703d82f1a4e5c3ea5aca470068
1 So, the boot sequence is:
2 - default.spp and lv1 are read from the flash into memory;
3 - lv1 reads default.spp and gets PS3 LPAR configuration;
4 - lv1 reads lv2 SELF binary and sets up the LPAR, specified in 
5   the configuration data;
6 - lv2 SELF is decrypted (and unpacked if it is compressed) and gets
7   executed;
8 - you get into XMB and start lv2patcher, then select "Linux";
9 - lv2 patcher modifies default.spp in the ram, replacing original
10   SELF path (/flh/os/lv2_kernel.self) to another 
11   (/local_sys0/lv2_kernel.self);
12 - lv2 patcher modifies lv2 syscall entry to make it execute syscall 255
13   of lv1 (lv1_panic), then it calls that lv2 syscall (effecively rebooting
14   the PS3);
15 - lv1 reads default.spp and gets (modified) PS3 LPAR configuration;
16 - lv1 reads lv2 SELF binary (BootOS) and sets up the LPAR, specified
17   in the (modified, bootmem=128M) configuration data;
18 - lv2 SELF is decrypted (now it is not compressed) and gets executed;
19 - BootOS sets up a few devices (most notably gelic for network debugging);
20 - BootOS tries to get a DHCP lease for some time;
21 - BootOS tries to get the kernel from TFTP server if is specified by the
22   DHCP configuration;
23 - If getting a DHCP lease has failed or DHCP server hasn't provided a
24   TFTP filename, then it decompresses and boots it;
25 - If any of above has failed, then PS3 is shut down (if lv2 hasn't loaded)
26   or rebooted (if lv2 has loaded).
28 If you are using my kernel image, then:
29 - kernel finds out that it has an embedded initramfs image, mounts it
30   and executes the /init script;
31 - init script starts up the network, telnet server and gamepad drivers;
32 - init script mounts PS3 GameOS partition, sets up the console font and
33   launches the bootloader script;
34 - bootloader script tries to mount everything it can every 2 seconds;
35 - it looks for kboot.conf on each mounted device;
36 - kboot.conf files are concatenated and the result is used to generate
37   the menu;
38 - you see the menu and select a kernel image;
39 - bootloader script copies the image to /tmp, unmounts everything,
40   stops the USB controller drivers and kboots to that kernel.
42 kboot.conf consists of lines. Each line is either:
43 - a comment (starts with "--" or "#") or an empty line;
44   such lines are just ignored;
45 - a line which has a label and a value in label=value format;
46   a menu entry is created with the specified label and it
47   corresponds to the specified value.
49 Two labels have a special meaning: "timeout" and "vmode". They
50 are not added into the menu, instead they change the timeout and vmode.
52 For all other labels, value contains one or more space-separated words.
53 The first word is the kernel image path. It can either be a file path
54 or a URL (which should begin with "http"). If it is a URL, then it will
55 be passed to "wget" program to download the image before it can be executed.
56 The file path is relative to the mount point root. If the kernel name ends
57 with ".sh", then it won't be passed to kboot - instead it would be executed
58 as a shell script. If the kernel name ends with "linux.img", then the
59 bootloader script would attempt to mount it as a loop device, containing an
60 ext4 filesystem and run /sbin/init from it.
62 The second and all following words are parsed as parameter=value pairs for
63 a initrd= parameter. Everything else just gets to the kernel cmdline.
64 If initrd is specified, then similar rules are applied to it - it can be
65 located on a local storage or on an HTTP-server.
67 If you press 'q' while running the bootloader script, then it will terminate
68 and drop you into a rescue shell. Also remember that you have a telnet
69 server running. Pressing any key would stop the auto-boot timer.