Previous Page | Next Page

  1. Introduction
  2. Abbreviated Boot
  3. The Boot Process
  4. Startup and Run Levels
  5. Initialization Scripts
  6. Runlevel Scripts
  7. Login Process
  8. Bash Shell
  9. Filesystems
  10. LILO, Kernel and Root Filesystem
  11. The Kernel
  12. Passwords, Users, Groups, and Quotas
  13. The Environment
  14. The /etc/sysconfig directory
  15. The /proc filesystem
  16. Process Control
  17. Devices
  18. Daemons Services
  19. Inetd and Network Services
  20. Programs and Libraries
  21. Security and PAM
  22. The printer services
  23. Mouse support with gpm
  24. Mail
  25. News
  26. UUCP
  27. LDAP
  28. NFS and RPC
  29. Samba, NetBIOS, WINS, nmbd
  30. Identd (auth)
  31. Telnet and FTP
  32. Apache web server
  33. DNS and named
  34. How X Works
  35. X Scripts
  36. Support for Text
  37. Keymapping for Programs
  38. Keycode Table
  39. Example Keymap File
  40. Terminfo Commands
  41. VT100 ESC sequences
  42. Kernel Revisited
  43. Configuration Files
  44. Credits

The Linux Boot Process

When a PC is booted it starts running a BIOS program which is a memory resident program on an EEPROM integrated circuit. The BIOS program will eventually try to read the first sector on a booting media such as a hard or floppy drive. The boot sector contains a small program that the BIOS will load and attempt to pass run control to. This program will attempt to read the operating system from the disk and run it. LILO is the program that Linux systems typically use to give users a choice of operating systems to run. It is usually installed in the boot sector which is also called the master boot record. If the user chooses to boot Linux, LILO will attempt to load the Linux kernel causing the following basic events to happen:

  1. LILO will have a timeout period for the user to press the TAB key. If the user does not press the TAB key before the timeout occurs, LILO will run the default operating system selected when it was installed. If the user presses the TAB key, LILO will present the user with a choice of systems to boot from based upon the labels and images as set up in the /etc/lilo.conf file that controlled the last LILO install. This is very significant to system administrators. Let's say you have or want to install a multiple boot Linux or Linux/Windows system. Assuming you want LILO to control the boot process and you have two versions of Linux. They are Redhat, called rhl, and Slackware, called slackw. You may set each system to mount the others. Redhat will mount Slackware on a directory called /slackw and Slackware will mount Redhat on a directory called /rhl. If you want to be able to boot both systems and install LILO from Redhat, you will want your /etc/lilo.conf file to be similar to the following:
    boot=/dev/hda
    map=/boot/map
    install=/boot/boot.b
    prompt
    timeout=50
    default=rhl
    image=/boot/vmlinuz  		# Location of kernel
       label=rhl 	  			# Name of OS (for the LILO boot menu)
       root=/dev/hda1  			# Location of root partition
       read-only 	  			# Mount read only
    image=/slackw/vmlinuz 		# Location of kernel
       label=slackw 	  		# Name of OS (for the LILO boot menu)
       root=/dev/hda2  			# Location of root partition
       read-only 	  			# Mount read only
    

Note that the Slackware kernel is located on the subdirectory /slackw which is where the Slackware operating system is installed on the Redhat system. Also be aware that the root locations may vary from system to system based upon the system configuration. The administrator will type "lilo" on the command line to install LILO after setting the configuration file up. If doing the same thing from the Slackware system, the configuration file would be as follows:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=rhl
image=/rhl/boot/vmlinuz  	# Location of kernel
   label=rhl 	  			# Name of OS (for the LILO boot menu)
   root=/dev/hda1  			# Location of root partition
   read-only 	  			# Mount read only
image=/vmlinuz	 		# Location of kernel
   label=slackw 	  		# Name of OS (for the LILO boot menu)
   root=/dev/hda2  			# Location of root partition
   read-only 	  			# Mount read only
  • Since the Linux kernel is installed compressed, containing a small program to de-compress itself, it will uncompress itself.
  • If the kernel recognizes that the system has a video card which supports some special text modes (such as 100 columns by 40 rows), Linux may ask which mode to use. The video mode and other options can be specified either during the kernel compilation or with LILO or the rdev program. Therefore the video mode can be preset, so the user is never asked.
  • The kernel checks the hardware (hard disks, floppies, network adapters, etc), and configures some of its device drivers, while outputting messages about its findings. See an example boot output below:
    LILO boot:
    Loading linux.
    Console: colour VGA+ 80x25, 6 virtual consoles
    Calibrating delay loop... 166.71 BogoMIPS
    Memory: 62720k/65536k available (1008k kernel code, 412k reserved, 1052k data, 64K init)
    Checking if this processor honors the WP bit even in supervisor mode... OK.
    Buffer-cache hash table entries: 65536 (order: 9, 2097152 bytes)
    Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
    VFS: Diskquotas version dquot_6.4.0 initialized
    CPU: Cyrix 6x86MX 2.5 Core/Bus Clock stepping 06
    Checking 386/387 coupling... OK, FPU using exception 16 error reporting
    Checking 'htl' instruction... OK.
    POSIX conformance testing by UNIFIX
    mtrr: v1.35a (19990819) Richard Gooch (rgooch@atmf.csiro.au)
    PCI: PCI BIOS revision 2.10 entry at 0xbf0a0
    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
    TCP: Hash tables configured (ehash 65536 bhash 65536)
    Initializing RT netlink socket
    Starting Kswapd v 1.5
    Detected PS/2 Mouse Port.
    Serial driver version 4.27 with MANY_PORTS MULTIPORT SHARE_IRQ enabled
    ttyS00 at 0x03f8 (irq = 4) is a 16550A
    ttyS01 at 0x02f8 (irq = 3) is a 16550A
    pty: 256 Unix98 ptys configured
    apm: BIOS version 1.2 Flags 0x07 (Driver version 1.9)
    Real Time Clock Driver v1.09
    RAM disk driver initialized: 16 RAM disks of 4096K size
    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:pio, hdb:pio
        ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio
    hda: ST36422A, ATA DISK drive
    hdb: ST36422A, ATA DISK drive
    hdd: FX240S, ATAPI CDROM drive
    ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
    ide1 at 0x170-0x177,0x376 on irq 15
    hda: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63
    hdb: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63
    hdd: ATAPI 24X CD-ROM drive, 256kB Cache
    Uniform CDROM driver Revision: 2.56
    Floppy drive(s): fd0 is 1.44M
    FDC 0 is a post-1991 82077
    md driver 0.90 MAX_MD_DEVS=256, MAX_REAL=12
    raid5: measuring checksumming speed
    raid5: MMX detected, trying high speed MMX checksum routines
       pII_MMX    :    252.222 MB/sec
       p5_MMX     :    291.084 MB/sec
       8regs      :    176.403 MB/sec
       32regs     :    116.967 MB/sec
    using fastest function: p5_mmx (291.084 MB/sec)
    scsi : 0 hosts.
    scsi : detected total
    md.c sizeof(mdp_super_t) = 4096
    Pattition check:
     hda: hda1 hda2 hda3 hda4
     hdb: hdb1
    RAMDISK: Compressed image found at block )
    autodetecting RAID arrays
    autorun ...
    ... autorun DONE.
    VFS: Mounted root (ext2 filesystem) readonly.
    change_root: old root has d_count=1
    Trying to unmount old root ... okay
    Freeing unused kernel memory: 64k freed
    Adding Swap: 128516k swap-space (priority -1)
    3c59x.c:v0.99H 11/17/98 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/vortex.html
    eth0: 3Com 3c905B Cyclone 100baseTx at 0x6800,  00:10:4b:ca:db:a1, IRQ 10
      8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Auto negotiate interface.
      MII transceiver found at address 24, status 786d.
      MII transceiver found at address 0, status 786d.
      Enabling bus-master transmits and whole-frame receives.
    eth1: 3Com 3c905B Cyclone 100baseTx at 0x6c00,  00:10:4b:ca:db:b5, IRQ 11
      8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Auto negotiate interface.
      MII transceiver found at address 24, status 7849.
      MII transceiver found at address 0, status 7849.
      Enabling bus-master transmits and whole-frame receives.
    Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
    nfsd_fh_init : initialized fhcache, entries=1024
    NET4: Linux IPX 0.38 for NET4.0
    IPX Portions Copyright (c) 1995 Caldera, Inc.
    

    The text varies on different systems, depending on the system hardware, the version of Linux being used, and the configuration.

  • The kernel will try to mount the root filesystem. The location of the filesystem is configurable at compilation time, with the rdev program, or with LILO. The filesystem type is detected automatically. If mounting the root filesystem fails, the kernel will panic and halt the system. The root filesystem is usually mounted read-only so that the filesystem can be checked while it is mounted. This feature can also be modified using the rdev program. It is not advised to check a filesystem already mounted as read-write.
  • The kernel starts the program "init" which becomes process number 1. Init will start the rest of the system.