Saturday, November 14, 2009

Solaris initialization Story

The normal Unix boot process has these main phases:

Basic hardware detection (memory, disk, keyboard, mouse etc) and executing the firmware system initialization program . In Solaris, this is called Boot PROM phase. After you turn on power of the system, the PROM displays system identification information and runs self-test diagnostics to verify the system's hardware and memory.

PROM chip contains Forth OpenBoot firmware, and it is executed immediately after you turn on the system. The primary task of the OpenBoot firmware is to boot the operating system either from a mass storage device or from the network. OpenBoot contains a program called the monitor that controls the operation of the system before the kernel is available. When a system is turned on, the monitor runs a power-on self-test (POST) that checks such things as the hardware and memory on the system. If no errors are found, the automatic boot process begins. OpenBoot contains a set of instructions that locate and start up the system's boot program and eventually start up the Unix operating system.

Locating and running the initial boot program (IPL or bootloader) from a predetermined location on the disk (MBR in PC). In Solaris the primary boot program, called bootblk, is loaded from its location on the boot device (usually disk) into memory.

Locating and starting the Unix kernel. The kernel image file to execute may be determined automatically or via input to the bootloader. In Solaris the bootblk program finds and executes the secondary boot program (called ufsboot) from the Unix file system (UFS) and loads it into memory. After the ufsboot program is loaded, the ufsboot program loads the two-part kernel.

The kernel initializes itself and then performs final, high-level hardware checks, loading device drivers and/or kernel modules as required. In Solaris the kernel initializes itself and begins loading modules, using ufsboot to read the files. When the kernel has loaded enough modules to mount the root file system, it unmaps the ufsboot program and continues, using its own resources.

The kernel starts the init process, which in turn starts system processes (daemons) and initializes all active subsystems. When everything is ready, the system begins accepting user logins. In Solaris kernel starts the Unix operating system, mounts the necessary file systems, and runs /sbin/init to bring the system to the initdefault state specified in /etc/inittab. The kernel creates a user process and starts the /sbin/init process, which starts other processes by reading the /etc/inittab file. The /sbin/init process starts the run control (rc) scripts, which execute a series of other scripts. These scripts (/sbin/rc*) check and mount file systems, start various processes, and perform system maintenance tasks.

No comments: