The Booting Process
Booting (also known as booting up) is the initial set of operations that a computer
system performs when electrical power is switched on. The process begins when a
computer that has been turned off is re-energized, and ends when the computer is
ready to perform its normal operations. On modern general purpose computers, this can
take tens of seconds and typically involves performing power-on self-test, locating and
initializing peripheral devices, and then finding, loading and starting an operating
system. Many computer systems also allow these operations to be initiated by a
software command without cycling power, in what is known as a soft reboot, though
some of the initial operations might be skipped on a soft reboot. A boot loader is a
computer program that loads the main operating system or runtime environment for the
computer after completion of self-tests.
The computer term boot is short for bootstrap or bootstrap load and derives from the
phrase to pull oneself up by one’s bootstraps. The usage calls attention to the paradox
that a computer cannot run without first loading software but some software must run
before any software can be loaded. Early computers used a variety of ad-hoc methods
to get a fragment of software into memory to solve this problem. The invention of
integrated circuit Read-only memory (ROM) of various types solved the paradox by
allowing computers to be shipped with a start up program that could not be erased, but
growth in the size of ROM has allowed ever more elaborate start up procedures to be
implemented.
There are numerous examples of single and multi-stage boot sequences that begin with
the execution of boot program(s) stored in boot ROMs. During the booting process, the
binary code of an operating system or runtime environment may be loaded from
nonvolatile secondary storage (such as a hard disk drive) into volatile, or random-
access memory (RAM) and then executed. Some simpler embedded systems do not
require a noticeable boot sequence to begin functioning and may simply run operational
programs stored in read-only memory (ROM) when turned on.
The order of booting –
In order for a computer to successfully boot, its BIOS, operating system and hardware
components must all be working properly; failure of any one of these three elements will
likely result in a failed boot sequence.
When the computer’s power is first turned on, the CPU initializes itself, which is
triggered by a series of clock ticks generated by the system clock. Part of the CPU’s
initialization is to look to the system’s ROM BIOS for its first instruction in the startup
program. The ROM BIOS stores the first instruction, which is the instruction to run the
power-on self test (POST), in a predetermined memory address. POST begins by
checking the BIOS chip and then tests CMOS RAM. If the POST does not detect a
battery failure, it then continues to initialize the CPU, checking the inventoried hardware
devices (such as the video card), secondary storage devices, such as hard drives and
floppy drives, ports and other hardware devices, such as the keyboard and mouse, to
ensure they are functioning properly.
Once the POST has determined that all components are functioning properly and the
CPU has successfully initialized, the BIOS looks for an OS to load.
The BIOS typically looks to the CMOS chip to tell it where to find the OS, and in most
PCs, the OS loads from the C drive on the hard drive even though the BIOS has the
capability to load the OS from a floppy disk, CD or ZIP drive. The order of drives that the
CMOS looks to in order to locate the OS is called the boot sequence, which can be
changed by altering the CMOS setup. Looking to the appropriate boot drive, the BIOS
will first encounter the boot record, which tells it where to find the beginning of the OS
and the subsequent program file that will initialize the OS.
Once the OS initializes, the BIOS copies its files into memory and the OS basically
takes over control of the boot process. Now in control, the OS performs another
inventory of the system’s memory and memory availability (which the BIOS already
checked) and loads the device drivers that it needs to control the peripheral devices,
such as a printer, scanner, optical drive, mouse and keyboard. This is the final stage in
the boot process, after which the user can access the system’s applications to perform
tasks.
Booting process
When our computer is switched on, It can be started by hardware such as a
button press, or by software command, a computer's central processing unit
(CPU) has no software in its main memory, there is some process which must load
software into main memory before it can be executed.
After the computer is turned on, a specific program needs to load in the
computer's main memory which is Operating System.
In the Booting process, System will check all the hardware's and Software's those
are installed or attached with the system and all the Files those are required for
running a system, also loads into memory.
ROM also reads the information stored in these files.
At the Time of Booting all Instructions will be read required to start the system.
OS holds the following processes at the time of booting:
Categories of Booting Process
There are two categories of Booting process,
1. Hard (Cold) Booting
2. Soft (Warm) Booing
1) Hard (Cold) Booting
Restart a computer is referred to as rebooting, It can be "hard" or "cold", e.g.
after power to the CPU is switched from off to on. In this category of booting the
computer starts from a completely dead state.
For instance, When we press the Power Button, the system starts with its initial
state. It reads all the information that is stored in the Read-Only Memory (ROM)
and automatically the Operating System will be loaded into the system's main
memory.
2) Soft (Warm) Booing
In "soft" or "warm" booting, the power is not cut. In some systems, a soft boot
may optionally clear RAM to zero.
POST (Power On Self Test)
The Power On Self Test happens each time after turn on your computer.
It is a diagnostic testing sequence for all the hardware devices. It checks
hardware device availability. It sends a signal to all the hardware devices
and they send an acknowledgment back to it. If an acknowledgment is sent
by that device then that device is working, if not then it will be removed
from the system.
If there is any error then a beep like sound generates or some error
messages displays on the monitor. These beeps are referred to as POST
beep codes.
Master Boot Record
The Master Boot Record (MBR) is the information which is in the first sector
of any hard disk that indicates how and where an operating system is
located so that it can be boot (loaded) into the computer's main memory
or random access memory.
The MBR is also sometimes referred to as the "partition sector" or the
"master partition table". It has only four primary partitions. We can create
more partitions by setting the fourth partition as the extended partition
and also we can create sub-partitions (or logical drives) within it.
It holds information about GRUB (or LILO in old systems).
Its size is less than 512 bytes. It has three components
1. primary boot loader information in 1st 446 bytes.
2. partition table information in next 64 bytes.
3. MBR validation checks in the last 2 bytes.
init
This is the last step of the booting process. It decides the run level by looking at
the / etc / inittab file.
The initial state of the operating system decides by the run level.
Following are the run levels of Operating System:
Level
0 - System Halt
1 - Single user mode
2 - Multiuser, without NFS
3 - full multiuser mode
4 - unused
5 - Full multiuser mode with network and X display manager(X11)
6 - Reboot
We would set the default run level to either 3 or 5.
We can execute 'grep initdefault / etc/ inittab' on your system to identify
the default run level.
Init uses run levels to load all appropriate program.
The step after is to start up various daemons that support networking and other
services. X server daemon manages display, keyboard, and mouse. You can see a
Graphical Interface and a login screen is displayed during X server daemon is
started.
Failure during boot
If the computer cannot boot, we will get a boot failure error. This error indicates
that the computer is not passing POST or a device in the computer, such as the
hard drive or memory, has failed.
You may also hear a beep code to identify which hardware is failing during the
POST.
An error message or blue screen may show on the screen as operating system
files cannot be loaded, due to not being found or being corrupt.
1. Booting Process
The heart of a modern computer is one or more Central Processing Units.
A CPU gets its instructions from memory.
The CPU reads instruction from the BIOS and searches for the hard disks, CD
drives and other hardware.
The BIOS program looks at the first sector for boot code.
Devices that feed the initial CPU instructions are known as bootstrap media.
2. Booting Process, cont
The Booting is a process involving 2 stages:
o getting hardware up and running, and
o getting the OS and other software up and running
3. Booting a Computer
1. Power up; computer runs POST
2. Boot sequence governed by BIOS ROM
o BIOS parameters stored in CMOS
o BIOS ROM may be password protected
3. Control passes to the MBR of the first bootable device detected
4. MBR points to boot record of selected operating system
5. Operating system takes control
4. BIOS
What is a BIOS?
o Basic input/output system
o Built into the PC:
BIOS software stored permanently(*) on a ROM chip on the
motherboard
o The first code run when a PC is powered on
o Identify system devices
__________________________
(*) In modern computers BIOS chip can be rewritten, allowing BIOS software to
be upgraded.
5. POST
What is a POST?
o power-on self-test -- one of the first processes that a computer undergoes
when booting
o POST tests the computer to ensure that it is working as it is supposed to.
o POST can detect some errors with the processor, motherboard, RAM and
other memory, as well as the video card.
o Most BIOS chips use a system of beep codes to indicate the POST status
to the user and each BIOS chipset uses a different code.
o The IBM PC BIOS code standard, for example, uses one short beep to
indicate a successful POST and two short beeps to indicate a POST error
while AMI BIOS uses these same beep codes to indicate a DRAM refresh
failure or parity circuit failure, respectively.
6. Plug and play BIOS
What is a plug and play BIOS?
o Prior to Windows 95 the BIOS was responsible for managing all hardware
devices such as the floppy and hard disk drives, serial and parallel ports,
video and network cards, the keyboard, and system clock.
o When hardware was added to the system, the user adding the hardware
had to set a variety of parameters such as the starting address in memory
where the buffers and startup code could be found as well as the interrupt
priority level (IRQ) of the device.
o Windows 95 introduced Plug-and-Play (PnP) BIOS which automates the
process of detecting and adding hardware to a system.
o In addition to making it far easier for the user to add hardware devices --
PnP eliminated hardware conflicts that could cripple the PC.
7. Bootstrap Illustrated
8. First sector of a harddrive
The first 512 bytes on a hard drive -- aka Logical Sector Zero -- contain the
Master Boot Record (MBR).
The MBR contains the boot code and the partition table.
The partition table identifies the file system on the partitions on the disk; there
must be at least one.
The boot code processes the partition table to identity which partition is bootable;
control then transfers to the first sector, called the boot sector, of the active
partition (there can be only one). The boot sector is operating system-specific.
9. Booting from active partition
Once the information in the first sector is read into memory:
o The Master Boot Record (MBR) contains the partition table and boot code
o The boot code finds the bootable partition on this drive
o The boot code transfers control to the program on the first sector of active
partition
o The first sector of active partition is called the OS boot sector, or Volume
Boot Record (VBR)
10. Volume Boot Record
VBR ( OS Boot sector) contain:
o OS and volume file system-specific information.
o For example, in the FAT file system, the boot sector information includes
the sector size,
cluster size,
number of FATs,
number of entries in the root directory,
number of sectors in the file system,
FAT size,
volume serial number,
volume label, and
file system type.
11. Booting the OS from the MBR
12. Boot Code
The boot code in a DOS disk exists in the first 446 bytes of the first 512 byte
sector, which is the MBR.
The end of the sector contains the partition table.
Boot sector viruses insert themselves into the first 446 bytes of the MBR so that
they are executed every time the computer is booted.
The master boot record is read from the first sector of the disk, and the four
partition table entries are identified and processed.
13. Sectors beyond MBR
In a DOS based disk the partition table and boot code requires only one sector,
yet 63 are typically allocated for both the MBR and extended partitions because
the partitions start on a cylinder boundary.
When parts of a partition table have become corrupt, it may be necessary to
search for the extended partition tables.
To find the extended partitions, a search for 0xAA55 in the last two bytes of a
sector could be conducted.
If a sector is found to be a boot sector of a file system, a partition table may exist
63 sectors prior to it.
14. Booting Windows XP and Server 2003
15. Booting Windows Vista/7
16. Operating System Components
Kernel: OS
core
functions
Application
Program
Interface
(API):
Interface to
kernel
File System
and User
Interface:
User/progra
m I/O and
storage
Device
Drivers:
Interface
between
hardware
and OS
Hardware
Devices:
Peripheral
devices
controllers
17. The OS and User Interface
OS is software that sits between the hardware and the users; this is the user
interface
o The OS also provides device drivers so that the applications can
communicate with the hardware
The kernel is the privileged central part of the OS
Well-known OS/user interfaces include
o Command line: DOS, Unix, Linux
o GUI: Windows 9x/NT/Me/2000/XP/2003/Vista, MacOS, Unix/Linux X-
Windows (Gnome, KDE)
18. Types of Operating Systems
DOS Single-tasking operating system
Windows Multi-tasking, single-user. Capable of networking and resource sharing. Used
NETBEUI protocol prior to Windows 2000; largely uses TCP/IP today
MacOS Multi-tasking, single-user, excels at network-based resource sharing. Used
AppleTalk protocol prior to TCP/IP support; Linux-based since OS X.
Novell Network operating system used for resource sharing; supports Windows and
NetWare Mac clients. Dominate NOS in the 1990s using IPX protocol; Linux-based since
NetWare v5 using TCP/IP.
Unix Multi-tasking, single- or multi-user OS. Predominant server OS on Internet
servers; has always used TCP/IP.
Linux Open-source, lightweight version of UNIX; many variants. Excellent OS for
resource sharing, uses TCP/IP
19. Programs and Processes
A program is code or executable software sitting in a file on some storage device
o Code refers to a programming language, e.g., C++, BASIC, VisualBASIC
(VB), Perl, Java, ...
o Executable files are binary files (DOS .exe or .com) or interpreted files
(.bas, .vbs, .pl, .js, ...)
o A process (or task) is a program that is currently running
20. Application Software
Office applications
o Word processing, presentation graphics, spreadsheet, database
o Image, video, and sound editors
Communications software
o Web browser, e-mail, instant messaging, IRC
Entertainment
o Single-user and network-based games, music players, CD creation
21. File System
The file system provides the framework for storing information on disks and
other nonvolatile media (e.g., writeable CDs and tapes)
o Provides the capability to create, modify, and delete files, examine
directories, etc.
Ability to reference both the physical name and view as well as a logical name
and view
Common file systems include FAT, NTFS, ufs, ext2fs, HFS/HFS+
What Is Booting a Computer?
Are you intrigued by the mystery of what happens when you turn your computer on? Does it all seem
like magic to you when the start screen appears on your monitor? Actually, the term booting comes
from that little tab on the back a boot, called a bootstrap, that helps you pull your boot on.
Booting a computer refers to the process of powering on the computer and starting the operating
system. The operating system is the program that makes all your software applications and
hardware work together, so you can do the work you want to do. Once you hit the power button, it's
all automatic from there. The boot process loads the operating system into main memory or the
random access memory (RAM) installed on your computer. Now let's learn a little more about the
boot process.