R23 Os-Unit-I
R23 Os-Unit-I
II B .TECH,II-SEM CSE
UNIT-I
Operating Systems Overview: Operating system functions, Operating system structure, operating systems
Operations, protection and security, Computing Environments, Open- Source Operating Systems
System Structures: Operating System Services, User and Operating-System Interface, systems calls, Types of
System Calls, system programs, operating system structure, operating system debugging, System Boot.
Operating Systems Overview :
1.Application Software
2. System Software
1. Application Software
Application software consists of the programs for performing tasks particular to the machine’s utilization. This
software is designed to solve a particular problem for users.
Examples of application software include spreadsheets , database systems, desktop publishing systems , program
development software and games.
2. System Software
On the other hand system software is more transparent and less noticed by the typical computer user. This
software provides a general programming environment in which programmers can create specific applications to
suit their needs. This environment provides new functions that are not available at the hardware level and performs
tasks related to executing the application programs. System software acts as an interface between the hardware
of the computer and the application software that users need to run on the computer.
Operating System : An Operating System is a program or system software that acts as an intermediary
between a user of a computer and the computer hardware .
An Operating System (OS) is a collection of programs that acts as an interface between a user of a
computer and the computer hardware.
The purpose of an operating system is to provide an environment in which a user may execute their
application programs.
Operating Systems are viewed as resource managers. The main resource is the computer hardware in
the form of processors, storage devices, input/output devices, communication devices and data.
A program that acts as an intermediary between a user of a computer and the computer hardware
1
Provides an interface between the computer hardware and the programmer that simplifies and makes
feasible the creation ,coding ,debugging and maintenance of application programs .
Computer system consisting of hardware software and data . The Operating System provides the means
for proper use of these resources in the operation of the computer system .
The purpose of an Operating System is to provide an environment in which users can execute their
programs in a convenient and efficient manner.
2
Two Views of Operating System
The Role of Operating System can be viewed in two ways
1. User's View
2. System View
User's View :
The user view of the computer depends on the interface being used
i) Some users may use PC’s : Users sit in front of a PC Such systems are designed for one user to monopolize
its resources .In these cases the operating system is designed mostly for ease of use (convenience) with some
attention paid to performance and none paid to resource utilization.
ii) Some users may use a terminal connected to a mainframe or minicomputers : The multiple users share
resources and may exchange information . In these cases the operating system is designed to maximize resource
utilization-so that all available CPU time memory & I/O are used efficiently and no user takes more than his share.
iii)Some users sit at PC connected to networks of other workstations and servers:These users have
dedicated resources at their disposal but they also share resources such as networking and servers-file compute
and print servers. Therefore their operating system is designed to compromise between individual usability and
resource utilization.
3
iv) Recently many varieties of handheld computers have come into fashion. Most of these devices are
standalone units for individual users. Some are connected to networks either directly by wire or (more often) through
wireless modems and networking. Because of power speed and interface limitations they perform relatively few
remote operations. Their operating systems are designed mostly for individual usability but performance per unit of
battery life is important as well.
v) Some computers have little or no user view. For example embedded computers in home devices and
automobiles may have numeric keypads and may turn indicator lights on or off to show status but they and their
operating systems are designed primarily to run without user intervention
System View
From the computer's point of view operating system viewed as a resource allocator.
A computer system has many resources (hardware and software) that may be required to solve a problem: CPU
time memory space files storage space input/output devices etc. The operating system acts as the manager of
these resources and allocates them to specific programs and users as necessary for their tasks.
From the computer's point of view operating system viewed as a control program.
The OS controls and co-ordinates the execution of user programs to prevent errors and improper use of the
computer . It is especially concerned with the operation and control of I/O devices.
4
Protection and Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
5
Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main memory provides a fast
storage that can be accessed directly by the CPU. For a program to be executed it must be in the main memory.
Processor Management
In multiprogramming environment the OS decides which process gets the processor when and for how much time.
This function is called processor or CPU Scheduling.
Process Management
A process is a program in execution.
The OS is responsible for the following activities of the process management
6
communication.
• Provides mechanism for deadlock handling.
Device Management
An Operating System manages device communication via their respective drivers.
Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and usage. These directories may contain
files and other directories .
The OS is responsible for the following activities of the File Management
It helps to create new files in computer system and placing them at the specific locations.
It helps in easily and quickly locating these files in computer system.
It makes the process of sharing of the files among different users very easily and user friendly.
It helps to stores the files in separate folders known as directories. These directories help users to search
file quickly or to manage the files according to their types or uses.
It helps the user to modify the data of files or to modify the name of the file in the directories.
Protection and Security
Security : It involves guarding of a user’s data and programs against interference by external entities, e.g. unauthorized
persons.
• In a non multi programmed system, As soon as one job leaves the CPU and goes for some other task (say
I/O ), the CPU becomes idle. The CPU keeps waiting and waiting until this job (which was executing earlier)
comes back and resumes its execution with the CPU. So CPU remains free for all this while.
• Now it has a drawback that the CPU remains idle for a very long period of time. Also, other jobs which are
waiting to be executed might not get a chance to execute because the CPU is still allocated to the earlier
job.
This poses a very serious problem that even though other jobs are ready to execute, CPU is not allocated
to them as the CPU is allocated to a job which is not even utilizing it (as it is busy in I/O tasks).
• It cannot happen that one job is using the CPU for say 1 hour while the others have been waiting in the
queue for 5 hours. To avoid situations like this and come up with efficient utilization of CPU, the concept of
multi programming came up.
8
31 Tuesday, July
16, 2019
Memory Layout for Multi programmed System
9
Multi tasking system’s working –
In a time sharing system, each process is assigned some specific quantum of time for which a process is
meant to execute. Say there are 4 processes P1, P2, P3, P4 ready to execute. So each of them are
assigned some time quantum for which they will execute e.g time quantum of 5 nanoseconds (5 ns). As
one process begins execution (say P2), it executes for that quantum of time (5 ns). After 5 ns the CPU
starts the execution of the other process (say P3) for the specified quantum of time.
Thus the CPU makes the processes to share time slices between them and execute accordingly. As soon
as time quantum of one process expires, another process begins its execution.
Here also basically a context switch is occurring but it is occurring so fast that the user is able to interact
with each program separately while it is running.
This way, the user is given the illusion that multiple processes/ tasks are executing simultaneously. But
actually only one process/ task is executing at a particular instant of time.
10
Multiprocessing
In a uni-processor system, only one process executes at a time.
Multiprocessing is the use of two or more CPUs (processors) within a single Computer system. The term also refers to the
ability of a system to support more than one processor within a single computer system.
With the help of multiprocessing, many processes can be executed simultaneously. Say processes P1, P2, P3 and
P4 are waiting for execution. Now in a single processor system, firstly one process will execute, then the other, then
the other and so on.
But with multiprocessing, each process can be assigned to a different processor for its execution. If its a dual-core
processor (2 processors), two processes can be executed simultaneously and thus will be two times faster, similarly
a quad core processor will be four times as fast as a single processor
Multiprocessing refers to the hardware (i.e., the CPU units) rather than the
software (i.e., running processes).
11
Multi threading –
A thread is a basic unit of CPU utilization. Multi threading is an execution model that allows a single process to
have multiple code segments (i.e., threads) running concurrently within the “context”of that process.
e.g. VLC media player, where one thread is used for opening the VLC media player, one thread for playing a
particular song and another thread for adding new songs to the playlist
12
1.3 Operating-System Operations
Modern operating systems are interrupt driven that means If there are no processes to execute, no I/O
devices to service, and no users to whom to respond,
An operating system will sit quietly, waiting for something to happen.
Events are almost always signaled by the occurrence of an interrupt or a trap.
what is trap ?
A trap (or an exception) is a software-generated interrupt caused either by an error (for example, division by zero
or invalid memory access) or by a specific request from a user program to the operating-system to get the services
of the OS.
The interrupt-driven nature of an operating system defines that system's general structure. For each type
of interrupt, separate segments of code in the operating system determine what action should be taken.
An interrupt service routine is provided that is responsible for dealing with the interrupt.
Since the operating system and the users share the hardware and software resources of the computer system, we
need to make sure that an error in a user program could cause problems only for the one program that was running.
With sharing, many processes could be adversely affected by a bug in one program. For example, if a process gets
stuck in an infinite loop, this loop could prevent the correct operation of many other processes.
A properly designed operating system must ensure that an incorrect (or malicious) program cannot cause
other programs to execute incorrectly.
13
Dual-Mode Operation
In order to ensure the proper execution of the operating system, we must be able to distinguish between the
execution of operating-system code and user defined code.
The approach taken by most computer systems is to provide hardware support that allows us to differentiate among
various modes of execution.
A bit, called the mode bit, is added to the hardware of the computer to indicate the current mode: kernel (0) or user
(1). With the mode bit, we are able to distinguish between a task that is executed on behalf of the operating system
and one that is executed on behalf of the user
• When the computer system is executing on behalf of a user application, the system is in user mode.
• However, when a user application requests a service from the operating system (via a system call), it
must transition from user to kernel mode to fulfill the request. As we shall see, this architectural
enhancement is useful for many other aspects of system operation as well.
• At system boot time, the hardware starts in kernel mode.
14
• The operating system is then loaded and starts user applications in user mode.
• Whenever a trap or interrupt occurs, the hardware switches from user mode to kernel mode (that is,
changes the state of the mode bit to 0).
• Thus, whenever the operating system gains control of the computer, it is in kernel mode.
• The system always switches to user mode (by setting the mode bit to 1) before passing control to a user
program.
The dual mode of operation provides us with the means for protecting the operating system from errant
users.
We accomplish this protection by designating some of the machine instructions that may cause harm as
privileged instructions. The hardware allows privileged instructions to be executed only in kernel mode.
If an attempt is made to execute a privileged instruction in user mode, the hardware does not execute the
instruction but rather treats it as illegal and traps it to the operating system
Timer
We must ensure that the operating system maintains control over the CPU. We ust prevent a user program
from getting stuck in an infinite loop .To accomplish this goal, we can use a timer. A timer can be set to interrupt
the computer after a specified period.
The period may be fixed (for example, 1/60 second) or variable (for example, from 1 millisecond to 1 second).
15
The operating system sets the counter. Every time the clock ticks, the counter is decremented. When the counter
reaches 0, an interrupt occurs.
As long as the counter is positive, control is returned to the user program.
When the counter becomes negative, the operating system terminates the program for exceeding the assigned
time limit.
Computing Environment is a collection of computers which are used to process and exchange the information to
solve various types of computing problems.
The following are the various types of computing environments
16
Time Sharing Computing Environment
Time sharing computing environment is stand alone computer in which a single user can perform multiple
operations at a time by using multitasking operating system. Here the processor time is divided among different
tasks and this is called “Time sharing”. For example, a user can listen to music while writing something in a text
editor. Windows 95 and later versions of windows OS, iOS and Linux operating systems are the examples for this
computing environment.
17
Distributed Computing Environment
In the distributed computing environment, the complete functionality of a software is not on single computer but is
distributed among multiple computers. Here we use a method of computer processing in which different programs
of an application run simultaneously on two or more computers. These computers communicate with each other
over a network to perform the complete task. In distributed computing environment, the data is distributed among
different systems and that data is logically related to each other.
18
Peer-to-Peer Computing
19
Grid computing serves computing resources such as network, server, applications to the individual users. Grid
involves the loosely coupled systems in which jobs are managed and scheduled in a distributed way. It divides a
massive job in smaller chunks and processes those chunks separately. Grid computing is a combination of non-
centralized computing resources where each geographically separate, independent site has its own administrative
control over it.
Cloud Computing Environment
Cloud computing is a modern computing paradigm which provides scalable and flexible IT infrastructure and
essential services to the users through the internet.
20
1.6 Open-Source Operating Systems
Operating systems made available in source-code format rather than just binary closed-source
Started by Free Software Foundation (FSF) which has “copyleft” GNU Public License (GPL)
Copyrights exist in order to protect authors of documentation or software from unauthorized copying or
selling of their work. A copyright infers that only with the author's permission may such activities take place.
Copyleft overrides copyright and promotes the concept that materials be freely used, copied and modified
by others. Copyleft also requires all modified and extended versions of the material also be freely
accessible, used and modified by others.
Examples include GNU/Linux BSD UNIX (including core of Mac OS X) and Sun OpenSolaris , Ubuntu ,
ReactOS , Haiku OS
Ubuntu
The most widely used open source data base is Ubuntu. It is a Linux based operating system and is
distributed free along with the source code. Its desktop looks somewhat similar to that of Windows, with
window controls and icons. There is reasonable large software support available on Ubuntu; the common
applications include Mozilla Firefox web browser, LibreOffice office application suite, GIMP image editor
and so on.
Ubuntu is distributed under GNU and GPL license. It has UNIX shell called as Terminal that can be used
to interact with the network and install third-party applications.
21
OpenSolaris
OpenSolaris is a computer operating system developed by Sun Microsystems. It runs well on desktops,
laptops, servers and data centers. OpenSolaris is GUI based like Ubuntu and has rich graphical desktop
and windows for easy navigation.
FreeBSD
FreeBSD is an advanced operating system for x86 compatible (including Pentium and Athlon), AMD64
compatible. It is popular among network developers, as FreeBSD offers advanced networking,
performance, security and compatibility features. Most software that runs on Linux can run on FreeBSD
without the need for any compatibility layer.
ReactOS
It is a free Windows compatible OS that offers the benefits of running Windows apps natively. Apart from
being an open-source software (its main highlight), the tool has one really cool feature that Windows failed
to offer – An application manager very much similar to Linux package manager.
Haiku OS
What most users like about this OS is its uniformity and cohesiveness.
To start up the operating system, one simply inserts the thumb drive into a USB port and reboot. This
should not pose a problem as most modern computers these days can be set to boot from the USB key.
The OS is fast and responsive. Moreover, it is equipped with a number of applications and demos pre-
installed.
System Structures:
22
o Communications – Processes may exchange information, on the same computer or between
computers over a network
Communications may be via shared memory or through message passing (packets moved
by the OS)
o Error detection – OS needs to be constantly aware of possible errors
May occur in the CPU and memory hardware, in I/O devices, in user program
For each type of error, OS should take the appropriate action to ensure correct and consistent
computing
o Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use
the system
2. Another set of OS functions exists for ensuring the efficient operation of the system itself via resource
sharing
– Resource allocation - When multiple users or multiple jobs running concurrently, resources must
be allocated to each of them
• Many types of resources - CPU cycles, main memory, file storage, I/O devices.
– Accounting - To keep track of which users use how much and what kinds of computer resources
– Protection and security - The owners of information stored in a multiuser or networked computer
system may want to control use of that information, concurrent processes should not interfere with
each other
• Protection involves ensuring that all access to system resources is controlled
• Security of the system from outsiders requires user authentication, extends to defending
external I/O devices from invalid access attempts
23
1.8 User Operating System Interface
User Operating System Interface – CLI
CLI or command interpreter allows direct command entry
– Sometimes implemented in kernel, sometimes by systems program
– Sometimes multiple flavors implemented – shells
Bourne shell (sh),C shell (csh),TC shell (tcsh)
Korn shell (ksh),Bourne Again shell (bash)
– Primarily fetches a command from user and executes it
– Sometimes commands built-in, sometimes just names of programs
Bourne Shell Command Interpreter
24
User Operating System Interface – GUI
• User-friendly desktop metaphor interface (an interface metaphor is a set of user interface visuals, actions
and procedures that exploit specific knowledge that users already have of other domain)
– Usually mouse, keyboard, and monitor
– Icons represent files, programs, actions, etc
– Various mouse buttons over objects in the interface cause various actions (provide information,
options, execute function, open directory (known as a folder)
– Invented at Xerox PARC
• Many systems now include both CLI and GUI interfaces
– Microsoft Windows is GUI with CLI “command” shell
– Apple Mac OS X is “Aqua” GUI interface with UNIX kernel underneath and shells available
– Unix and Linux have CLI with optional GUI interfaces (CDE, KDE, GNOME)
User Operating System Interface –Touch screen Interfaces
Touch screen devices require new interfaces
Mouse not possible or not desired
Actions and selection based on touches or gestures
Virtual keyboard for text entry
Voice commands.
25
The Mac OS X GUI
26
User Mode
• When CPU is in user mode, the programs don't have direct access to memory and hardware resources.
• In user mode, if any program crashes, only that particular program is halted.
• That means the system will be in a safe state even if a program in user mode crashes.
• Hence, most programs in an OS run in user mode.
Kernel Mode
• When CPU is in kernel mode, the code being executed can access any memory address and any
hardware resource.
• Hence kernel mode is a very privileged and powerful mode.
• If a program crashes in kernel mode, the entire system will be halted.
System Calls
• When a program in user mode requires access to RAM or a hardware resource, it must ask the kernel to
provide access to that resource. This is done via something called a system call.
• When a program makes a system call, the mode of CPU is switched from user mode to kernel mode. This
is called a context switch.
• Then the kernel provides the resource which the program requested. After that, another context switch
happens which results in change of mode from kernel mode back to user mode.
• Generally, system calls are made by the user level programs in the following situations:
Creating, opening, closing and deleting files in the file system.
Creating and managing new processes.
Creating a connection in the network, sending and receiving packets.
Requesting access to a hardware device, like a mouse or a printer.
• So System call is the programmatic way in which a computer program requests a service from the kernel
of the Operating System .
27
• Programming interface to the services provided by the OS
• These calls are generally available as routines written in C or C++
• Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including
virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)
28
System Call Implementation
• The system call interface invokes the intended system call in OS kernel and returns status of the system
call and any return values
• The caller need know nothing about how the system call is implemented
– Just needs to obey API and understand what OS will do as a result call
• Managed by run-time support library (set of functions built into libraries included with
compiler)
29
System Call Parameter Passing
• Often, more information is required than simply identity of desired system call
– Parameters stored in a block, or table, in memory, and address of block passed as a parameter
in a register
– Parameters placed, or pushed, onto the stack by the program and popped off the stack by the
operating system
Block and stack methods do not limit the number or length of parameters being passed
30
1.10 Types of System Calls
1. Process control
– end, abort
– load, execute
2. File management
31
– read, write, reposition
3. Device management
4. Information maintenance
5. Communications
– send, receive messages if message passing model to host name or process name
6. Protection
32
Standard C Library Example
• C program invoking printf() library call, which calls write() system call
33
• System programs also known as system utilities provide a convenient environment for program
development and execution. Some of them are simply user interfaces to system calls ; others are
considerably more complex. They can be divided into:
– File manipulation :
– Status information
– File modification
– Communications
– Background services
– Application programs
• Most users’ view of the operating system is defined by system programs, not the actual system calls
34
– Some of them are simply user interfaces to system calls; others are considerably more complex
• File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and
directories
• Status information
– Some ask the system for info - date, time, amount of available memory, disk space, number of
users
– Typically, these programs format and print the output to the terminal or other output devices
– Some systems implement a registry - used to store and retrieve configuration information
• File modification
• Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-
loaders, debugging systems for higher-level and machine language
• Communications - Provide the mechanism for creating virtual connections among processes, users, and
computer systems
– Allow users to send messages to one another’s screens, browse web pages, send electronic-mail
messages, log in remotely, transfer files from one machine to another
• Background Services
– Provide facilities like disk checking, process scheduling, error logging, printing
• Application programs
35
– Run by users
• Design Goals
– User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast
– System goals – operating system should be easy to design, implement, and maintain, as well as
flexible, reliable, error-free, and efficient
• Implementation
Most modern OSes are written in C, or more recently, C++. Critical sections of code are still written in assembly
language, ( or written in C, compiled to assembly
– User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast
– System goals – operating system should be easy to design, implement, and maintain, as well as
flexible, reliable, error-free, and efficient
OS components and its organization and its interactions is called Operating System structure. The following are
the some of the OS structures.
36
1.Simple Structure -- MS-DOS
– Although MS-DOS has some structure, its interfaces and levels of functionality are not well
separated
37
The UNIX OS consists of two separable parts
– Systems programs
– The kernel
• Consists of everything below the system-call interface and above the physical hardware
• Provides the file system, CPU scheduling, memory management, and other operating-
system functions; a large number of functions for one level
38
3.Layered Approach
• The operating system is divided into a number of layers (levels), each built on top of lower layers.
• The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.
• With modularity, layers are selected such that each uses functions (operations) and services of only lower-
level layers.
39
4.Microkernel System Structure
• The basic idea behind micro kernels is to remove all non-essential services from the kernel, and implement
them as system applications instead, thereby making the kernel as small and efficient as possible.
• Most microkernels provide basic process and memory management, and message passing between other
services, and not much more.
• Security and protection can be enhanced, as most services are performed in user mode, not kernel mode.
• System expansion can also be easier, because it only involves adding more system applications, not
rebuilding a new kernel.
• Mach was the first and most widely known microkernel, and now forms a major component of Mac OSX.
• Windows NT was originally microkernel, but suffered from performance problems relative to Windows 95.
NT 4.0 improved performance by moving more services into the kernel, and now XP is back to being more
monolithic.
• Benefits:
– More secure
• Detriments:
40
Microkernel System Structure
messages messages
microkernel
hardware
5.Modular kernel
41
Hybrid Systems
• Most modern operating systems are actually not one pure model
– Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading
of functionality
– Below is kernel consisting of Mach microkernel and BSD Unix parts, plus I/O kit and dynamically
loadable modules (called kernel extensions)
– The Mac OSX architecture relies on the Mach microkernel for basic system management services,
and the BSD kernel for additional services.
Application services and dynamically loadable modules ( kernel extensions ) provide the rest of the OS functionality:
Mac OS X Structure
42
graphical user interface
Aqua
kernel environment
BSD
Mach
iOS
Android
– Open Source
43
• Similar stack to IOS
• Runtime environment includes core set of libraries and Dalvik virtual machine
• Java class files compiled to Java bytecode then translated to executable than runs in
Dalvik VM
• Libraries include frameworks for web browser (webkit), database (SQLite), multimedia, smaller libc
Applications
Android Architecture
Application Framework
surface media
Dalvik
manager framework
virtual machine
webkit libc
Linux kernel
Debugging is the process of finding the problems in a computer system and solving them.
There are many different ways in which operating systems perform debugging. Some of these
are:
44
Log Files
The log files record all the events that occur in an operating system. This is done by writing all
the messages into a log file. There are different types of log files. Some of these are given as
follows:
Event Logs
These stores the records of all the events that occur in the execution of a system. This is done
so that the activities of all the events can be understood to diagnose problems.
Transaction Logs
The transaction logs store the changes to the data so that the system can recover from crashes
and other errors. These logs are readable by a human.
Message Logs
These logs store both the public and private messages between the users. They are mostly
plain text files, but in some cases they may be HTML files.
The core dump files contain the memory address space of a process that terminates
unexpectedly. The creation of the core dump is triggered in response to program crashes by
the kernel. The core dump files are used by the developers to find the program’s state at the
time of its termination so that they can find out why the termination occurred.
The automatic creation of the core dump files can be disabled by the users. This may be done
to improve performance, clear disk space or increase security.
In the event of a total system failure, the information about the state of the operating system is
captured in crash dump files. There are three types of dump that can be captured when a
system crashes. These are:
45
The whole contents of the physical memory at the time of the system crash are captured in the
complete memory dump. This is the default setting on the Windows Server System.
Only the kernel mode read and write pages that are present in the main memory at the time of
the system crash are stored in the kernel memory dump.
This memory dump contains the list of device drivers, stop code, process and thread
information, kernel stack etc.
Use an operating system probe to monitor system resources, CPU usage, disk activity,
physical memory use, and network traffic. Probes fire when code is executed within a
provider, capturing state data and sending it to consumers of those probes
Example of following XEventsQueued system call move from libc library to kernel and
back
46
DTrace code to record amount of time each process with UserID 101 is in running mode
(on CPU) in nanoseconds
Profiling
This is a type of program analysis that measures various parameters in a program such
as space and time complexity, frequency and duration of function calls, usage of specific
instructions etc. Profiling is done by monitoring the source code of the required system
program using a code profiler.
The BIOS, operating system and hardware components of a computer system should all be
working correctly for it to boot. If any of these elements fail, it leads to a failed boot sequence.
The following diagram demonstrates the steps involved in a system boot process:
47
Here are the steps:
The CPU initializes itself after the power in the computer is first turned on. This is done
by triggering a series of clock ticks that are generated by the system clock.
After this, the CPU looks for the system’s ROM BIOS to obtain the first instruction in the
start-up program. This first instruction is stored in the ROM BIOS and it instructs the
system to run POST (Power On Self Test) in a memory address that is predetermined.
POST first checks the BIOS chip and then the CMOS RAM. If there is no battery failure
detected by POST, then it continues to initialize the CPU.
POST also checks the hardware devices, secondary storage devices such as hard
drives, ports etc. And other hardware devices such as the mouse and keyboard. This
is done to make sure they are working properly.
After POST makes sure that all the components are working properly, then the BIOS
finds an operating system to load.
In most computer system’s, the operating system loads from the C drive onto the hard
drive. The CMOS chip typically tells the BIOS where the operating system is found.
The order of the different drives that CMOS looks at while finding the operating system
is known as the boot sequence. This sequence can be changed by changing the CMOS
setup.
48
After finding the appropriate boot drive, the BIOS first finds the boot record which tells
it to find the beginning of the operating system.
After the initialization of the operating system, the BIOS copies the files into the memory.
Then the operating system controls the boot process.
In the end, the operating system does a final inventory of the system memory and loads
the device drivers needed to control the peripheral devices.
The users can access the system applications to perform various tasks.
Without the system boot process, the computer users would have to download all the software
components, including the ones not frequently required. With the system boot, only those
software components need to be downloaded that are legitimately required and all extraneous
components are not required. This process frees up a lot of space in the memory and
consequently saves a lot of time.
49