Professional Documents
Culture Documents
Hardware
BIOS
OS
Users
Applications
2
Hardware
Hardware forms the core of a PC hierarchy; there is no
computer without the hardware
The hardware includes all of the circuits, drives,
expansion boards, power supplies, peripheral devices, and
their interconnecting wiring or cables (everything you can
physically touch)
3
BIOS
BIOS stands for Basic Input/Output System
A BIOS is a set of small programs (or services) that are
designed to operate each major PC subsystem
Each of these services (daemons in Unix) is invoked by a set
of standard calls
When the operating system requests a standard BOIS
service, the particular BIOS program will perform the
appropriate function tailored to the particular hardware
In addition to services, the BIOS runs a power on self-test
(POST) program each time the PC is initialized BIOS
resides on the motherboard in the form of a read-only
memory (ROM) IC
Better BIOS routines will result in superior system
performance
4
CHANGING ENVIRONMENT
Modern BIOS adds features including:
Advanced security settings
Boot sequence options (USB/NET/CD…)
Time stamp changes
Hardware management, control etc
Some even handle virus/Intrusion protection on a basic
scale
5
Operating System
6
Applications
The aim of a computer is to execute applications (games, word
processors, spreadsheets, etc.)
The OS allows the user to launch these Applications
As the application requires system resources during run-time,
it will make a call to the OS or BIOS, which in turn will access
the function and return any information needed to the calling
application
7
A typical microcomputer operating system
Resident operating system
System disk
Printer
Transient area
Resident routines
9
Cont….
Resident Commands Transient Commands
10
Accessing peripherals in DOS
The task of accessing peripheral devices is divided between two of
the operating system modules:
IO.SYS
(called IBMBIO.COM under PC-DOS) is a hardware-dependent
module that issues physical data transfer commands.
On an IBM PC, this module interacts with a proprietary, basic
input/output system, or BIOS, implemented in read-only memory.
MSDOS.SYS:
hardware-independent module used for the implementation of Logical
I/O and other file system functions.
accepts logical I/O requests from application programs or other
operating system modules, translates them into physical I/O
commands, and passes the physical commands to IO.SYS
NB: only IO.SYS, the machine-dependent module, deals directly
with peripheral devices
11
Two modules, IO.SYS and MSDOS.SYS, share responsibility for accessing
peripheral request
devices.
MSDOS.SYS
uses a device driver to translate
logical I/O to physical form. COMMAND.COM
12
Directory management.
One of MSDOS.SYS’s responsibilities is directory management.
COMMAND.COM
MSDOS.SYS
Directory management
Create
Read Rewrite
Delete
directory directory
Update
Directory
IO.SYS
Directory copy
13
Cont…
1. Commands are read and interpreted by COMMAND.COM. Following a
make directory (MKDIR) command, COMMAND.COM calls MSDOS.SYS.
2. MSDOS.SYS then asks IO.SYS to read the directory.
COMMAND.COM
MSDOS.SYS
Directory management
Create
Read Rewrite
Delete
directory directory
Update
Directory
IO.SYS
14
Cont…
3. Once the directory is in memory, MSDOS.SYS can modify it. As an
example, a new directory entry is added.
4. Finally, MSDOS.SYS asks IO.SYS to write the directory to disk.
COMMAND.COM
MSDOS.SYS
Directory management
Create
Read Rewrite
Delete
directory directory
Update
Directory
IO.SYS
15
Cont…
COMMAND.COM
MSDOS.SYS
Directory management
Create
Read Rewrite
Delete
directory directory
Update
Directory
IO.SYS
17
Flow Chart of BIOS Functions
Turn on Computer
Plug’n’Play
18
POST (Power On Self Test)
19
Plug and Play
Bios next looks for additional BIOS memory chips – might
be on a Plug and Play card such as video card or a SCSI
controller.
If present, they run their routines and supplement or replace some
functions of the system BIOS.
If components no longer match the data stored in the CMOS
(i.e. hardware change), message appreas on screen to
update.
After all hardware components have been found and
checked, Plug and Play goes to work.
Interrupts and DMA channels of the plug-in cards in the ISA
and PCI buses are queried and distributed.
Onboard hardware, located on motherboard and in its
ISA/PCI slots, are configured for operation.
20
Bootstrap Loader
BIOS next accesses the first sector of the hard drive, also
termed the boot sector, and starts the “bootstrap loader”
A small program that knows the file structure of the storage
medium and can call the operating system’s start routine.
21
An Interpreter
In old operating systems (DOS 6.2), the BIOS acts as a
mediator (or interface) between the hardware and the
software.
New operating systems, circumvent the BIOS and
communicate directly with the hardware through the
appropriate drivers.
BIOS Updating
The BIOS is manufactured on FLASH technology. It is
easily updated.
Previous versions of BIOS were developed on ROM,
EPROM, and EEPROM chips.
22
DOS (Disk Operating System) Fundamentals
Consisted of two parts
The BIOS itself is one part of the operating system.
The other part consists of the operating system program files.
Program files consist of
Utilities
A kernel that is loaded into the main memory when the
computer boots.
23
Microsoft Kernels
Kernel of a Microsoft operating system consists of
Msdos.sys
Io.sys
MSDOS.sys controls the keyboard input and the
screen output.
IO.sys communicates with the BIOS and contains
the actual program code of the operating system and
a process control for the hardware.
24
Bootstrapping
Bootstrapping: Introduction
Computers execute programs stored in main memory,
and initially the operating system is on the hard disk.
When the computer is turned on it does not have an
operating system loaded in memory and the hardware
alone cannot do the operations of an OS. To solve this
paradox a special program called bootstrap loader is
created.
This program does not have the full functionality of an
operating system, but it is capable of loading into
memory a more elaborated software(i.e. loader2)
which in its turn will load the operating system.
Once the OS has been loaded the loader transfers the
control of the system to the Operating system. 26
Bootstrapping continued…
Early programmable computers had toggle switches on the
front panel to allow the operator to place the bootloader into
the program store before starting the CPU.
27
Bootstrapping continued…
CPU MEMORY
I/O OPERATIONS
ROM
OS
LOADER2 28
Bootstrapping continued…
CPU MEMORY
LOADER2
I/O OPERATIONS
ROM
OS
LOADER2 29
Bootstrapping continued…
0 os
99998
Ф=0
100000 READ
STORE Ф
Ф Ф+1 LOADER 2
IF EOF IP 0
ELSE IP 100000 30
Bootstrapping continued…
CPU OS
LOADER2
I/O OPERATIONS
ROM
OS
LOADER2 31
Bootstrapping continued…
32
Why is Booting Required ?
Hardware doesn’t know where the operating
system resides and how to load it.
Need a special program to do this job –
Bootstrap loader.
E.g. BIOS – Boot Input Output System.
Bootstrap loader locates the kernel, loads it
into main memory and starts its execution.
In some systems, a simple bootstrap loader
fetches a more complex boot program from
disk, which in turn loads the kernel.
33
How Boot process occurs ?
Reset event on CPU (power up, reboot) causes
instruction register to be loaded with a predefined
memory location. It contains a jump instruction that
transfers execution to the location of Bootstrap
program.
This program is form of ROM, since RAM is in
unknown state at system startup. ROM is convenient
as it needs no initialization and can’t be affected by
virus.
34
Tasks performed at boot up
Run diagnostics to determine the state of
machine. If diagnostics pass, booting
continues.
Runs a Power-On Self Test (POST) to check the
devices that the computer will rely on, are
functioning.
BIOS goes through a preconfigured list of
devices until it finds one that is bootable. If it
finds no such device, an error is given and the
boot process stops.
Initializes CPU registers, device controllers and
contents of the main memory. After this, it
loads the OS.
35
Tasks performed at boot up (Cont…)
On finding a bootable device, the BIOS loads
and executes its boot sector. In the case of a
hard drive, this is referred to as the master
boot record (MBR) and is often not OS specific.
The MBR code checks the partition table for an
active partition. If one is found, the MBR code
loads that partition's boot sector and executes
it.
The boot sector is often operating system
specific, however in most operating systems
its main function is to load and execute a
kernel, which continues startup.
36
Secondary Boot Loaders
If there is no active partition or the active
partition's boot sector is invalid, the MBR may
load a secondary boot loader and pass control
to it and this secondary boot loader will select
a partition (often via user input) and load its
boot sector.
Examples of secondary boot loaders
GRUB – GRand Unified Bootloader
LILO – LInux LOader
NTLDR – NT Loader
37
Booting and ROM
System such as cellular phones, PDAs and game
consoles stores entire OS on ROM. Done only for
small OS, simple supporting hardware, and rugged
operation.
Changing bootstrap code would require changing
ROM chips.
EPROM – Erasable Programmable ROM.
Code execution in ROM is slower. Copied to RAM for
faster execution.
38
Example : DOS
After identifying the location of boot files, BIOS looks at the first
sector (512 bytes) and copies information to specific location in
RAM (7C00H) - Boot Record.
Control passes from BIOS to a program residing in the boot
record.
Boot record loads the initial system file into RAM. For DOS, it is
IO.SYS .
The initial file, IO.SYS includes a file called SYSINIT which loads
the remaining OS into the RAM.
SYSINIT loads a system file MSDOS.SYS that knows how to work
with BIOS.
One of the first OS files that is loaded is the system configuration
file, CONFIG.SYS in case of DOS. Information in the configuration
file tells loading program which OS files need to be loaded (e.g.
drivers)
Another special file that is loaded is one which tells what specific
applications or commands user wants to be performed as part of
booting process. In DOS, it is AUTOEXEC.BAT. In Windows, it’s
WIN.INI .
39