78378316-Operating-System-Boot-Process
78378316-Operating-System-Boot-Process
78378316-Operating-System-Boot-Process
That is this Extended Partition can be subdivided into The MBR looks over the partition table to find the Active
multiple logical partitions. Partition.
In order to boot into a Partition, it must be designated as Control is passed to that partition's boot record (PBR) to
bootable partition or Active Partition. Active Partition is that continue booting.
partition which is flagged as bootable or which contains OS,
this is generally a Primary Partition. The PBR locates the system-specific boot files (such as
Win98's io.sys or WinXP¶s ntoskrnl).
Boot Records: Master, Partition, Extended, Logical
Extended:- Then these boot files continue the process of loading and
initializing the rest of the OS.
Master Boot Record (MBR):- MBR is a small 512 bytes
partition which is at the first physical sector of the hard disk. Multiple OS Boot Process:-
The location is denoted as CHS 0,0,1 meaning 0th Cylinder,
0th Head and 1st Sector. MBR contains a small program Whenever there are multiple OSes, be it multiple Windows
known as bootstrap program which is responsible for booting or Windows with Linux, then Boot process will be slightly
into any OSes. MBR also contains a table known as Partition different.
Table.
Actually, there can be two different types of Boot Process in
This Partition Table is a table which lists the available multiple OS environment, Microsoft way and Non-Microsoft
Primary Partitions in the hard disk. So it can have only four way (or Third Party Boot Loader way!).
entries. This rises another question, what if we have more
than four partitions? This is solved by Extended Partition Microsoft way:- Microsoft Master Boot loaders doesn¶t
principle. Partition Table considers whole Extended Partition recognize other types of OSes like Linux (in default, that is!),
as one Primary partition and lists it in the table! hence using Microsoft MBR in the presence of Linux is ruled
out.
So a Partition Table can have two possible entries:-
Consider the case that (this is the general case), there is
up to 4 Primary Partitions . one Primary partition and some Logical Partitions inside
Extended Partition. Now if Win98 is installed in the Primary
up to 3 Primary Partitions and 1 Extended Partition.(Total not Partition, and afterwards WinXP is installed in a Logical
exceeding 4) . Partition, then theoretically both OS should have their own
Boot Records, i.e PBR for Win98 and LEBR for WinXP,
Partition Boot Sector (PBR):- This is the logical first sector, which contain program to boot the respective OS, so that
that is sector at the start of a Primary Partition. This is also each individual OS can be booted up by the MBR by passing
512 byte area, which contains some programs to initialize or control to respective PBR of the OS as described in previous
run OS files.All Primary Partitions have it¶s own PBRs. section.
But this does not happen in Microsoft Boot loader! It does a Win95, Win98 with any NT based OS, then it¶s simply not
peculiar thing, that it always considers the current Active possible.
Partition as the default System/Boot Partition.
Microsoft MBR looks for Active Status in Primary Partitions
That is Primary Partition in which Win98 was installed is the only and not in Logical Partitions. This means, Microsoft
Active Partition, then when WinXP is installed another OSes should be installed in Primary Partitions only if it
partition, instead of writing the code for booting in it's should be bootable (For this reason itself, WinXP boot file
partition, WinXP writes the code in current Active Partition ntldr is placed in Primary Partition of Win98 instead of it¶s
(that is, where Win98 is installed)! own Logical Partition).
Program responsible for loading the WinXP is ntldr standing But this has led to misconception that only OSes in Primary
for NTLoader. Theoretically, this should be in it¶s partition, Partitions can be booted. But by replacing Microsoft MBR by
but this copied to that of Win98. any other sophisticated MBR program which also looks for
Active Status in Logical Drives, we can boot into OSes which
Then files responsible for Win98 booting is combined into a are in Logical Drives directly. This is where third party Boot
single file called bootsect.dos and this is also placed in the Loaders come into picture!
Win98 partition.
Non-Microsoft way:- Third-party Boot Loader load before the
Then, WinXP creates another file called boot.ini which OS, so they are independent of the OS. Therefore, they work
contains the names of Microsoft OSes installed and path for fine with all versions of Windows and DOS.
System files of each OS.
In this system, installing multiple OSes is conceptually
After all this prelims, Windows multiboot can be represented simple. First make as many Primary Partitions and Logical
as below:- Partition as you want. Then set the status of one of the
Partition as ³Active´, and install on OS. After this set the
When BIOS hands over control to Microsoft MBR , this status of that partition as ³Hidden´ (or ³Inactive´ ) and set
program looks into Partition Table for Active Partition. another Partition as ³Active´ and install another OS and this
can be done for all Partitions. By this older versions of
Then it hands over the control to the PBR of Active Partition. Windows can be installed after the installation of new ones.
In this case, the Active Partition is where Win98 was
installed. Then Third Party Boot Loader reads all Partitions (including
Logical Partitions)from the Partition Table and provides with
But Win98 PBR has been altered by WinXP, and it no an option of OSes to boot.
longer contains Win98 boot program (like io.sys or
msdos.sys). But it contains ntldr! Peculiarity is that one OS¶s The functions of a Third Party Boot Loader can be stated as
Boot program is in another OS¶s Partition! below:-
ntldr looks into boot.ini file and finds out the Microsoft OSes Display a list of all OSes present in both Primary and Logical
installed in the System and displays the option menu. Partitions.
When user slects Win98, the file bootsect.dos (which is in When an user selects one OS, Boot Loader makes the
same partition) is executed, and if WinXP is selected, Partition of that OS as Active, and passes the control to it.
ntoskrnl is executed (which is in another partition!).
This step is the most important deviation from Microsoft way,
The good thing about Microsoft way is that, it¶s very easy to because in Microsoft MBR, the ³Active´ Partition always
configure (you don¶t have to configure at all!). remains same and after booting into it, OSes in other
(Logical) Partitions are booted.
But the bad thing about Microsoft MBR is that, the two OSes
are not independent of each other.It is because, that But here, a Partition is flagged as Active at the time of the
Microsoft MBR always boots into the Active Partion (that is it selection by the user, by this way, any OS can be booted
always boots into Win98 Partition, but executes WinXP directly, by toggling it¶s Inactive/Active Status when an user
program!) and from here other OSes are loaded. selects it.
This does not provide flexibility of installing multiple Then, the Boot Sector of the corresponding OS takes control
Microsoft OSes in a random order, because here older and loads the OS. This Boot Sector may be PBR of a
version of OS should be installed first and then newer Primary Partition or LEBR of a Logical Extended Partition.
versions of OSes should be installed.
By this way, each OS remains independent of each other.
This boot process also has two limitations:- That is, boot programs (ntldr) of WinXP can remain in
WinXP¶s partition and Win98 boot programs (io.sys,
There can be only one Real Mode DOS based OSes like msdos.sys) can remain in it¶s partition..
Win95/Win98 along with NT based OSes. If you want both
Since Third Party Boot Loaders are independent of OS, they start:
support all type of OSes like Windows, Linux, Unix, BeOS
etc. or
Once the BIOS receive the "Power OK" signal, it starts the 0x00 1 Boot Indicator (0x80=bootable,
booting process by first initializing a process called POST 0x00=not bootable)
(Power On Self Test). POST first check that every device
has right amount of power and then it check whether the 0x01 1 Starting Head Number
memory is not corrupted. Then it initialize each devices and
finally it gives control to BIOS for further booting. 0x02 2 Starting Cylinder Number (10 bits) and
Sector (6 bits)
Now the final process of booting begins. For this the BIOS
first find 512 bytes of image called MBR (Master Boot 0x04 1 Descriptor (Type of partition/filesystem)
Record) or Bootsector from the floppy disk or hard disk
which is used for booting. The priority of boot devices is set 0x05 1 Ending Head Number
by the user in BIOS setting. The normal priority is floppy disk
first, then hard disk. 0x06 2 Ending Cylinder and Sector numbers
Once BIOS finds the bootsector it loads the image in 0x08 4 Starting Sector (relative to begining of
memory and execute it. If a valid bootsector is not found, disk)
BIOS check for next drive in boot sequence until it find valid
0x0C 4 Number of Sectors in partition
bootsector. If BIOS fails to get valid bootsector, generally it
stops the execution and gives an error message "Disk boot
Kernel Image
failure".
jmp 0x0000:start
The -Ttext=0x100000 tells the linker you want your "text" root=/dev/hda1 # Location of root
(code segment) address to start at the 1mb memory mark. partition
Since you do not link in any relocation tables, the linker has
to resolve all references at link time, and has to know where read-only # Mount
the executable will be loaded to. read only
You are of course obliged to load your kernel image to the image=/slackw/vmlinuz # Location of kernel
correct offset, or the references the linker did set up will be
invalid. label=slackw # Name of OS (for
the LILO boot menu)
The Linux Boot Process
root=/dev/hda2 # Location of root
When a PC is booted it starts running a BIOS program partition
which is a memory resident program on an EEPROM
integrated circuit. The BIOS program will eventually try to read-only # Mount
read the first sector on a booting media such as a hard or read only
floppy drive. The boot sector contains a small program that
the BIOS will load and attempt to pass run control to. This Note that the Slackware kernel is located on the
program will attempt to read the operating system from the subdirectory /slackw which is where the Slackware operating
disk and run it. LILO is the program that Linux systems system is installed on the Redhat system. Also be aware that
typically use to give users a choice of operating systems to the root locations may vary from system to system based
run. It is usually installed in the boot sector which is also upon the system configuration. The administrator will type
called the master boot record. If the user chooses to boot "lilo" on the command line to install LILO after setting the
Linux, LILO will attempt to load the Linux kernel causing the configuration file up. If doing the same thing from the
following basic events to happen: Slackware system, the configuration file would be as follows:
LILO will have a timeout period for the user to press the TAB boot=/dev/hda
key. If the user does not press the TAB key before the
timeout occurs, LILO will run the default operating system map=/boot/map
selected when it was installed. If the user presses the TAB
key, LILO will present the user with a choice of systems to install=/boot/boot.b
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 prompt
very significant to system administrators. Let's say you have
timeout=50
or want to install a multiple boot Linux or Linux/Windows
system. Assuming you want LILO to control the boot process
default=rhl
and you have two versions of Linux. They are Redhat, called
rhl, and Slackware, called slackw. You may set each system
image=/rhl/boot/vmlinuz # Location of kernel
to mount the others. Redhat will mount Slackware on a
directory called /slackw and Slackware will mount Redhat on
label=rhl # Name
a directory called /rhl. If you want to be able to boot both
of OS (for the LILO boot menu)
systems and install LILO from Redhat, you will want your
/etc/lilo.conf file to be similar to the following:
root=/dev/hda1 # Location of root
partition
boot=/dev/hda
read-only # Mount
map=/boot/map
read only
install=/boot/boot.b
image=/vmlinuz # Location of kernel
prompt
label=slackw # Name of OS (for
the LILO boot menu)
timeout=50
root=/dev/hda2 # Location of root
default=rhl
partition
image=/boot/vmlinuz # Location of kernel
read-only # Mount
read only
label=rhl # Name
of OS (for the LILO boot menu)
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 IP Protocols: ICMP, UDP, TCP, IGMP
which supports some special text modes (such as 100
columns by 40 rows), Linux may ask which mode to use. TCP: Hash tables configured (ehash 65536 bhash 65536)
The video mode and other options can be specified either
during the kernel compilation or with LILO or the rdev Initializing RT netlink socket
program. Therefore the video mode can be preset, so the
user is never asked. Starting Kswapd v 1.5
The kernel checks the hardware (hard disks, floppies, Detected PS/2 Mouse Port.
network adapters, etc), and configures some of its device
drivers, while outputting messages about its findings. See an Serial driver version 4.27 with MANY_PORTS MULTIPORT
example boot output below: SHARE_IRQ enabled
Console: colour VGA+ 80x25, 6 virtual consoles pty: 256 Unix98 ptys configured
Calibrating delay loop... 166.71 BogoMIPS apm: BIOS version 1.2 Flags 0x07 (Driver version 1.9)
Memory: 62720k/65536k available (1008k kernel code, 412k Real Time Clock Driver v1.09
reserved, 1052k data, 64K init)
RAM disk driver initialized: 16 RAM disks of 4096K size
Checking if this processor honors the WP bit even in
supervisor mode... OK. PIIX4: IDE controller on PCI bus 00 dev 39
Buffer-cache hash table entries: 65536 (order: 9, 2097152 PIIX4: not 100%native mode: will probe irqs later
bytes)
ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio,
Page-cache hash table entries: 16384 (order: 4, 65536 hdb:pio
bytes)
ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio,
VFS: Diskquotas version dquot_6.4.0 initialized hdd:pio
CPU: Cyrix 6x86MX 2.5 Core/Bus Clock stepping 06 hda: ST36422A, ATA DISK drive
Checking 386/387 coupling... OK, FPU using exception 16 hdb: ST36422A, ATA DISK drive
error reporting
hdd: FX240S, ATAPI CDROM drive
Checking 'htl' instruction... OK.
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
POSIX conformance testing by UNIFIX
ide1 at 0x170-0x177,0x376 on irq 15
mtrr: v1.35a (19990819) Richard Gooch
(rgooch@atmf.csiro.au) hda: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63
PCI: PCI BIOS revision 2.10 entry at 0xbf0a0 hdb: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63
PCI: Using configuration type 1 hdd: ATAPI 24X CD-ROM drive, 256kB Cache
pII_MMX : 252.222 MB/sec MII transceiver found at address 24, status 7849.
using fastest function: p5_mmx (291.084 MB/sec) nfsd_fh_init : initialized fhcache, entries=1024
scsi : detected total IPX Portions Copyright (c) 1995 Caldera, Inc.
md.c sizeof(mdp_super_t) = 4096 The text varies on different systems, depending on the
system hardware, the version of Linux being used, and the
Pattition check: configuration.
hda: hda1 hda2 hda3 hda4 The kernel will try to mount the root filesystem. The location
of the filesystem is configurable at compilation time, with the
hdb: hdb1 rdev program, or with LILO. The filesystem type is detected
automatically. If mounting the root filesystem fails, the kernel
RAMDISK: Compressed image found at block ) will panic and halt the system. The root filesystem is usually
mounted read-only so that the filesystem can be checked
autodetecting RAID arrays while it is mounted. This feature can also be modified using
the rdev program. It is not advised to check a filesystem
autorun ... already mounted as read-write.
... autorun DONE. The kernel starts the program "init" which becomes process
number 1. Init will start the rest of the system.
VFS: Mounted root (ext2 filesystem) readonly.
` cc
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
!
c
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
'`
O "``` (
* c !
* * *
+$, !
-! "`
! !
(! $* 1
"`
!!! $
"`2
.# 3
*
!
c !
'`
! 2
! !
! # !
!
*
2
) $, !
.#
!
! `` "` !!
!
O "```
! '
O
! *
) !
* "```
O
! ) 1
* !
! !#
* "```
! !
* ` "` !
* "```! ` O
"```
! "` "`*c
!"``` "
.
! ! "` !!
'
c ,4,54`. " !
6! "`6 ! !
! !
( * !
/ 06O 76 !
!
! !
! ! ! !
!3 ! (
! ! !
c !#
2 !
) 2
)
" ! 6 !
6 !
#
! )! / '
! 0 ! !795545:;
"6,6
", 3
! . "`
! . "`
!
" 6 6
! ) )
$, :58 ) /"` !
488: ! $0
!
! ` # !
*# !
$* !
, "O ` !
) ! (
"`!
"O ` ! )
$, *
*!!
! 0
*$, )
-! "` 5 6 )6
0 !
1
@/
!+
!! A
"