Sei sulla pagina 1di 39

Chapter 1.

3
Understanding
Operating
System
CSC204
PRACTICAL APPROACH TO OPERATING
SYSTEM
CS110
Chapter 1.3.1
Understanding Booting
Concepts

 The system BIOS is what starts the


computer running when you turn it on.
The following are the steps that a typical
boot sequence involves.
 Of course this will vary by the manufacturer
of your hardware, BIOS, etc., and especially
by what peripherals you have in the PC.
 Here is what generally happens when you
turn on your system power:
Chapter 1.3.1
Understanding Booting
Concepts
STEP 1
 The internal power supply turns on and
initializes. The power supply takes some time
until it can generate reliable power for the
rest of the computer, and having it turn on
prematurely could potentially lead to damage.
 Therefore, the chipset will generate a reset
signal to the processor (the same as if you
held the reset button down for a while on your
case) until it receives the Power Good signal
from the power supply.
Chapter 1.3.1
Understanding Booting
Concepts
STEP 2
 When the reset button is released, the
processor will be ready to start executing.
 When the processor first starts up there is nothing
at all in the memory to execute. Of course
processor makers know this will happen, so they
pre-program the processor to always look at
the same place in the system BIOS ROM for
the start of the BIOS boot program.
 This is normally location FFFF0h, right at the
end of the system memory. They put it there so
that the size of the ROM can be changed
without creating compatibility problems.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 2
 Since there are only 16 bytes left from
there to the end of conventional memory,
his location just contains a "jump"
instruction telling the processor where to
go to find the real BIOS startup program.
Chapter 1.3.1
Understanding Booting
Concepts
STEP 3
 The BIOS performs the power-on self test (POST). If there are
any fatal errors, the boot process stops. POST beep codes can be
found in this area of theTroubleshooting Expert.

STEP 4
 The BIOS looks for the video card. In particular, it looks for the
video card's built in BIOS program and runs it.
 This BIOS is normally found at location C000h in memory.
 The system BIOS executes the video card BIOS, which initializes
the video card.
 Most modern cards will display information on the screen about the
video card.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 5
 The BIOS then looks for other devices' ROMs to
see if any of them have BIOSes.
 Normally, the IDE/ATA hard disk BIOS will be found
at C8000h and executed. If any other device
BIOSes are found, they are executed as well.

STEP 6
 The BIOS displays its startup screen.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 7
 The BIOS does more tests on the system,
including the memory count-up test which
you see on the screen.
 The BIOS will generally display a text error
message on the screen if it encounters
an error at this point; these error messages
and their explanations can be found in this
part of the Troubleshooting Expert.
Chapter 1.3.1
Understanding Booting
Concepts
STEP 8
 The BIOS performs a "system inventory" of sorts, doing more
tests to determine what sort of hardware is in the system.
 Modern BIOSes have many automatic settings and will
determine memory timing (for example) based on what kind of
memory it finds.
 Many BIOSes can also dynamically set hard drive
parameters and access modes, and will determine these at
roughly this time.
 Some will display a message on the screen for each drive they
detect and configure this way.
 The BIOS will also now search for and label logical devices
(COM and LPT ports).
Chapter 1.3.1
Understanding Booting
Concepts
STEP 9
 If the BIOS supports the Plug and Play standard, it will
detect and configure Plug and Play devices at this time and
display a message on the screen for each one it finds.

STEP 10
 The BIOS will display a summary screen about your
system's configuration.
 Checking this page of data can be helpful in diagnosing setup
problems, although it can be hard to see because sometimes
it flashes on the screen very quickly before scrolling off the
top.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 11
 The BIOS begins the search for a drive to boot
from. Most modern BIOSes contain a setting that
controls if the system should first try to boot from
the floppy disk (A:) or first try the hard disk (C:).
 Some BIOSes will even let you boot from
your CD-ROM drive or other devices,
depending on the boot sequence BIOS
setting.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 12
 Having identified its target boot drive, the BIOS
looks for boot information to start the operating
system boot process.
 If it is searching a hard disk, it looks for a
master boot record at cylinder 0, head 0, sector
1 (the first sector on the disk);
 if it is searching a floppy disk, it looks at the
same address on the floppy disk for a volume
boot sector.
Chapter 1.3.1
Understanding Booting
Concepts
STEP 13
 If it finds what it is looking for, the BIOS starts the
process of booting the operating system, using the
information in the boot sector.
 At this point, the code in the boot sector takes over
from the BIOS.
 The DOS boot process is described in detail here.
 If the first device that the system tries (floppy, hard
disk,etc.) is not found, the BIOS will then try the next
device in the boot sequence,and continue until it finds
a bootable device.
Chapter 1.3.1
Understanding Booting
Concepts

STEP 14
 If no boot device at all can be found, the
system will normally display an error message
and then freeze up the system.
 What the error message is depends entirely on
the BIOS, and can be anything from the rather
clear "No boot device available" to the very
cryptic "NO ROM BASIC - SYSTEM
HALTED".
 This will also happen if you have a bootable
hard disk partition but forget to set it active.
Chapter 1.3.1
Understanding Booting
Concepts

Windows Kernel Initialization


Chapter 1.3.1
Understanding Booting
Concepts

 Architecture-independent Linux
Kernel Initialization
Chapter 1.3.1
Understanding Booting
Concepts

 This process is called a "cold boot" (since the


machine was off, or cold, when it started).
 A "warm boot" is the same thing except it
occurs when the machine is rebooted using
 {Ctrl}+{Alt}+{Delete} or similar. In this
case the POST is skipped and the boot process
continues roughly at step 8 above.
Chapter 1.3.2
Hard Disk and Partition

 Partitioning is a process of dividing the Hard


disk into several partitions and use anyone of
the partition to install OS or use two or more
partitions to install multiple OSes.
 But you can always have one partition, and
use up the entire Hard disk space to install a
single OS, but this will become data
management nightmare for users of large
Hard disks.
Chapter 1.3.2
Hard Disk and Partition

 Master Boot Record (MBR):- MBR is a


small 512 bytes partition which is at the
first physical sector of the hard disk.
 The location is denoted as CHS 0,0,1 meaning
0th Cylinder, 0th Head and 1st Sector.
 MBR contains a small program known as
bootstrap program which is responsible
for booting into any OSes.
 MBR also contains a table known as
Partition Table.
Chapter 1.3.2
Structure of MBR
Chapter 1.3.2
Hard Disk and Partition

 This Partition Table is a table which lists the


available Primary Partitions in the hard
disk. So it can have only four entries.
 Partition Table can have two possible entries:-
 1. up to 4 Primary Partitions .
 2. up to 3 Primary Partitions and 1 Extended
Partition.(Total not exceeding)
Chapter 1.3.2
Structure of MBR
Chapter 1.3.2
Hard Disk and Partition

Partition Boot Sector (PBR)


 This is the logical first sector, that is sector at the start of a
Primary Partition.
 This is also 512 byte area, which contains some programs
to initialize or run OS files.All Primary Partitions have it’s
own PBRs.
Extended Boot Sector (EBR)
 This is the logical first sector, that is the sector at the start
of the Extended Partition.
 This EBR contains a Partition Table, which lists the available
Logical Partitions inside Extended Partition. That is it
contains the Starting addresses of each Logical Partitions.
Chapter 1.3.2
Hard Disk and Partition

Logical Extended Boot Sector (LEBR)


 This is the logical first sector residing at the
start of each Logical Partition.
 This is similar to PBR for Primary Partitions.
Chapter 1.3.2
Single OS Boot

 Whenever PC is turned ON, BIOS takes the


control, and it performs a lot of operations. It
checks the Hardware, Ports etc and finally it
loads the MBR program into memory (RAM).
 Now, MBR takes control of the booting process.
Functions of MBR, when there is only one OS is
installed in the system are as given below:-
1. The boot process starts by executing code in the
first sector of the disk, MBR.
2. The MBR looks over the partition table to find the
Active Partition.
Chapter 1.3.2
Single OS Boot

3. Control is passed to that partition's


boot record (PBR) to continue booting.
4. The PBR locates the system-specific
boot files (such as Win98's io.sys or
WinXP’s ntoskrnl).
5. Then these boot files continue the
process of loading and initializing the
rest of the OS.
Chapter 1.3.2
Multiple OS Boot

 Two different types of Boot Process in


multiple OS environment,
 Microsoft way
 Non-Microsoft way (or Third Party Boot
Loader way!)
Chapter 1.3.2
Multiple OS Boot

 Microsoft way
 If Win98 is installed in the Primary Partition, and
afterwards WinXP is installed in a Logical Partition,
then theoretically both OS should have their own Boot
Records, i.e PBR for Win98 and LEBR for WinXP,
which contain program to boot the respective OS, so
that each individual OS can be booted up by the MBR
by passing control to respective PBR of the OS as
described in previous section.
Chapter 1.3.2
Multiple OS Boot

 Microsoft way
 But this does not happen in Microsoft Boot loader! It
does a peculiar thing, that it always considers the
current Active Partition as the default System/Boot
Partition.
 That is Primary Partition in which Win98 was installed is
the Active Partition, then when WinXP is installed
another partition, instead of writing the code for booting
in it's partition, WinXP writes the code in current Active
Partition (that is, whereWin98 is installed)!
 Program responsible for loading the WinXP is ntldr
standing for NTLoader.
Chapter 1.3.2
Multiple OS Boot

 Microsoft way
 Theoretically, this should be in it’s partition, but this
copied to that of Win98.
 Then files responsible for Win98 booting is combined
into a single file called bootsect.dos and this is
also placed in the Win98 partition.
 Then, WinXP creates another file called boot.ini
which contains the names of Microsoft OSes
installed and path for System files of each OS.
Chapter 1.3.2
Multiple OS Boot

Microsoft way
 After all this prelims, Windows multiboot can be
represented as below:-
1. When BIOS hands over control to Microsoft MBR , this
program looks into Partition Table for Active Partition.
2. Then it hands over the control to the PBR of Active
Partition. In this case, the Active Partition is where Win98
was installed.
3. But Win98 PBR has been altered by WinXP, and it no
longer contains Win98 boot program (like io.sys or
msdos.sys). But it contains ntldr! Peculiarity is that one
OS’s Boot program is in another OS’s Partition!
Chapter 1.3.2
Multiple OS Boot

Microsoft way
4. ntldr looks into boot.ini file and finds out the Microsoft
OSes installed in the System and displays the option
menu.
5. When user selects Win98, the file bootsect.dos
(which is in same partition) is executed, and if
WinXP is selected, ntoskrnl is executed (which is in
another partition!).
Chapter 1.3.2
Multiple OS Boot
Benefit of multiple OS
 it’s very easy to configure
Drawbacks of multiple OS
 two OSes are not independent of each other.
 It is because, that Microsoft MBR always boots into
the Active Partion (that is it always boots into Win98
Partition, but executes WinXP program!) and from here
other OSes are loaded.
 This does not provide flexibility of installing multiple
Microsoft OSes in a random order, because here older
version of OS should be installed first and then newer
versions of OSes should be installed.
Chapter 1.3.2
Multiple OS Boot

 This boot process also has two limitations:-


1. There can be only one Real Mode DOS based OSes
like Win95/Win98 along with NT based OSes. If you
want both Win95, Win98 with any NT based OS, then it’s
simply not possible.
2. Microsoft MBR looks for Active Status in Primary
Partitions only and not in Logical Partitions. This
means, Microsoft OSes should be installed in Primary
Partitions only if it should be bootable (For this reason
itself, WinXP boot file ntldr is placed in Primary Partition
of Win98 instead of it’s own Logical Partition).
Chapter 1.3.2
Multiple OS Boot

Non-Microsoft way (or Third Party Boot Loader way!)


 Third-party Boot Loader load before the OS, so they are
independent of the OS. Therefore, they work fine with all
versions of Windows andDOS.
 In this system, installing multiple OSes is conceptually
simple. First make as many Primary Partitions and Logical
Partition as you want. Then set the status of one of
 the Partition as “Active”, and install on OS. After this set the
status of that
 partition as “Hidden” (or “Inactive” ) and set another
Partition as “Active” and install another OS and this can be
done for all Partitions.
Chapter 1.3.2
Multiple OS Boot

Non-Microsoft way (or Third Party Boot Loader


way!)
 By this older versions of Windows can be installed
after the installation of new ones.
 Then Third Party Boot Loader reads all Partitions
(including Logical Partitions) from the Partition Table
and provides with an option of OSes to boot.
Chapter 1.3.2
Multiple OS Boot

Non-Microsoft way (or Third Party Boot Loader way!)


 The functions of a Third Party Boot Loader can be stated
as below:-
1. Displays a list of all OSes present in both Primary and
Logical Partitions.
2. When an user selects one OS, Boot Loader makes the
Partition of that OS as Active, and passes the control to it.
 This step is the most important deviation from
Microsoft way, because in Microsoft MBR, the “Active”
Partition always remains same and after booting into it,
OSes in other (Logical) Partitions are booted.
Chapter 1.3.2
Multiple OS Boot

Non-Microsoft way (or Third Party Boot Loader


way!)
 But here, a Partition is flagged as Active at the
time of the selection by the user,by this way, any
OS can be booted directly, by toggling it’s
Inactive/Active Status when an user selects it.
3. Then, the Boot Sector of the corresponding OS takes
control and loads the OS. This Boot Sector may be
PBR of a Primary Partition or LEBR of a Logical
Extended Partition.
Chapter 1.3.2
Multiple OS Boot

Non-Microsoft way (or Third Party Boot Loader


way!)
 By this way, each OS remains independent of each
other. That is, boot programs (ntldr) of WinXP can
remain in WinXP’s partition and Win98 boot programs
(io.sys, msdos.sys) can remain in it’s partition.
 Since Third Party Boot Loaders are independent of OS,
they support all type of OSes like Windows, Linux, Unix
 A good Boot Loader is XOSL, which has a graphical
interface and supports up to 24 OSes and it can also
boot OSes installed in Logical Partitions., BeOS etc.

Potrebbero piacerti anche