6.7. Starting an Operating System

6.7.1. The "setargs, load and boot" method
6.7.2. The "command line" method

Once a complete file path to an operating system image has been decided upon the boot process is simple. ABLE may be used to start a recognised operating system in two ways.

The two methods for starting an operating system are the “setargs, load and boot” method or the “command line” method. As can be seen from Example 6.6, “Using the "setargs, load and boot" method to start a Linux kernel” and Example 6.7, “Using the "command line" method to start a Linux kernel” both these methods produce exactly the same result and the kernel is passed exactly the same parameters in both cases.

The “command line” method is preferred as it is simpler and more obvious but there are some limited circumstances where it is not sufficient (multiple boot files) and the “setargs, load and boot” is necessary.

6.7.1. The "setargs, load and boot" method

The "setargs, load and boot" method as its description suggests uses a three stage method in order to start an operating system:

  • The setargs command is used to set the arguments with which to call the OS.

  • The load command with the path to the OS kernel or image to load.

  • The boot command to start the loaded image with the specified parameters.

This method gives the most flexibility and control but is cumbersome to use.

Example 6.6. Using the "setargs, load and boot" method to start a Linux® kernel

>setargs "root=/dev/hda1 console=ttySAC0,115200"
>load (hd0)vmlinuz
loaded (hd0)vmlinuz, 0x16a6e0 bytes at 0x00008000
>boot
boot: booting 'linux'
Booting Linux
Uncompressing Linux.............................................................
Linux version 2.6.11 (vince@gerald)
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: Simtec-BAST
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 266.000 MHz, memory 133.000 MHz, peripheral 66.500 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
USB Power Control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: root=/dev/hda1 console=ttySAC0,115200
...

A user wishing to use the this method in the boot.cmd setting should make use of the “;” to separate the commands. To set the command from the above example would be

nvset boot.cmd "setargs root=/dev/hda1 console=ttySAC0,115200";  \
load (hd0)vmlinuz ; boot

6.7.2. The "command line" method

The "command line" method is a less flexible but much simpler and obvious method of starting an OS kernel or image. The image to be executed is simply given on the command line followed by its parameters, exactly like running any other command.

Note

Any parameters set with the setargs command are not considered when using this method.

Example 6.7. Using the "command line" method to start a Linux® kernel

>(hd0)vmlinuz root=/dev/hda1 console=ttySAC0,115200
loaded (hd0)vmlinuz, 0x16a6e0 bytes at 0x00008000
boot: booting 'linux'
Booting Linux
Uncompressing Linux.............................................................
Linux version 2.6.11 (vince@gerald) 
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: Simtec-BAST
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 266.000 MHz, memory 133.000 MHz, peripheral 66.500 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
USB Power Control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: root=/dev/hda1 console=ttySAC0,115200
...