COMPUTER AND NETWORK
SYSTEM ADMINISTRATION
CIS 5406-01
Summer 1999 - Lesson 4

Booting the System

 
 
Steps in the typical operating system boot process
 
  A. monitor or BIOS mode
 
     "man eeprom", "man monitor" on Suns
 
     "man lilo" on Linux

      Check /usr/doc/HOWTO/Bootdisk-HOWTO.gz on Linux or
      any of the Linux Documentation Project pages.
 
      Select Windows NT Help (press F1 while mouse
      is on the desktop, or use Start/Help menu) and
      use the "Find" option to find the word "boot")
 
  B. boot file
 
     1. Depending on EEPROM settings or command line
        boot arguments (example from old Suns:)
       
         b sd(0,0,1)
 
         b le()

        Newer Suns: "boot sd(0,0,0)", "boot cdrom", etc.
 
     2. Disk boot
 
     3. Network boot (diskless clients and X terminals)
 
  C. Kernel initialization
 
     1. Running monologue from various kernel routines
 
     2. Logged in /var/adm/messages (or /var/log/messages) and
        typically the system console
 
     3. Tend to be very system-specific but a good SysAdmin should be able
        to quickly scan a series of boot messages and spot problems.
 
 
Example from dmesg on xi

May  6 09:57
cpu0: SUNW,UltraSPARC-II (upaid 6 impl 0x11 ver 0x20 clock 248 MHz)
cpu1: SUNW,UltraSPARC-II (upaid 7 impl 0x11 ver 0x20 clock 248 MHz)
SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1997, Sun Microsystems, Inc.
WARNING: Firmware does not support Dynamic Reconfiguration
mem = 1048576K (0x40000000)
avail mem = 1012875264
Ethernet address = 8:0:20:92:43:b1
root nexus = 4-slot Sun Enterprise 3000
sbus0 at root: UPA 0x2 0x0 ...
sbus1 at root: UPA 0x3 0x0 ...
fas0:	rev 2.2 FEPS chip

SUNW,fas0 at sbus1: SBus1 slot 0x3 offset 0x8800000 and slot 0x3 offset 0x8810000 SBus level 3 sparc9 ipl 5
SUNW,fas0 is /sbus@3,0/SUNW,fas@3,8800000
QLGC,isp0 at sbus0: SBus0 slot 0x2 offset 0x10000 SBus level 3 sparc9 ipl 5
isp0:	Firmware Version: v1.24, Customer: 15, Product: 0
sd16 at QLGC,isp0: target 1 lun 0
sd16 is /sbus@2,0/QLGC,isp@2,10000/sd@1,0
	<SEAGATE-ST423451W-DD0E cyl 6874 alt 2 hd 28 sec 235>
sd17 at QLGC,isp0: target 2 lun 0
sd17 is /sbus@2,0/QLGC,isp@2,10000/sd@2,0
	<SEAGATE-ST423451W-0011 cyl 6874 alt 2 hd 28 sec 235>
sd0 at SUNW,fas0: target 0 lun 0
sd0 is /sbus@3,0/SUNW,fas@3,8800000/sd@0,0
	<SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
sd1 at SUNW,fas0: target 1 lun 0
sd1 is /sbus@3,0/SUNW,fas@3,8800000/sd@1,0
	<SEAGATE-ST410800N-0025 cyl 4924 alt 2 hd 27 sec 133>
sd2 at SUNW,fas0: target 2 lun 0
sd2 is /sbus@3,0/SUNW,fas@3,8800000/sd@2,0
	<SEAGATE-ST19171N-0019 cyl 5266 alt 2 hd 20 sec 168>
sd3 at SUNW,fas0: target 3 lun 0
sd3 is /sbus@3,0/SUNW,fas@3,8800000/sd@3,0
	<SEAGATE-ST423451N-0013 cyl 6874 alt 2 hd 28 sec 235>
sd4 at SUNW,fas0: target 4 lun 0
sd4 is /sbus@3,0/SUNW,fas@3,8800000/sd@4,0
	<SEAGATE-ST423451N-0013 cyl 6874 alt 2 hd 28 sec 235><central@1f,0/fhc@0,f8800000/zs@0,904000>
sd6 at SUNW,fas0: target 6 lun 0
sd6 is /sbus@3,0/SUNW,fas@3,8800000/sd@6,0
root on /sbus@3,0/SUNW,fas@3,8800000/sd@0,0:a fstype ufs
fhc0 at root: UPA 0x6 0xf8800000
fhc0 is /fhc@6,f8800000
ac0 is /fhc@6,f8800000/ac@0,1000000
fhc1 at root: UPA 0x2 0xf8800000
fhc1 is /fhc@2,f8800000
ac1 is /fhc@2,f8800000/ac@0,1000000
central0 at root: UPA 0x1f 0x0 ...
fhc2 at root: UPA 0x0 0xf8800000
fhc2 is /central@1f,0/fhc@0,f8800000
clock-board0 is /central@1f,0/fhc@0,f8800000/clock-board@0,900000
sysctrl0: Key switch is not in the secure position
environment0 is /fhc@6,f8800000/environment@0,400000
environment1 is /fhc@2,f8800000/environment@0,400000
simm-status0 is /fhc@6,f8800000/simm-status@0,600000
sram0 is /fhc@6,f8800000/sram@0,200000
zs0 is /central@1f,0/fhc@0,f8800000/zs@0,902000
zs1 is /central@1f,0/fhc@0,f8800000/zs@0,904000
keyboard is  major <29> minor <2><central@1f,0/fhc@0,f8800000/zs@0,904000:b>
mouse is  major <29> minor <3><central@1f,0/fhc@0,f8800000/zs@0,902000:a>
stdin is  major <29> minor <0><central@1f,0/fhc@0,f8800000/zs@0,902000:a>
stdout is  major <29> minor <0>
cpu 7 initialization complete - online
SUNW,hme0: FEPS (Rev Id = 22) Found
SUNW,hme0 at sbus1: SBus1 slot 0x3 offset 0x8c00000 and slot 0x3 offset 0x8c02000 and slot 0x3 offset 0x8c04000 and slot 0x3 offset 0x8c06000 and slot 0x3 offset 0x8c07000 SBus level 4 sparc9 ipl 7
SUNW,hme0 is /sbus@3,0/SUNW,hme@3,8c00000
SUNW,hme0: Using Internal Transceiver
SUNW,hme0: 100 Mbps full-duplex Link Up
dump on /dev/dsk/c0t0d0s1 size 1574616K
sbusmem1 at sbus0: SBus0 slot 0x1 offset 0x0
sbusmem1 is /sbus@2,0/sbusmem@1,0
sbusmem2 at sbus0: SBus0 slot 0x2 offset 0x0
sbusmem2 is /sbus@2,0/sbusmem@2,0
sbusmem13 at sbus0: SBus0 slot 0xd offset 0x0
sbusmem13 is /sbus@2,0/sbusmem@d,0
sbusmem16 at sbus1: SBus1 slot 0x0 offset 0x0
sbusmem16 is /sbus@3,0/sbusmem@0,0
sbusmem19 at sbus1: SBus1 slot 0x3 offset 0x0
sbusmem19 is /sbus@3,0/sbusmem@3,0
pseudo-device: winlock0
winlock0 is /pseudo/winlock@0
pem: no event handler
pseudo-device: lockstat0
lockstat0 is /pseudo/lockstat@0
pseudo-device: vol0
vol0 is /pseudo/vol@0
pseudo-device: llc10
llc10 is /pseudo/llc1@0
ID[SUNWssa.socal.driver.3010] socal0: host adapter fw date code: <not available>
SUNW,socal0 at sbus0: SBus0 slot 0xd offset 0x10000 Onboard device sparc9 ipl 3
SUNW,socal0 is /sbus@2,0/SUNW,socal@d,10000
sf0 at SUNW,socal0: socal_port 0
sf0 is /sbus@2,0/SUNW,socal@d,10000/sf@0,0
sf1 at SUNW,socal0: socal_port 1
sf1 is /sbus@2,0/SUNW,socal@d,10000/sf@1,0
pseudo-device: pm0
pm0 is /pseudo/pm@0
pseudo-device: tod0
tod0 is /pseudo/tod@0
pseudo-device: twtchc0
twtchc0 is /pseudo/twtchc@0
pseudo-device: pump0
pump0 is /pseudo/pump@0
SUNW,Ultra-Enterprisepseudo-device: vvod0
vvod0 is /pseudo/vvod@0

Example from dmesg on Linux:

Linux version 2.2.5-15 (root@localhost.localdomain) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #2 Thu May 20 15:44:04 EDT 1999
Detected 399323041 Hz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 398.13 BogoMIPS
Memory: 128180k/131072k available (932k kernel code, 412k reserved, 1512k data, 36k init)
CPU: Intel Pentium II (Deschutes) stepping 02
Checking 386/387 coupling... OK, FPU using exception 16 error reporting.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.26 (19981001) Richard Gooch (rgooch@atnf.csiro.au)
PCI: PCI BIOS revision 2.10 entry at 0xfb2a0
PCI: Using configuration type 1
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.2
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
Starting kswapd v 1.5 
Serial driver version 4.27 with no serial options enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
pty: 256 Unix98 ptys configured
Non-volatile memory driver v1.0
PIIX4: IDE controller on PCI bus 00 dev 39
PIIX4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
hda: SAMSUNG SV0432A, ATA DISK drive
hdb: SAMSUNG DVD-ROM SDR-430, ATAPI CDROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: SAMSUNG SV0432A, 4112MB w/482kB Cache, CHS=524/255/63
hdb: ATAPI 32X DVD-ROM drive, 512kB Cache
Uniform CDROM driver Revision: 2.54
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
rtl8139.c:v1.07 5/6/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/rtl8139.html
eth0: RealTek RTL8139 Fast Ethernet at 0xe400, IRQ 10, 00:20:18:8a:10:30.
Partition check:
 hda: hda1 hda2 hda3
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 36k freed
Adding Swap: 265068k swap-space (priority -1)

 
    D. Bootup scripts
 
     (BSD) scripts /etc/rc*
 
     (BSD) Order of execution:
  
         Single-user startup
 
             -init
                -rc.boot 
                  -rc.single 
                -single user shell
                -exit (or CTL-D) 
 
         Multi-user startup
             -init
                -rc.boot 
                -rc.single
                -rc  
                  -rc.local
                -getty and login prompt
     This simplistic version of startup scripts is rare these days.
     More common are the System V startup scripts (with many variations).
     See page 109 in ESA for system-specific details! 
 
     SysV bootup scripts

        - /etc/inittab is the master config file for init
        - This file controls which boot-up scripts will be executed
        - The scripts are divided into 'run-levels'
        - Example from Redhat Linux:
 
# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# 
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Things to run in every runlevel.
ud::once:/sbin/update

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"

# Run gettys in standard runlevels
1:12345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6


      Notice the location of the actual startup shell scripts
      can vary (/etc, /etc/rc.d, etc.), esp. between different
      versions of Linux.

Solaris /etc/inittab (from xi.cs.fsu.edu):

ap::sysinit:/sbin/autopush -f /etc/iu.ap
ap::sysinit:/sbin/soconfig -f /etc/sock2path
fs::sysinit:/sbin/rcS >/dev/console 2<>/dev/console /dev/console 2<>/dev/console
s0:0:wait:/sbin/rc0 >/dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console /dev/console 2<>/dev/console 
 
  D. Problems with booting
 
     - Can't find bootblock
     - Kernel won't load
     - Can't find swap
     - Damaged root (and/or /usr) file system
     - Error in startup scripts
 
Windows NT booting
 
Comment: Windows NT and Linux can run on the same exact hardware, so at
the earliest levels of booting both follow the same path through the
hardware and firmware initialization (CMOS settings for boot device,
loading up the boot loader from the boot disk, etc.).
 
Being a proprietary operating system, much of the internal machinations
of Windows NT are not as apparent and difficult to learn.
 
     Steps in boot process (page 33 in EWNTSA)
 
       1.  NTDETECT.COM (Intel NT) or OSLOADER.EXE (RISC NT)
           finds the next stage (NTOSKRNL.EXE)
 
       2.  NTOSKRNL.EXE extracts system information from the
           system's Registry database and then it:
 
                   a. Loads the kernel
                   b. Initializes the kernel
                   c. Loads services
                   d. Loads subsystems
 
            The system information includes HAL (Hardware Abstraction
            Layer) and the system hive from the Registry.
 
       This all happens on the blue screen with the marching periods.
 
 
     Steps in boot process (from Microsoft Windows NT Server -
       Concepts and Planning, page 257)
 
         1. System boot sector contains NTLDR, which is executed first
 
         2. NTLDR reads BOOT.INI and builds a menu of OS choices.
 
         3. NTLDR runs NTDETECT.COM (Intel) and builds a list of the
            system's hardware components.
 
         4. User selects OS or a default is automatically chosen.
 
         5. If NT is chosen, low-level NT components are started, then
            the drivers and services as specified in the Registry are
            started.
 
         6. The high-level components of NT load (windowing system)? and
            the login screen is presented.
 
By default, NT booting happens "behind the scenes".  You can modify that
by editing C:\BOOT.INI :
 
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
 
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Server Version 4.00"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Server Version 4.00 [VGA mode]" /basevideo /sos
 
Notice the "boot loader" stanza used to specify the loader behavior and
give the default operating system while the "operating systems" stanza
gives the choices for operating system.  To boot NT or DOS, for example,
you could use:
 
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Server Version 4.00"
C:\="MS-DOS"
 
Notice the "/sos" option on the VGA only mode menu choice; that will 
display device driver initialization messages at boot time.  You can
customize this file (be careful!) by editing it directly or indirectly via
Start/Settings/Control Panel/System/Startup Shutdown.
 
Notice the path name for the WINNT binary isn't your standard DOS path;
it's called an ARC (Advanced RISC Computing) name - a generic NT method of
identifying devices.

Linux booting
 
Linux provides a flexible multi-operating system boot loader named
lilo (Linux Loader) that can be used to boot different operating systems.  It also sits
on the Master Boot Record (MBR) of the boot device and transfers control
to specific operating system kernels depending on either a user type-in
or a default.  Lilo's behavior is controlled by /etc/lilo.conf.  Here's
a sample /etc/lilo.conf that I use to select between Win95 and Linux:
 
boot=/dev/hda
install=/boot/boot.b
map=/boot/map
vga=normal
prompt
timeout=50
#
# Windows 95
#
other = /dev/hda1
  table = /dev/hda
  label = win95
#
# Linux
#
image=/vmlinuz
  label = linux
  root=/dev/hda3
  read-only

Since the boot loading process is common to all PC platforms, many boot loaders can
handle different operating systems.  You can, for instance, use lilo to boot up
Linux, NT, Win95, Win98, etc., use NTLDR to manage multiple operating systems, or
use some third-party software, such as Partition Magic or System Commander.