0% found this document useful (0 votes)
47 views

1-2. Introduction & OS Structure

The document provides an overview of operating systems and their functions. It defines an operating system as an interface between the user and hardware that is responsible for executing processes, allocating resources, managing the CPU and files, and performing other tasks. It then discusses the goals of operating systems in making computers convenient and efficient to use. Finally, it outlines some key functions of operating systems, including process management, memory management, CPU scheduling, file management, and security.

Uploaded by

the
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

1-2. Introduction & OS Structure

The document provides an overview of operating systems and their functions. It defines an operating system as an interface between the user and hardware that is responsible for executing processes, allocating resources, managing the CPU and files, and performing other tasks. It then discusses the goals of operating systems in making computers convenient and efficient to use. Finally, it outlines some key functions of operating systems, including process management, memory management, CPU scheduling, file management, and security.

Uploaded by

the
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 85

Operating system

Contents
S . No. Topic Slide No
1 Introduction 1
2 Types of OS 6
3 Computer System Structure 11
4 Operating System Services 13
5 Evolution of OS 25
6 System Call & API 43
7 Kernel 60
8 OS Structure 73
9 Booting in OS 81
10 Interrupt 88
What is an operating system?
Definition: An operating system is the most
important software that runs on a computer. It
manages the computer's memory and processes,
as well as all of its software and hardware. It also
allows you to communicate with the computer
without knowing how to speak the computer's
language. Without an operating system, a
computer is useless.
Definition: An Operating System can be defined as an interface between user
and hardware. It is responsible for the execution of all the processes, Resource
Allocation, CPU management, File Management and many other tasks.

The purpose of an operating system is to provide an environment in which a user


can execute programs in convenient and efficient manner.

What is an operating system?


• Execute user programs and make solving user problems easier
• Make the computer system convenient to use
• Use the computer hardware in an efficient manner

Goal’s of operating system?


The three most common operating systems for personal computers are

Microsoft Windows,

macOS, and

Linux.

Modern operating systems use a graphical user interface, or GUI. A GUI lets you
use your mouse to click icons, buttons, and menus, and everything is clearly
displayed on the screen using a combination of graphics and text.

Types of operating system


Microsoft created the Windows operating system in the mid-1980s. There have been
many different versions of Windows, but the most recent ones are Windows
10 (released in 2015), Windows 8 (2012), Windows 7 (2009), and Windows
Vista (2007). Windows comes pre-loaded on most new PCs, which helps to make it
the most popular operating system in the world.

Microsoft Windows
macOS (previously called OS X) is a line of operating systems created by Apple. It
comes preloaded on all Macintosh computers, or Macs. Some of the specific versions
include Mojave (released in 2018), High Sierra (2017), and Sierra (2016).

According to StatCounter Global Stats, macOS users account for less than 10% of
global operating systems—much lower than the percentage of Windows users (more
than 80%). One reason for this is that Apple computers tend to be more expensive.
However, many people do prefer the look and feel of macOS over Windows.

macOS
Linux (pronounced LINN-ux) is a family of open-source operating systems, which
means they can be modified and distributed by anyone around the world. This is
different from proprietary software like Windows, which can only be modified by the
company that owns it. The advantages of Linux are that it is free, and there are many
different distributions—or versions—you can choose from.

According to StatCounter Global Stats, Linux users account for less than 2% of global
operating systems. However, most servers run Linux because it's relatively easy to
customize.

Linux
The operating systems we've been talking about so far were designed to run
on desktop and laptop computers. Mobile devices such as phones, tablet
computers, and MP3 players are different from desktop and laptop computers, so
they run operating systems that are designed specifically for mobile devices.
Examples of mobile operating systems include Apple iOS and Google Android.

Operating systems for mobile


devices
Computer system can be divided into four components
• Hardware – provides basic computing resources, ex. CPU, memory, I/O devices

• Operating system - Controls and coordinates use of hardware among various


applications and users
• Application programs – define the ways in which the system resources are used to
solve the computing problems of the users, ex. Word processors, compilers, web
browsers, database systems, video games
• Users - People, machines, other computers

Computer System Structure


Components of a Computer System

Components of OS: OS has two parts.


(1) Kernel is an active part of an OS i.e., it
is the part of OS running at all times. It is a
program which can interact with the
hardware. Ex: Device driver, .dll files,
system files etc.

(2) Shell is called as the command


interpreter. It is a set of programs used to
interact with the application programs. It is
responsible for execution of instructions
given to OS (called commands).
A View of Operating System Services
Operating System Services
Following are the five services provided by operating systems to the convenience of the users.

1. Program Execution

The purpose of computer systems is to allow the user to execute programs. So the operating system provides an environment
where the user can conveniently run programs. Running a program involves the allocating and deallocating memory, CPU
scheduling in case of multiprocessing.

2. I/O Operations

Each program requires an input and produces output. This involves the use of I/O. So the operating systems are providing I/O
makes it convenient for the users to run programs.

3. File System Manipulation

The output of a program may need to be written into new files or input taken from some files. The operating system provides
this service.
Operating System Services…
4. Communications

The processes need to communicate with each other to exchange information during execution. It may be
between processes running on the same computer or running on the different computers. Communications
can occur in two ways: (i) shared memory or (ii) message passing

5. Error Detection

An error is one part of the system may cause malfunctioning of the complete system. To avoid such a
situation operating system constantly monitors the system for detecting the errors. This relieves the user of
the worry of errors propagating to various part of the system and causing malfunctioning.
Operating System Services
Following are the three services provided by operating systems for ensuring the efficient operation of the system itself.

1. Resource allocation

When multiple users are logged on the system or multiple jobs are running at the same time, resources must be allocated to
each of them. Many different types of resources are managed by the operating system.

2. Accounting

The operating systems keep track of which users use how many and which kinds of computer resources. This record keeping
may be used for accounting (so that users can be billed) or simply for accumulating usage statistics.

3. Protection

When several disjointed processes execute concurrently, it should not be possible for one process to interfere with the others,
or with the operating system itself. Protection involves ensuring that all access to system resources is controlled. Security of
the system from outsiders is also important. Such security starts with each user having to authenticate him to the system,
usually by means of a password, to be allowed access to the resources.
1. Process Management
2. Process Synchronization
3. Memory Management
4. CPU Scheduling
5. File Management
6. Security

What does an Operating system do?


Process Management

A process is a program in execution. A process needs certain resources, including CPU time, memory, files,
and I/O devices, to accomplish its task.

The operating system is responsible for the following activities in connection with process management.

✦ Process creation and deletion.

✦ process suspension and resumption.

✦ Provision of mechanisms for:

• process synchronization

• process communication
Main-Memory Management

Memory is a large array of words or bytes, each with its own address. It is a repository of quickly

accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses its
contents in the case of system failure.

The operating system is responsible for the following activities in connections with memory management:

♦ Keep track of which parts of memory are currently being used and by whom.

♦ Decide which processes to load when memory space becomes available.

♦ Allocate and de-allocate memory space as needed.


File Management

A file is a collection of related information defined by its creator. Commonly, files represent programs

(both source and object forms) and data.

The operating system is responsible for the following activities in connections with file management:

✦ File creation and deletion.

✦ Directory creation and deletion.

✦ Support of primitives for manipulating files and directories.

✦ Mapping files onto secondary storage.

✦ File backup on stable (non-volatile) storage media.


I/O System Management

The I/O system consists of:


✦ A buffer-caching system
✦ A general device-driver interface
✦ Drivers for specific hardware devices
Secondary Storage Management

Since main memory (primary storage) is volatile and too small to accommodate all data and programs

permanently, the computer system must provide secondary storage to back up main memory.

Most modern computer systems use disks as the principle on-line storage medium, for both programs and
data.

The operating system is responsible for the following activities in connection with disk management:

✦ Free space management

✦ Storage allocation

✦ Disk scheduling
Distributed Systems ( Networking )

A distributed system is a collection processors that do not share memory or a clock. Each processor has its
own local memory.

♦ The processors in the system are connected through a communication network.

♦ Communication takes place using a protocol.

♦ A distributed system provides user access to various system resources.

♦ Access to a shared resource allows:

✦ Computation speed-up

✦ Increased data availability

✦ Enhanced reliability
Protection System

Protection refers to a mechanism for controlling access by programs, processes, or users to both

system and user resources.

The protection mechanism must:

✦ distinguish between authorized and unauthorized usage.

✦ specify the controls to be imposed.

✦ provide a means of enforcement.


Command Interpreter System

Many commands are given to the operating system by control statements which deal with:
✦ process creation and management
✦ I/O handling
✦ secondary-storage management
✦ main-memory management
✦ file-system access
✦ protection
✦ networking

The program that reads and interprets control statements is called variously:
✦ command-line interpreter
✦ shell (in UNIX) : Its function is to get and execute the next command statement.
Types of Operating Systems
An operating system is a well-organized collection of programs that manages
the computer hardware. It is a type of system software that is responsible for
the smooth functioning of the computer system.
• In the 1970s, Batch processing was very
popular. In this technique, similar types of
jobs were batched together and executed in
time. People were used to having a single
computer which was called a mainframe.

• The system put all of the jobs in a queue on


the basis of first come first serve and then
executes the jobs one by one. The users
Batch Operating System collect their respective output when all the
jobs get executed.
Advantages of Batch OS
• The use of a resident monitor improves computer efficiency as it eliminates CPU time

between two jobs.

Disadvantages of Batch OS
1. Starvation : Batch processing suffers from starvation.

2. Not Interactive : Batch Processing is not suitable for jobs that are dependent on the user's input.
If a job requires the input of two numbers from the console, then it will never get it in the batch
processing scenario since the user is not present at the time of execution.
• Multiprogramming is an extension to batch
processing where the CPU is always kept
busy. Each process needs two types of
system time: CPU time and IO time.

• In a multiprogramming environment, when


a process does its I/O, The CPU can start the
execution of other processes. Therefore,
multiprogramming improves the efficiency
of the system.

Multiprogramming Operating System


Advantages of Multiprogramming OS
• Throughout the system, it increased as the CPU always had one program to execute.
• Response time can also be reduced.

Disadvantages of Multiprogramming OS
• Multiprogramming systems provide an environment in which various systems resources are
used efficiently, but they do not provide any user interaction with the computer system.
In Multiprocessing, Parallel computing is
achieved. There are more than one processors
present in the system which can execute more
than one process at the same time. This will
increase the throughput of the system.

• Types of multiprocessing system are


• Symmetrical multiprocessing operating
system
• Asymmetrical multiprocessing operating
system

Multiprocessing Operating System


Advantages of Multiprocessing OS

• Increased reliability: Due to the multiprocessing system, processing tasks can be distributed
among several processors. This increases reliability as if one processor fails, the task can be
given to another processor for completion.

• Increased throughout: As several processors increase, more work can be done in less.

Disadvantages of Multiprocessing OS

• Multiprocessing operating system is more complex and sophisticated as it takes care of multiple
CPUs simultaneously.
The multitasking operating system is a logical
extension of a multiprogramming system that
enables multiple programs simultaneously. It
allows a user to perform more than one computer
task at the same time.

Types of multitasking system are


• Pre-emptive Multitasking operating system

• Cooperative Multitasking operating system

Multitasking Operating System


Advantages of Multitasking OS

• This operating system is more suited to supporting multiple users simultaneously.

• The multitasking operating systems have well-defined memory management.

Disadvantages of Multitasking OS

• The multiple processors are busier at the same time to complete any task in a
multitasking environment, so the CPU generates more heat.
An Operating system, which includes
software and associated protocols to
communicate with other computers via a
network conveniently and cost-effectively, is
called Network Operating System.

Types of Network operating system are


• Peer to Peer System
• Client Server System

Network Operating System


Advantages of Network OS

• In this type of operating system, network traffic reduces due to the division between clients and

the server.

• This type of system is less expensive to set up and maintain.

Disadvantages of Network OS

• In this type of operating system, the failure of any node in a system affects the whole system.

• Security and performance are important issues. So trained network administrators are required for
network administration.
In Real-Time Systems, each job carries a certain deadline
within which the job is supposed to be completed,
otherwise, the huge loss will be there, or even if the result is
produced, it will be completely useless. The Application of
a Real-Time system exists in the case of military
applications, if you want to drop a missile, then the missile
is supposed to be dropped with a certain precision.

Types of Real Time operating system are


• Hard Real Time operating system

• Soft Real Time operating system

• Firm Real Time operating system

Real Time Operating System


Advantages of RTOS
• Reduced downtime
• Task Administration
• Availability
• Dependability

Disadvantages of RTOS
• Multitasking
• Driver request
• Program crashes
• Task focus
Time Sharing Operating System
In the Time Sharing operating system, computer resources are
allocated in a time-dependent fashion to several programs
simultaneously. Thus it helps to provide a large number of user's
direct access to the main computer. It is a logical extension of
multiprogramming. In time-sharing, the CPU is switched among
multiple programs given by different users on a scheduled basis.

A time-sharing operating system allows many users to be served


simultaneously, so sophisticated CPU scheduling schemes and
Input/output management are required.
Advantages of Time Sharing OS
• The time-sharing operating system provides effective utilization and sharing of resources.

• This system reduces CPU idle and response time.

Disadvantages of Time Sharing OS


• Data transmission rates are very high in comparison to other methods.

• Security and integrity of user programs loaded in memory and data need to be maintained as
many users access the system at the same time.
The Distributed Operating system is not installed on a single machine, it is divided into parts, and these parts are
loaded on different machines. A part of the distributed Operating system is installed on each machine to make
their communication possible. Distributed Operating systems are much more complex, large, and sophisticated
than Network operating systems because they also have to take care of varying networking protocols.

Distributed Operating System


Advantages of Distributed OS
• The distributed operating system provides sharing of resources.

• This type of system is fault-tolerant.

Disadvantages of Distributed OS
• Protocol overhead can dominate computation cost.
What is a System Call
A computer operates in two modes: User mode and Kernel mode. The execution of a
program is in the user mode. When the program requires RAM or a hardware resource,
it sends a request to the kernel and the mode changes from user mode to kernel mode.
System calls refer to these requests. After completing the task, the mode changes back
to the user mode. Likewise, the mode changes continuously. This transition is also
called context switching.
System Calls
 A system call is a method for a computer program to request a service from the kernel of the operating
system on which it is running.

 A system call is a method of interacting with the operating system via programs.

 A system call is a request from computer software to an operating system's kernel.

 The Application Program Interface (API) connects the operating system's functions to user
programs.

 It acts as a link between the operating system and a process, allowing user-level programs to request
operating system services.

 The kernel system can only be accessed using system calls. System calls are required for any programs
that use resources.
What is an API
Different devices and applications share data between them. Some of them include online reservations
and booking systems. API (Application Programming Interface) helps to establish connectivity among
devices and applications. Moreover, it is an interface that takes the requests from the user and informs
the system about what should be done and return the response back to the user.
System Program

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 these categories:

 File modification. Several text editors may be available to create and modify the content of files
stored on disk or other storage devices.

 Programming-language support. Compilers, assemblers, debuggers, and interpreters for common


programming languages (such as C, C++, Java, and PERL).

 Program loading and execution. Once a program is assembled or compiled, it must be loaded
(loaders) into memory to be executed. Debugging systems for either higher-level languages or
machine language are needed as well.
System Program

Communications. These programs provide the mechanism for creating virtual connections among
processes, users, and computer systems. They allow users to send messages to one another’s screens, to
browse Web pages, to send e-mail messages, to log in remotely, or to transfer files from one machine to
another.

Background services. All general-purpose systems have methods for launching certain system-program
processes at boot time. Some of these processes terminate after completing their tasks, while others
continue to run until the system is halted. Constantly running system-program processes are known as
services, subsystems, or daemons. Example, the network daemon process schedulers, system error
monitoring services, print servers, etc.
Difference Between API and System Call
Definition

An API is a set of protocols, routines, functions that programmers use to develop software to facilitate
interaction between distinct systems. In contrast, a system call is a programmatic way in which a
computer program requests a service from the kernel of the operating system it is executing on. Thus,
these definitions contain the main difference between API and system call.

Usage

Another difference between API and system call is their usage. An API helps to exchange data between
various systems, devices and applications while a system call allows a program to access services from
the kernel of the operating system
Types of System Calls
Process Control

Process control is the system call that is used to direct the processes. Some process control examples include

creating, load, abort, end, execute, process, terminate the process, etc.

File Management
File management is a system call that is used to handle the files. Some file management examples include creating
files, delete files, open, close, read, write, etc.

Device Management

Device management is a system call that is used to deal with devices. Some examples of device

management include read, device, write, get device attributes, release device, etc.
Types of System Calls
Information Maintenance
Information maintenance is a system call that is used to maintain information. There are some examples of
information maintenance, including getting system data, set time or date, get time or date, set system data, etc.

Communication
Communication is a system call that is used for communication. There are some examples of communication,
including create, delete communication connections, send, receive messages, etc.
Examples of
Windows
and Unix
System Calls
Kernel in
Operating System

Kernel is a computer program


that is a core or heart of an
operating system.
Kernel

• Kernel is the core part of an OS(Operating system); hence it has full control over

everything in the system. Each operation of hardware and software is managed and

administrated by the kernel.

• It acts as a bridge between applications and data processing done at the hardware level.

It is the central component of an OS.

• It is the part of the OS that always resides in computer memory and enables the

communication between software and hardware components.


Kernel

• It is the computer program that first loaded on start-up the system (After the

bootloader). Once it is loaded, it manages the remaining start-ups.

• kernel is kept and usually loaded into separate memory space, known as protected

Kernel space. It is protected from being accessed by application programs or less

important parts of OS.

• Other application programs such as browser, word processor, audio & video player use

separate memory space known as user-space.


Functions of Kernel
 Device Management
A kernel of an OS is responsible for
 Memory Management
performing various functions and has
 Resource Management
control over the system. Some main
responsibilities of Kernel are given  Disk Management
There are mainly five types of Kernel,
Types of Kernel which are as shown above
Monolithic
Kernel

• In a monolithic kernel, the same memory space is used to


implement user services and kernel services.

• As it uses the same memory space, the size of the kernel


increases, increasing the overall size of the OS.

• The execution of processes is also faster than other kernel types


as it does not use separate user and kernel space.

• Examples of Monolithic Kernels are Unix, Linux, Open VMS,


XTS-400, etc.
Monolithic Kernel
Advantages:
• The execution of processes is also faster as there is no separate user space and kernel space and less software
involved.

• As it is a single piece of software hence, it's both sources and compiled forms are smaller.

Disadvantages:
• If any service generates any error, it may crash down the whole system.

• These kernels are not portable, which means for each new architecture, they must be rewritten.

• Large in size and hence become difficult to manage.


MicroKernel
(μk)
In this architecture, only the most important services are inside
the kernel and the rest of the OS services are present inside the
system application program. The microkernel is solely
responsible for the most important services of the operating
system they are named as follows:

• Inter process-Communication

• Memory Management

• CPU-Scheduling
Microkernel
Advantages:
• The architecture of this kernel is small and isolated hence it can function better.

• Expansion of the system is easier; it is simply added to the system application without disturbing the kernel.

Disadvantages:
• There is more requirement of software for interfacing, which reduces the system performance.

• Process management is very complicated.

• The messaging bugs are difficult to fix


Hybrid Kernel
• A hybrid kernel can be understood as the extended version of
a microkernel with additional properties of a monolithic
kernel. These kernels are widely used in commercial OS, such
as different versions of MS Windows.

• It is much like a microkernel, but it also includes some


additional code in kernel space to enhance the performance of
the system.

• Examples of Hybrid Kernel are Windows NT, Netware,


Hybrid Kernel

Advantages:
• There is no requirement for a reboot for testing.

• Third-party technology can be integrated rapidly.

Disadvantages:
• There is a possibility of more bugs with more interfaces to pass through.

• It can be a confusing task to maintain the modules for some administrators, especially when dealing with
issues such as symbol differences.
Advantages

Nano Kernel It provides hardware abstractions even with a very small


size.
Disadvantages
As the name suggests, in Nanokernel, the Nanokernel lacks system services.
complete code of the kernel is very small,
which means the code executing in the
privileged mode of the hardware is very
small. Here the term nano defines a kernel that
supports a nanosecond clock resolution.

Examples of Nanokernel are EROS etc.


Advantages

ExoKernel he exokernel-based system can incorporate multiple library


operating systems. Each library exports a different API,
such as one can be used for high-level UI development,
• Exokernel is still developing and is the and the other can be used for real-time control.
experimental approach for designing OS.
Disadvantages
• This type of kernel is different from other
The design of the exokernel is very complex
kernels as in this; resource protection is kept
separated from management, which allows
us to perform application-specific
customization
Operating System Structure

 A system as large and complex as a modern operating system must be engineered carefully if it is
to function properly and be modified easily.
 A common approach is to partition the task into small components, or modules, rather than have
one monolithic system.
 Each of these modules should be a well-defined portion of the system, with carefully defined
inputs, outputs, and functions.
Simple Structure
 Many operating systems do not have well-defined
structures. Frequently, such systems started as small, simple,
and limited systems and then grew beyond their original
scope.

 MS-DOS is an example of such a system. It was written to


provide the most functionality in the least space, so it was
not carefully divided into modules
Unix System Structure
UNIX initially was limited by hardware functionality. It consists of two separable parts: the kernel and the
system programs.
The kernel is further separated into a series of interfaces and device drivers, which have been added and
expanded over the years as UNIX has evolved.
Layered Structure
 The operating system can be implemented with the help of various structures. The structure of the OS
depends mainly on how the various common components of the operating system are interconnected
and melded into the kernel.

 The layered structure approach breaks up the operating system into different layers and retains much
more control on the system.

 The bottom layer (layer 0) is the hardware, and the topmost layer (layer N) is the user interface.

 These layers are so designed that each layer uses the functions of the lower-level layers only.

 It simplifies the debugging process as if lower-level layers are debugged, and an error occurs during
debugging.
Why use Layered
Structure?
• All the layers can be defined
separately and interact with each
other as required.
• Also, it is easier to create, maintain
and update the system if it is done in
the form of layers.
• Change in one layer specification
does not affect the rest of the layers.
• Each of the layers in the operating
system can only interact with the
above and below layers.
• The lowest layer handles the
hardware, and the uppermost layer
deals with the user applications.
6 layers in Layered Structure
Advantages of Layered Structure

1.Modularity: This design promotes modularity as each layer performs only the tasks it is scheduled to
perform.
2.Easy debugging: As the layers are discrete so it is very easy to debug.
3.Easy update: A modification made in a particular layer will not affect the other layers.
4.No direct access to hardware: The hardware layer is the innermost layer present in the design. So a user
can use the services of hardware but cannot directly modify or access it.
5.Abstraction: Every layer is concerned with its functions. So the functions and implementations of the
other layers are abstract to it.
Disadvantages of Layered Structure

1.Complex and careful implementation: As a layer can access the services of the layers below it, so the
arrangement of the layers must be done carefully. For example, the backing storage layer uses the services of the
memory management layer. So it must be kept below the memory management layer.
2.Slower in execution: If a layer wants to interact with another layer, it requests to travel through all the layers
present between the two interacting layers. Thus it increases response time, unlike the Monolithic system, which
is faster than this. Thus an increase in the number of layers may lead to a very inefficient design.
3.Functionality: It is not always possible to divide the functionalities. Many times, they are interrelated and can't
be separated.
4.Communication: No communication between non-adjacent layers.
Booting in
Operating System

Booting is the process which is initiated once the


computer system starts and executes small set of
instructions present in the ROM which will setup
system hardware by testing them and load the
operating system so that computer system can carry
out further tasks.
“The small set of instructions present in the ROM is called
BIOS which stands for Basic Input Output System”
Boot- Sequence in OS

When computer is powered on, all the


hardware components receive the
power and they get initialized. After
that, the computer system goes through
6 step booting process as shown
Boot- Sequence in OS

1.Loading of BIOS: The small set on instructions present in the ROM is loaded into the computer
memory and CPU executes those instruction.

2.Power-On Self Test (POST): In order to check the operability of all the hardware connected to our
computer system, BIOS carries out POST which will check the hardware components and if any problem
is found user is alerted with POST beeps and POST screen messaged.
Boot- Sequence in OS

3. Loading of Operating System:


1. After the successful completion of POST, the bootable sequence present in CMOS (Common
Metal Oxide Semiconductor) is read by BIOS.
2. Based on the bootable sequence it will search for Master Boot Record (MBR) in bootable device
like floppy disk, CD-ROM and hard disk.
3. If MBR is not found in any of them, the system will halt by displaying “No Boot Device Found”.
4. if MBR is found, the BIOS will load the special application program called Boot Loader, that will
eventually load the Operating system.
Boot- Sequence in OS

4. System Configuration is Accomplished: After the OS is loaded, device drivers are loaded into the
memory so that our devices can function correctly.
5. System Utilities are Loaded: System utilities like antivirus, volume control etc. are loaded into the
memory in this step
6. User Authentication: If any user authentication is being set, the system will ask the user to enter the
credentials and on receiving the correct credentials the computer system will run GUI shell (in most
cases) or CLI shell.
Type of Booting

There are two types of Booting:


1.Cold Booting/ Hard Booting: Cold booting is the process when our computer system moves from shut
down state to the start by pressing the power button. The system reads the BIOS from ROM and will
eventually load the Operating System.

2.Warm Booting/ Soft Booting: Warm booting is the process in which the computer gets restart due to
reasons like setting the configuration for newly installed software or hardware. Warm booting is called
as rebooting.
Dual Booting

When we have two different operating system on our computer it is called Dual Booting. But now as we
have multiple OS present, bootloader need to load the Operating System which user selects from the
menu that is being displayed on the monitor. If no action is performed withing few seconds, the default
Operating System is loaded.

We can have multiple Operating System on single bootable device by Creating Partitions.

By creating partition on the bootable device like hard disk, each partition can have its own Operating
System and during run time on selection of the Operating System from user, that particular Operating
System is loaded into the memory of the computer system.
Interrupt

 Interrupts are the events that take place to inform the operating system to stop the execution of the
current process and handle the Interrupt Service Routine (ISR).
 ISR is responsible to find out which software or hardware caused the interrupt and informing
the CPU about it.
 CPU will service the request and after the completion of the request, CPU resumes the execution of
the process which CPU was previously executing.
 Interrupts can be caused by hardware as well as software.
Types of Interrupt
Hardware Interrupt

When an external device wants the attention of the operating system to service a certain request, they
raise an interrupt which is called hardware interrupts. All the external devices are connected to a
single Interrupt Request Line and the Interrupt Request Line is used for the interrupts.

The hardware interrupts are further categorized into two types:


1.Maskable Interrupts: Hardware interrupts that can be ignored or disabled are called maskable
interrupts.
2.Non-Maskable interrupts: Hardware interrupts that can’t be ignored or disabled are called non-
maskable interrupts.
Hardware Interrupt
Software
Interrupt
Software interrupts generally take place
when there are exceptions in the process or by
using special instructions that cause the
interrupts. While having the system calls in our
system, we generally have the software interrupt.
Division by zero throws an exception which
caused the software interrupt, whereas while we
use fork() system call, fork() also invokes a
software interrupt.
Interrupt Handling by CPU
Context Switching is the process where the state of the current process is saved and stored, while another process is
brought for execution. Once the execution of the new process completes, the CPU restores the state of the old process and
continues the execution from where the execution of the process was left.
So following steps are involved while handling the interrupts:
1.The First step involved in handling the interrupt is to check the priority of the interrupt.
2.If the priority is low compared to the current process under execution, then interrupt is saved in the memory.
3.If the priority is high compared to the current process under execution, CPU saves the context of the current process.
4.CPU loads the new process which invoked the interrupt and executes that.
5.On completion of the requested service, CPU loads the process which was under execution prior to the interrupt and
resumes the execution from where the execution was interrupted.

You might also like