OPERATING SYSTEM
II YEAR
IV Semester
Lecture I
Pallavi Shukla
Assistant Professor
Chapter 1: Introduction
■ What is an Operating System?
■ Mainframe Systems
■ Desktop Systems
■ Multiprocessor Systems
■ Distributed Systems
■ Clustered System
■ Real -Time Systems
■ Handheld Systems
■ Computing Environments
What is an Operating System?
■ A program that acts as an intermediary between a
user of a computer and the computer hardware.
■ Operating system goals:
• ✦ Execute user programs and make solving user
problems easier.
• ✦ Make the computer system convenient to use.
■ Use the computer hardware in an efficient manner.
■ It also acts as a resource manager.
■ It provides platform for other application programs.
Computer System
Components
1. Hardware – provides basic computing resources (CPU,
memory, I/O devices).
2. Operating system – controls and coordinates the use of
the hardware among the various application programs for
the various users.
3. Applications programs – define the ways in which the
system resources are used to solve the computing
problems of the users (compilers, database systems,
video games, business programs).
4. Users (people, machines, other computers).
Abstract View of System
Components
Operating Systems Role
• User’s View
• System View
User’s View
• Depends on the point of view
• Users want convenience, ease of use, and good performance
• Don’t care about resource utilization.
• But shared computers such as mainframe or minicomputer
must keep all users happy.
• Users of dedicated systems such as workstations have
dedicated resources but frequently use shared resources
from servers.
• Handheld computers are resource-poor, optimized for
usability and battery life.
• Some computers have little or no user interface, such as
embedded computers in devices and automobiles.
System View
• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for
efficient and fair resource use.
• OS is a control program
• Controls execution of programs to prevent
errors and improper use of the computer
Definition of OS
• No universally accepted definition
• “Everything a vendor ships when you order an
operating system” is a good approximation
• But varies wildly
• “The one program running at all times on the
computer” is the kernel.
• Everything else is either
• a system program (ships with the operating
system) , or
• an application program.
Computer Startup
• bootstrap program is loaded at power-up
or reboot
• Typically stored in ROM or EPROM,
generally known as firmware
• Initializes all aspects of system
• Loads operating system kernel and starts
execution
Computer System Organization
• Computer-system operation
• One or more CPUs, device controllers connect
through common bus providing access to shared
memory
• Concurrent execution of CPUs and devices
competing for memory cycles
Computer-System Operation
• I/O devices and the CPU can execute concurrently
• Each device controller is in charge of a particular
device type
• Each device controller has a local buffer
• CPU moves data from/to main memory to/from
local buffers
• I/O is from the device to local buffer of controller
• Device controller informs CPU that it has finished its
operation by causing an interrupt
Storage Definitions and Notation
Review
• The basic unit of computer storage is the bit. A bit
can contain one of two values, 0 and 1.
• A byte is 8 bits,
• A kilobyte, or KB, is 1,024 bytes
• a megabyte, or MB, is 1,0242 bytes
• a gigabyte, or GB, is 1,0243 bytes
• a terabyte, or TB, is 1,0244 bytes
• a petabyte, or PB, is 1,0245 bytes
Storage Structure
• Main memory – only large storage media that the CPU can
access directly
• Random access
• Typically volatile
• Secondary storage – extension of main memory that
provides large nonvolatile storage capacity
• Magnetic disks – rigid metal or glass platters covered with
magnetic recording material
• Disk surface is logically divided into tracks, which are subdivided
into sectors
• The disk controller determines the logical interaction between
the device and the computer
Storage-Device Hierarchy
Computer-System Architecture
• Most systems use a single general-purpose processor
• Most systems have special-purpose processors as well
• Multiprocessors systems growing in use and importance
• Also known as parallel systems, tightly-coupled systems
• Advantages include:
1. Increased throughput
2. Economy of scale
3. Increased reliability – graceful degradation or fault tolerance
• Two types:
1. Asymmetric Multiprocessing (Boss worker relationship)
2. Symmetric Multiprocessing (Peer relationship) eg, AIX
Clustered Systems
• Like multiprocessor systems, but multiple
systems working together
• Usually sharing storage via a storage-area
network (SAN)
• Provides a high-availability service which
survives failures
• Asymmetric clustering has one machine in hot-
standby mode (Monitors the active server).
• Symmetric clustering has multiple nodes running
applications, monitoring each other.
• Some clusters are for high-performance
computing (HPC)
• Application which divides a program into separate
components that run in parallel on individual
computers in the clusters must be written to use
parallelization.
Operating System Structure
• Multiprogramming needed for efficiency
• Single user cannot keep CPU and I/O devices busy at
all times
• Multiprogramming organizes jobs (code and data) so
CPU always has one to execute
• A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When it has to wait (for I/O for example), OS
switches to another job
Operating System Structure
• Timesharing (multitasking) is a logical extension
in which the CPU switches jobs so frequently that users can interact
interactive
with each job while it is running, creating
computing
• Response time should be < 1 second
• Each user has at least one program executing in the memory
process
• If several jobs ready to run at the same time CPU
scheduling
• If processes don’t fit in memory, swapping moves them in
and out to run
• Virtual memory allows the execution of processes not
completely in memory
Operating System Goals
■ Primary Goal: The primary goal of an Operating
System is to provide a user-friendly and
convenient environment.
■ Secondary Goal: The secondary goal of an
Operating System is efficiency.
FUNCTIONS OF
OPERATING SYSTEM
■ Process Management
■ Memory Management
■ I/O Device Management
■ File Management
■ Virtual Memory
■ Security and Protection
PROCESS MANAGEMENT
• A process is a program in execution. It is a unit of work within
the system. Program is a passive entity, process is an active entity.
• Process needs resources to accomplish its task
• CPU, memory, I/O, files
• Initialization data
• Process termination requires reclaim of any reusable resources
• Single-threaded process has one program counter specifying
location of next instruction to execute
• Process executes instructions sequentially, one at a time, until
completion
• Multi-threaded process has one program counter per thread
• Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
• Concurrency by multiplexing the CPUs among the processes /
threads
Process Management Activities
• The operating system is responsible for the
following activities in connection with process
management:
• Scheduling Processes and threads on the CPU’s
• Creating and deleting both user and system processes
• Suspending and resuming processes
• Providing mechanisms for process synchronization
• Providing mechanisms for process communication
• Providing mechanisms for deadlock handling
Memory Management
• All data in memory before and after processing
• All instructions in memory in order to execute
• Memory management determines what is in
memory when
• Optimizing CPU utilization and computer response to
users
• Memory management activities
• Keeping track of which parts of memory are currently
being used and by whom
• Deciding which processes (or parts thereof) and data
to move into and out of memory
• Allocating and deallocating memory space as needed
Storage Management
• OS provides uniform, logical view of information
storage.
• Abstracts physical properties to logical storage unit - file
• Each medium is controlled by device (i.e., disk drive, tape drive)
• Varying properties include access speed, capacity, data-transfer rate,
access method (sequential or random)
• File-System management
• Files are usually organized into directories
• Access control on most systems to determine who can access
what
• OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and disks
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 2 & 3
Pallavi Shukla
Assistant Professor
System Calls
■System calls provide the interface
between a running program(process) and
the operating system.
• Generally available as assembly-language
instructions.
• Languages defined to replace assembly
language for systems programming allow
system calls to be made directly (e.g., C, C++)
System Calls
■ It is a programmatic method in which a computer
program requests a service from the kernel of the
OS.
■ System call offers the services of the operating
system to the user programs via API (Application
Programming Interface).
■ System calls are the only entry points for the kernel
system.
■ Kernel is the core component of the Operating
System that has complete control of the hardware
Working of System Call
• In computer system process execute under two (2)
modes
• 1. User Mode: In this mode, execution is done on
behalf of the user.
• 2. Monitor/Kernel-Mode: In this mode, execution is
done on behalf of OS.
• So when the process is under execution process
executes under user mode, but when the process
requires some OS resources to complete the task, the
process makes a system call.
• 2. System calls in OS are executed in kernel mode on
a priority basis.
• 3. On completion of the system call, the control is
passed to process in user mode.
• 4. The process continues the execution in user mode.
Need of System Call
Following are situations that need system calls in OS-
• Reading and writing from files demand system calls.
• If a file system wants to create or delete files, system
calls are required.
• System calls are used for the creation and management
of new processes.
• Network connections need system calls for sending and
receiving packets.
• Access to hardware devices like scanners, printers,
needs a system call.
System Calls
Three general methods are used to pass
parameters between a running program and
the operating system.
• Pass parameters in registers.
• Store the parameters in a table in memory, and the
table address is passed as a parameter in a register.
• Push (store) the parameters onto the stack by the
program, and pop off the stack by the operating
system.
Passing of Parameters As A
Table
Types of System Calls
Process Control
• It handles the system calls for process creation, deletion,
etc.
• Examples for process control system calls are:
• Load, Execute
• End, Abort,
• Create Process, Terminate process
• Get process attributes, set process attributes
• Wait, Signal events for process
• Allocate and free memory
File Management
• File manipulation events like
• Creating, Deleting
• Reading Writing
• Opening, Closing
• Getting file attributes
• Setting file attributes
Device Management
• Device Management system calls are
being used
• to request device,
• release the device,
• logically attach and detach the device
• Read, write, reposition
• Get device attributes, set device attributes.
Information Maintenance
• This type of system call is used to
maintain the information
• Get time or date, set time or date.
• Get system data, set system data.
• Get process, file or device attributes
• Set process, file or device attributes.
Communications
• In order to have interprocess communications
like
• send or receive the message,
• create or delete the communication
connections,
• to transfer status information
• Attach or detach remote devices.
Examples of Windows and Unix
system calls
Operating System
Services
An Operating System provides services to both
the users and to the programs.
• It provides programs an environment to
execute.
• It provides users the services to execute the
programs in a convenient manner.
Operating System Services
Following are a few common services provided by an
operating system −
■ Program execution
■ I/O operations
■ File System manipulation
■ Communication
■ Error Detection
■ Resource Allocation
■ Protection
Program execution
• Operating systems handle many kinds of activities from user
programs to system programs like printer spooler, name
servers, file server, etc
• Each of these activities is encapsulated as a process. A
process includes the complete execution context (code to
execute, data to manipulate, registers, OS resources in use).
• Loads a program into memory.
• Executes the program.
• Handles program execution.
• Provides a mechanism for process synchronization.
• Provides a mechanism for process communication.
• Provides a mechanism for deadlock handling
I/O Operation
• An I/O subsystem comprises of I/O devices and
their corresponding driver software. Drivers hide the
peculiarities of specific hardware devices from the
users.
• An Operating System manages the communication
between user and device drivers
• I/O operation means read or write operation with any
file or any specific I/O device.
• Operating system provides the access to the required
I/O device when required.
File system manipulation
• A file system is normally organized into directories for
easy navigation and usage. These directories may contain
files and other directions. F
• Program needs to read a file or write a file.
• permission to the program for operation on file.
• OS provides permission varies from read-only, read-write,
denied and so on.
• OS provides an interface to the user to create/delete files.
• OS provides an interface to the user to create/delete
directories.
• OS provides an interface to create the backup of file
system.
Communication
• Distributed systems which are a collection of processors that do not
share memory, peripheral devices, or a clock, the operating system
manages communications between all the processes.
• Multiple processes communicate with one another through
communication lines in the network.
• The OS handles routing and connection strategies, and the problems
of contention and security.
• Two processes often require data to be transferred between them
• Both the processes can be on one computer or on different computers,
but are connected through a computer network.
• Communication may be implemented by two methods, either by
Shared Memory or by Message Passing.
Error handling
• Errors can occur anytime and anywhere. An error
may occur in CPU, in I/O devices or in the memory
hardware.
• The OS constantly checks for possible errors.
• The OS takes an appropriate action to ensure correct
and consistent computing
Resource Management
• In case of multi-user or multi-tasking environment,
resources such as main memory, CPU cycles and files
storage are to be allocated to each user or job.
Following are the major activities of an operating
system with respect to resource management
• The OS manages all kinds of resources using
schedulers.
• CPU scheduling algorithms are used for better
utilization of CPU.
Protection
• Considering a computer system having multiple users and
concurrent execution of multiple processes, the various
processes must be protected from each other's activities.
• Protection refers to a mechanism or a way to control the access
of programs, processes, or users to the resources defined by a
computer system.
• The OS ensures that all access to system resources is controlled.
• The OS ensures that external I/O devices are protected from
invalid access attempts.
• The OS provides authentication features for each user by means
of passwords.
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 4
Pallavi Shukla
Assistant Professor
Operating System Structure
• The Operating System provides the medium for the user to
communicate with the computer hardware.
• System software is installed on top of the operating
system.
• Operating System structure is the basic model that is
needed to implement Operating Systems.
• There are many types of structures, each having its own
properties.
Simple Structure
• It is the most straightforward operating system structure,
but it lacks definition and is only appropriate for usage
with tiny and restricted systems.
• Since the interfaces and degrees of functionality in this
structure are clearly defined, programs are able to access
I/O routines, which may result in unauthorized access to
I/O procedures.
• This organizational structure is used by the MS-DOS
operating system.
• There are four layers that make up the MS-DOS operating
system, and each has its own set of features.
• These layers include
1. ROM BIOS device drivers
2. MS-DOS device drivers
3. System programs
4. Application programs.
• The MS-DOS operating system benefits from layering
because each level can be defined independently and, when
necessary, can interact with one another.
Advantages
• It is easy to develop because of the limited number
of interfaces and layers.
• Offers good performance due to lesser layers
between hardware and applications.
Disadvantages
• If one user program fails, the entire operating system
crashes.
• Abstraction or data hiding is not present as layers are
connected and communicate with each other.
• Layers can access the processes going in the
Operating System, which can lead to data
modification and can cause the Operating System to
crash.
UNIX
• UNIX is another system limited by hardware
functionality.
• It consists of two separable parts
• 1. System programs
• 2. Kernel
• The kernel is further separated into a series of interfaces
and device drivers.
• Everything below the system call interface and above the
physical hardware is the kernel.
• The kernel provides the file system, CPU scheduling,
memory-management, and other operating-system
functions through system-calls.
• Taken in sum, that is an enormous amount of
functionality to be combined into one level New versions
of UNIX are designed to use more advanced hardware.
• With proper hardware support, operating systems can be
broken into pieces that are smaller and more appropriate
than those allowed by the original MS-DOS or UNIX
systems
Monolithic Structure
• The Monolithic operating System in which the
kernel acts as a manager by managing all things
like file management, memory management,
device management, and operational processes of
the Operating System.
• The kernel is the heart of a computer operating
system (OS). Kernel delivers basic services to all
other elements of the System.
Monolithic Structure
• It serves as the primary interface between the
Operating System and the hardware.
• In monolithic systems, kernels can directly
access all the resources of the Operating System
like physical hardware, exp Keyboard, Mouse
etc.
• Batch processing and time-sharing maximize the
usability of a processor by multiprogramming.
Monolithic Structure
• The monolithic kernel functions as a
virtual machine by working on top of
the Operating System and controlling all
hardware components.
• This is an outdated operating system
that was used in banks to accomplish
minor activities such as batch
processing and time-sharing.
Advantages
• It is simple to design and implement because all
operations are managed by kernel only.
• As services such as memory management, file
management, process scheduling, etc., are
implemented in the same address space, the
execution of the monolithic kernel is relatively fast as
compared to Simple systems.
• Using the same address saves time for address
allocation for new processes and makes it faster
Disadvantages
• If any service in the monolithic kernel fails, the
entire System fails because, in address space, the
services are connected to each other and affect
each other.
• Modifications to any services also affect other
services.
• It is not flexible, and to introduce a new service.
Layered Structure
• In this type of structure, OS is divided into layers or
levels.
• The hardware is on the bottom layer (layer 0), while
the user interface is on the top layer (layer N).
• These layers are arranged in a hierarchical way in
which the top-level layers use the functionalities of
their lower-level levels.
• In this approach, functionalities of each layer are
isolated, and abstraction is also available.
Layered Structure
• In layered structure, debugging is easier as it is a
hierarchical model, so all lower-level layered is
debugged, and then the upper layer is checked.
• So all the lower layers are already checked, and the
current layer is to be checked only.
• Layer-1: Hardware - It is the lowest layer in the operating
system architecture.
• The layer handles the hardware devices, where all the
hardware devices are installed.
• Layer-2: CPU Layer - All the tasks and CPU processes are
scheduled in this layer.
• Layer-3: Memory Management - The layer handles
memory. It moves processes from the disk (secondary
storage) to primary memory for execution and returns
executed processes to the disk.
• The layer helps to utilize memory efficiently.
• Layer-4: Process Management - The layer assigns
the CPU to execute processes.
• Layer-5: Input-Output Buffer - The layer provides
an I/O device buffer and ensures that all the input-
output devices work in synchronization.
• It allows the user to interact with the system.
• Layer-6: User Programs - It is the highest layer in a
layered operating system, and it is associated with the
user programs like word processors, browsers, etc.
Advantages
• Modularity-The layered architecture is modular; therefore,
Changes made to one layer do not affect the other layers.
• Abstraction-The functions and implementations of each
layer are abstract to each other. One layer is not concerned
with the working of other layers.
• Easy Update-The modular system is easier to update.
Only the layered which needs the update is worked on, and
related code is modified. This doesn’t affect other layer.
• Easy Debugging-The discrete layers are quite easy to
debug when any error occurs
Disadvantages
• Slower in Execution-Layered OS is slow compared
to monolithic OS. When a request is sent from one
layer to another, it must traverse all the layers
between the two, which increases the response time.
• Complex Implementation-The layered architecture
is complex.
• Performance Degradation-In layered OS, too many
layers are present which degrades the performance of
the system
Micro Kernel Structure
• Micro-Kernel structure designs the Operating System by
removing all non-essential components of the kernel.
• These non-essential components of kernels are
implemented as systems and user programs.
• These implemented systems are called as Micro-Kernels.
• Each Micro-Kernel is made independently and is isolated
from other Micro-Kernels.
• This makes the system more secure and reliable. If any
Micro-Kernel fails, then the remaining operating System
remains untouched and works fine.
Advantages
• It enables portability of the operating system across
platforms.
• Due to the isolation of each Micro-Kernel, it is
reliable and secure.
• The sizes of Micro-Kernels get reduced.
Disadvantages
• The performance of the system is decreased by
increased inter-module communication.
• The construction of a system is complicated.
Dual Mode
Operation
Dual Mode Operation
• Ability of the system to switch between two different
modes of operation for computation processes and
to avoid system crashes.
• Guard it against illegal users. I/O protection,
memory protection, and CPU protection all rely on
dual-mode operation.
User Mode
• When the computer system runs user applications, such
as creating a text document or using an application
program, it is in user mode.
• Mode Bit 1
• When an application requests a service from the
operating system, or an interrupt or system call occurs,
the system switches from user to kernel mode to fulfil
the request.
Kernel Mode/
Supervised mode
• Certain processes operate in kernel mode while the
system is running because they require access to
operating system calls.
• This provides security by limiting which processes
have access to kernel mode operations.
• The system will allow certain user-mode processes to
execute system calls by allowing the process to
temporarily run in kernel mode.
Kernel Mode/
Supervised mode
• While in kernel mode, the process has direct
access to all hardware and memory in the
system.
• Some of the privileged instructions are as
follows:
• Handling system Interrupts
• The transition from user to kernel mode.
• I/O device management.
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 5
Pallavi Shukla
Assistant Professor
Operating System Types
Batch OS
• The users of a batch operating system do not interact
with the computer directly.
• Each user prepares his job on an off-line device like
punch cards and submits it to the computer operator.
• To speed up processing, jobs with similar needs are
batched together and run as a group.
• The programmers leave their programs with the
operator and the operator then sorts the programs
with similar requirements into batches.
CPU
Advantages of OS
• Multiple users can share the batch systems.
• A new job gets started as soon as the previous job is
finished without any manual intervention; this
increases the performance of the system.
Disadvantages of OS
• Lack of interaction between the user and the job.
• CPU is often idle, because the speed of the
mechanical I/O devices is slower than the CPU.
• Difficult to provide the desired priority.
Example- Payroll system, Bank Statement etc
Multiprogramming Operating
System
• To maximize CPU utilization.
• More than one process in main memory which are
ready to execute ie more than one process is in ready
state.
• In this system if any running process performs I/O
or other event which do not require
• CPU then instead of sitting idle CPU it makes a
context switch and pick another process for
execution.
• In this system if any running process performs I/O
or other event which do not require.
• CPU then instead of sitting idle CPU it makes a
context switch and pick another process for
execution.
Advantages
• High CPU utilization.
• Less waiting time, response time etc.
• Useful when load is high.
Disadvantages
• Process scheduling is difficult.
• Main memory management is required.
• Problems like memory fragmentation
may occur
• MS-Excel, Google chrome etc (Application)
Windows, Linux, Unix etc (operating system)
Multitasking/Time-sharing
operating system
• It is also called fair share system or multi
programming with round robin System.
• It is extension of multi Programming System.
• In this system CPU switches between processes so
quickly that it gives an illusion that all executing at
same time.
• This system can be used to handle multiple
interactive tasks
Advantages
• High CPU utilization
• Reduce waiting time of process
• Increase reliability
• Handle multiple user
Disadvantages
• Limitation of memory
• Limitation of processor
• Example Window 2000, IBM OS/390, Linux etc
Multiprocessor Operating
System
• A system is called multiprocessing system if two or
more CPU within a single computer Communicated
with each other and shares system bus memory and
I/O devices.
• It provides true parallel execution of processes
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 6
Pallavi Shukla
Assistant Professor
Real-Time Operating system
• Data processing system in which the time interval required to
process and respond to inputs is so small that it controls the
environment.
• Time taken by the system to respond to an input and display of
required updated information is termed as the response time.
• Must have well-defined, fixed time constraints, otherwise the
system will fail.
• For example, Scientific experiments, medical imaging systems,
industrial control systems, weapon systems, robots, air traffic
control systems, etc.
Hard real-time systems
• Guarantee that critical tasks complete on time ( time
bound).
• Secondary storage is limited or missing and the data
is stored in ROM.
• Virtual memory is almost never found.
Examples
• Scientific Experiments
Soft real-time systems
• Soft real-time systems are less restrictive.
• A critical real-time task gets priority over other tasks
and retains the priority until it completes.
• Soft real-time systems have limited utility than hard
real- time systems.
Examples
Firm Real Time OS
• RTOS of this type have to follow deadlines as
well.
• In spite of its small impact, missing a deadline
can have unintended consequences, including
a reduction in the quality of the product.
• Example: Multimedia applications.
Advantages
• Maximum use of devices and system
• Time given for shifting tasks is very less
• Size of programs are small
• Memory allocation is well managed
Disadvantages
• Only some task run at the same time
• Costly
• Complex and difficult to write algorithms are used
• It requires specific device drivers
• They are very less prone to switching tasks
Distributed Operating system
• Designed to operate on a network of computers.
• Used to distribute software applications and data.
• Used to manage the resources of multiple computers and
users could be at different sites.
• Multiple computers are connected via a single communication
channel.
• Every system has its own processor and memory.
• Resources like disk, computer, CPU, network interface, nodes,
etc are shared among different computer at different locations
Types of Distributed
OS
Client Server Systems Peer to Peer
Client-Server Systems
• It is a tightly coupled operating system.
• It is used for multiprocessors and
homogeneous multicomputer.
• Client-Server Systems works as a centralized
server because it provides the approval to
all requests, which are generated by the
client systems side.
Peer-to-Peer Systems
• It is a loosely coupled system.
• It is implemented in the computer network
application because it contains a bunch of
processors, and they are not shareable memories or
clocks as well.
• Every processor consists of its own local memory,
and these processors communicate with each other
through various communication media such as high-
speed buses or telephone lines
Advantages
• Resource sharing
• Reliability
• Portability
• Independent
• Less Data processing time
• Faster data exchange
Disadvantages
• The cost of setting up a distributed operating system
is high.
• The failure of the main system might affect the
complete system.
• Programming of a distributed operating system is
complex.
• It is difficult to implement adequate security in the
distributed operating system as every connection
between nodes must be secure.
Example
• Solaris, Micros, DYNIX, Mach
Network Operating System
• It is an operating system that connects multiple computers
and devices on a local area network to allow sharing of files
and resources by connection and communication over a
network.
• It is a crucial operating system that runs on a server and
manages the data, applications, groups, users, security, and
other functions of a network.
• Its fundamental purpose is to allow sharing of files and give
printers access to a local area network, a private network, or
other networks with multiple computers.
Functions of Network
Operating System
• It creates and manages the accounts of users on the
network.
• It controls access to resources in the network.
• It configures and manages the resources on the
network.
• It implements protocols over the network for better
implementation of network functionalities.
• It facilitates a secure connection between two
workstations by access control and user authentication.
Types of Network Operating
System
• Peer to Peer Network Operating System
• Client Server Network Operating System
Client Server Network
Operating System
• It has a server in its backend and a client in the frontend.
• It also has a server-based network where the storage and processing
workload gets shared among clients and servers.
• The central server provides access to resources to the users.
• Application of Client-Server Network Operating System involves a
database accessed by many computers on a network. The database gets
stored on the server.
• The clients send the database queries, which then get processed by the
server.
• The processed database queries are then sent back to the clients across
the network.
• A server can provide a large number of clients at once.
Client Server Network
Operating System
Advantages
• Network operating systems have central servers
that make them highly stable.
• They make the network secure using user
authentication and access control functionalities.
• The network can easily upgrade with newer
technologies and hardware.
• Servers can get remotely accessed from diverse
locations
Disadvantages
• The operations are performed depending on the
central location of the server.
• The cost of setting up a Network Operating
System is too expensive.
• It needs regular updating and maintenance to
work in good condition.
Example
• UNIX,
• Linux,
• Microsoft Windows Server 2008,
• Microsoft Windows Server 2003
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 7
Pallavi Shukla
Assistant Professor
VIRTUAL MACHINES
■ A virtual machine takes the layered approach to its
logical conclusion. It treats hardware and the operating
system kernel as though they were all hardware.
■ A virtual machine provides an interface identical to
the underlying bare hardware.
■ The operating system creates the illusion of multiple
processes, each executing on its own processor with
its own (virtual) memory.
Virtual Machines
■ The resources of the physical computer are
shared to create the virtual machines.
✦ CPU scheduling can create the appearance that users
have their own processor.
✦ Spooling and a file system can provide virtual card
readers and virtual line printers.
✦ A normal user time-sharing terminal serves as the
virtual machine operator’s console.
System Models
Non Virtual Machine Virtual Machine
Advantages/Disadvantages of
Virtual Machines
■ The virtual-machine concept provides complete protection of
system resources since each virtual machine is isolated from all
other virtual machines.
■ This isolation, however, permits no direct sharing of resources.
■ A virtual-machine system is a perfect vehicle for operating-
systems research and development. System development is done
on the virtual machine, instead of on a physical machine and so
does not disrupt normal system operation.
■ The virtual machine concept is difficult to implement due to the
effort required to provide an exact duplicate to the underlying
machine.
Java Virtual Machine
■ Compiled Java programs are platform-neutral
bytecodes executed by a Java Virtual Machine (JVM).
■ JVM consists of
- class loader
- class verifier
- runtime interpreter
■ Just-In-Time (JIT) compilers increase performance
Java Virtual Machine
Booting Process
• Booting is a start-up sequence that starts the
operating system of a computer when it is turned on.
• A boot sequence is the initial set of operations that
the computer performs when it is switched on.
• Every computer has a boot sequence.
Boot loader
• The program that starts the chain reaction that ends
with the entire operating system being loaded is the
boot loader or bootstrap loader.
• The boot loader's only job is to load other software
for the operating system to start
Boot device
The boot device is the device from which the operating
system is loaded.
A modern PC BIOS (Basic Input/Output System)
supports booting from various devices.
These include the local hard disk drive, optical drive,
floppy drive, a network interface card, and a USB
device.
Boot device
• The BIOS will allow the user to configure a boot
order.
• If the boot order is set to:
• CD Drive
• Hard Disk Drive
• Network
• USB device
Boot sequence
There is a standard boot sequence that all personal
computers use.
First, the CPU runs an instruction in memory for the
BIOS.
That instruction contains a jump instruction that
transfers to the BIOS start-up program.
This program runs a power-on self-test (POST) to
check that devices the computer will rely on are
functioning properly.
Boot sequence
Then, the BIOS goes through the configured boot
sequence until it finds a bootable device.
Once BIOS has found a bootable device, BIOS loads
the boot sector and transfers execution to the boot
sector.
If the boot device is a hard drive, it will be a master
boot record (MBR).
Steps of Booting
Steps of booting
• Step 1: BIOS is loaded
The first step involves turning on the power.
It powers the essential parts, including the processor and BIOS,
with electricity.
• Step 2: BIOS: Power on Self-Test
It is the first test run by the BIOS.
Additionally, this test runs a preliminary examination of the
computer's main memory, disk drives, input/output devices, etc. the
system emits a beep sound in case of any errors.
Steps of Booting
• Step 3: Loading of OS
• The bootable sequence stored in the CMOS (Common Metal
Oxide Semiconductor) is read by BIOS following the successful
completion of POST.
• Based on the bootable sequence, it will look for the Master Boot
Record (MBR) on bootable devices such as floppy disks, CD-
ROMs, and hard disks.
• A message saying "No Boot Device Found" will be displayed,
and the system will crash if MBR is not found in any of them.
• If MBR is discovered, the BIOS will launch a unique application
software called the Boot Loader, which will ultimately launch the
operating system.
Steps of Booting
• Step 4: System Configuration
Device drivers are put into the memory after the OS is
loaded to ensure the proper operation of our gadgets.
• Step 5: Loading System Utilities
In this step, system utilities like antivirus and volume
control are loaded into the memory.
• Step 6: User Authentication
The system will prompt the user to input their credentials
if any user authentication is configured. Once the system has
received valid credentials, it will typically launch the GUI shell
or the CLI shell.
Types of Booting
Warm Boot/Soft Boot
When computer systems reach a state of no response or hang,
they are allowed to restart during the on condition, which is
known as warm or hot booting.
This is also known as Soft booting or Reboot.
Example: When a new software is installed, the computer will
ask to reboot to work at its best.
Ctrl + Alt + Del button is used to perform warm boot
Dual Booting
• When two operating systems are installed on the computer system,
then it is called dual booting.
• Multiple operating systems can be installed on such a system.
• But to know which operating system is to boot, a boot loader that
understands multiple file systems and multiple operating systems can
occupy the boot space.
• Once loaded, it can boot one of the operating systems available on the
disk.
• The disk can have multiple partitions, each containing a different type
of operating system.
• When a computer system turns on, a boot manager program displays
a menu, allowing the user to choose the operating system to use.
SPOOLING
• Spooling is a process in which data is temporarily held to be used and
executed by a device, program, or system.
• Data is sent to and stored in memory or other volatile storage until the
program or computer requests it for execution.
• SPOOL is an acronym for simultaneous peripheral operations online.
• Generally, the spool is maintained on the computer's physical memory,
buffers, or the I/O device-specific interrupts.
• The spool is processed in ascending order, working based on a FIFO
(first-in, first-out) algorithm.
• Spooling refers to putting data of various I/O jobs in a buffer.
• This buffer is a special area in memory or hard disk which is accessible
to I/O devices.
Working step of spooling
• Spooling involves creating a buffer called SPOOL, which is used
to hold off jobs and data till the device in which the SPOOL is
created is ready to make use and execute that job or operate on
the data.
• When a faster device sends data to a slower device to perform
some operation, it uses any secondary memory attached as a
SPOOL buffer. This data is kept in the SPOOL until the slower
device is ready to operate on this data. When the slower device is
ready, then the data in the SPOOL is loaded onto the main
memory for the required operations.
• Spooling considers the entire secondary memory as a huge buffer
that can store many jobs and data for many operations. The
advantage of Spooling is that it can create a queue of jobs that
execute in FIFO order to execute the jobs one by one.
Spooling
• A device can connect to many input devices, which may require
some operation on their data. So, all of these input devices may
put their data onto the secondary memory (SPOOL), which can
then be executed one by one by the device. This will make sure
that the CPU is not idle at any time. So, we can say that Spooling
is a combination of buffering and queuing.
• After the CPU generates some output, this output is first saved in
the main memory. This output is transferred to the secondary
memory from the main memory, and from there, the output is
sent to the respective output devices.
OPERATING SYSTEM
II YEAR
IV Semester
Lecture 8
Pallavi Shukla
Assistant Professor
Kernel
• The kernel is a computer program at the
core of a computer’s operating system and
has complete control over everything in the
system. It manages the operations of the
computer and the hardware.
Kernel
• There are five types of kernels :
1.A micro kernel, which only contains basic
functionality;
2.A monolithic kernel, which contains many
device drivers.
3.Hybrid Kernel
4.Exokernel
5.Nanokernel
Microkernel
• kernel manages the operations of the computer,
In microkernel the user services and kernel
services are implemented in different address
space.
• The user services are kept in user address space,
and kernel services are kept under kernel address
space.
Monolithic Kernel
• In Monolithic kernel, the entire operating system
runs as a single program in kernel mode.
• The user services and kernel services are
implemented in same address space.
Reentrant Kernel
• In kernel mode, a reentrant kernel allows
processes (or, more precisely, their
corresponding kernel threads) to give up the
CPU.
• They have no effect on other processes
entering kernel mode.
• Multiple processor systems may be scheduled
together in the case of single-processor
systems.
Reentrant Kernel
When a user program requests a disc read, the scheduler will
delegate the CPU to another process (kernel thread) until the
disc controller issues an interrupt indicating that the data is
accessible and our thread can be resumed.
This process can still access I/O, such as user input, which
requires kernel functions.
The system remains responsive, and the amount of CPU time
wasted as a result of IO delays is reduced.
The original function (whatever requested data) would be
blocked in a non-reentrant kernel until the disc read was
completed.