Thursday, June 3, 2010

HP- Unix - Booting Process


System booting


1) Boot –Rom startup

2) HP-UX startup

PDC checks the memory and cpu,peripherals ,initialize the console and loads and executes ISL

ISL loads the SSL called hpux . hpux loads the HP-UX kernel(default is /stand/vmunix)

Kernel starts the swapper process and the init.

Init process reads /etc/inittab and brings up the daemons.

Setting autoboot

From the PDC goto the configuration menu using the configure command here. We can set the value on or off for autoboot, autosearch etc.

Also autoboot command can be used from ISL prompt.

Again we can use setboot command from OS

#setboot –p -> primary boot device

#serboot –s -> alternate boot device

#setboot –b -> autoboot(on/off)

#setboot –s -> autosearch(on/off)

A file named AUTO is located in the boot area(LIF area) of the disk. This file contains the default arguments to be supplied to hpux ie if we give hpux command from ISL prompt without any argument it will take the arguments such as path of the kernel file from the AUTO file

Booting in single user mode

Isl>hpux –is

Booting another kernel

ISL>hpux /stand/vmunix.old



Kernel booting stage

• The kernel first loads the swapper process.

• Then pre_init_rc is loaded (/sbin/pre_init_rc)

• Fsck

• Then the init(/sbin/init) process is loaded

The swapper is started with the PID 0 and init is started with PID 1



Init process

 It reads the initdefault from /etc/inittab

 Then loads ioinitrc,bcheckrc,rc and getty process.

/sbin/ioinitrc -> it checks/initialize i/o devices maintain the consistency between /etc/ioconfig and kernel data structure.

/sbin/bcheckrc -> runs fsck,activates LVM.

Daemon starting

/sbin/rcn.d -> link files which actually calls the startup scripts for each daemons(s20cron..)

/sbin/init.d -> The startup script for each daemon(/sbin/init.d/cron)

/etc/rc.config.d -> Configuration file for each daemon (/etc/rc.config.d/cron)


Several steps are required to bring an HP-UX system to a fully functional state.


The PDC Chooses a Boot Disk

The Processor Dependent Code (PDC) is the first player in the boot process after the boot process is initiated. The PDC does a self-test on the SPU, then initializes the system console, and checks Stable Storage to determine which disk to boot from. Finally, the PDC loads the Initial System Loader (ISL) utility from the boot area on the chosen boot disk.

ISL Chooses a Kernel to Boot

The ISL consults the AUTO file to determine the pathname of the default kernel, and any options that should be passed to the hpux kernel loader. Finally, the ISL loads and runs the hpux utility from the boot disk.

hpux Loads the Kernel

hpux uses the options and kernel pathname provided by the ISL to find and load the kernel. If the ISL called hpux without any options or arguments, hpux loads the default kernel /stand/vmunix and boots the system to multi-user mode.

vmunix Brings the System to a Fully Functional State

The kernel then scans the hardware, mounts the root file system, and starts the init daemon. The init daemon starts the daemons and services necessary to bring the system up to multi-user mode




Kernel reconfiguration


There are 3 major steps

1) Create or modify /stand/system file

2) Regenerate the kernel.

3) Reboot the system with new kernel

A kernel reconfiguration may require in the following situations

1) Adding/removing drivers.

2) Adding or removing subsystems

3) Changing swap/dump device

4) Modifying system parameters

# sysdef -> Analyse the running system and displays the tunable parameters.

# ioscan -> gives the list of h/w attached to the system. (#ioscan –f ->full list)

# lanscan -> lan configurations

#ioscan –C -> to display a class of device , eg: ioscan –fC disk

# system_prep ->builds a configuration file from a running system.

For creating new configuration file

#cd /stand/build

# /usr/lbin/sysadm/system_prep –s system

Edit this system file to make the appropriate changes.

To build a new kernel

#/usr/sbin/mk_kernel –s ./system

Files for any additional modules are expected to be in /stand/system directory.

The newly build kernel will be in /stand/build directory with the name vmunix_test.

Installing new kernel

#mv /stand/system /stand/system.old

#mv /stand/vmunix /stand/vmunix.old

#mv /stand/build/system /stand/system

#mv /stand/build/vmunix_test /stand/vmunix

Reboot the system

1 comment:

  1. After shutting down your system, you will at some point need to boot it back up again. The goal of the system boot process is to load the kernel executable from the boot disk into memory and start all the daemons and services necessary to bring the system back up to a fully functional state. There are several players involved in this process:
     
    BOOTROM Every HP 9000 SPU has a BootROM chip containing the "Processor Dependent Code" firmware executable. The PDC executable is loaded in memory in the early stages of the boot process to do a hardware self-test, and identify the system boot disk.
     
    Stable Storage The PDC consults "Stable Storage" to determine which disk to boot from. Stable storage is a non-volatile area of memory that contains the hardware paths of the primary boot disk, an alternate boot source, and the system console. The contents of stable storage may be modified by the administrator.
     
    Boot Area Every system requires at least one boot disk. Each boot disk has a 2MB "Boot Area" containing the utilities needed to find and load the kernel. Files in the boot area are stored in a special "Logical Interchange Format" that is not directly viewable with ls, cat or other regular UNIX commands. The primary files of interest in the LIF area are the Initial System Loader (ISL), the AUTO file, and the HP-UX utility. These will be discussed in more detail on the next slide.
     
    /stand The boot disk must also have a file system containing a kernel to boot. The kernel is typically stored in the /stand file system, with filename /stand/vmunix. Currently, the utilities used to load the kernel in memory are unable to read JFS file systems; thus the file system containing the kernel must be HFS.
    / The boot disk also typically contains the "/" (root) file system. The “/” file system contains the/etc, /sbin, and /dev directories which are required in the early stages of the system startup process. The “/” file system may be either HFS or JFS.
     
    Primary Swap Finally, the boot disk contains a primary swap area that is
    enabled and used early in the boot process.
    LVM Versus Non-LVM Boot Disks
    HP-UX boot disks may be configured using either LVM or the whole disk layout approach. LVM boot disks typically have a boot area at the top of the disk, the HFS /stand file system in lvol1, primary swap in lvol2, and the / file system in lvol3. Other logical volumes and file systems may also be placed on the boot disk, though HP recommends that vg00 only contain OS-related files and directories. Non-LVM boot disks have a boot area; an HFS / file system that includes the /, /stand, /sbin, /etc, and /dev directories; and a primary swap section.
    The layout of the boot disk is usually defined when you install HP-UX.

    ReplyDelete