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

Unit 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Unit 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Operating System

Unit-1
Contents of the Unit 1
Introduction :
Operating system and functions
Classification of Operating systems- Batch, Interactive, Time sharing, Real Time
System, Multiprocessor Systems, Multiuser Systems, Multiprocess Systems,
Multithreaded Systems,
Operating System Structure- Layered structure
System Components
Operating System services
Reentrant Kernels, Monolithic and Microkernel Systems.
Definition of Operating System
An operating system acts as an intermediary between the user of a computer and computer
hardware. The purpose of an operating system is to provide an environment in which a user can
execute programs in a convenient and efficient manner.
An operating system is software that manages computer hardware. The hardware must provide
appropriate mechanisms to ensure the correct operation of the computer system and to prevent user
programs from interfering with the proper operation of the system.

Operating System – Definition:

An operating system is a program that controls the execution of application programs and acts as
an interface between the user of a computer and the computer hardware.
A more common definition is that the operating system is the one program running at all times on
the computer (usually called the kernel), with all else being application programs.
An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The operating system correspondingly includes programs to
manage these resources, such as a traffic controller, a scheduler, a memory management module,
I/O programs, and a file system.
Conceptual view of a computer system
Position of the Operating System in our
System
Layered Structure of the Operating
System
The operating system is split into various layers In the layered operating system and each of the
layers have different functionalities.
Layering provides a distinct advantage in an operating system. All the layers can be defined
separately and interact with each other as required.
Layers in Layered Operating System
There are six layers in the layered operating system.
Hardware (Layer 1)
This layer interacts with the system hardware and coordinates with all the peripheral devices used such as
printer, mouse, keyboard, scanner etc. The hardware layer is the lowest layer in the layered operating
system architecture.
CPU Scheduling (Layer 2)
This layer deals with scheduling the processes for the CPU. There are many scheduling queues that are
used to handle processes. When the processes enter the system, they are put into the job queue. The
processes that are ready to execute in the main memory are kept in the ready queue.
Memory Management (Layer 3)
Memory management deals with memory and the moving of processes from disk to primary memory for
execution and back again. This is handled by the third layer of the operating system.
Process Management (Layer 4)
This layer is responsible for managing the processes i.e assigning the processor to a process at a time. This
is known as process scheduling. The different algorithms used for process scheduling are FCFS (first come
first served), SJF (shortest job first), priority scheduling, round-robin scheduling etc.
I/O Buffer (Layer 5)
I/O devices are very important in the computer systems. They provide users with the means of interacting
with the system. This layer handles the buffers for the I/O devices and makes sure that they work correctly.
User Programs (Layer 6)
This is the highest layer in the layered operating system. This layer deals with the many user programs and
applications that run in an operating system such as word processors, games, browsers etc.
Functions of Operating System
Main functions of Operating System:
Process management:- Process management helps OS to create and delete processes. It also provides
mechanisms for synchronization and communication among processes.
Memory management:- Memory management module performs the task of allocation and de-allocation of
memory space to programs in need of this resources.
File management:- It manages all the file-related activities such as organization storage, retrieval, naming,
sharing, and protection of files.
Device Management: Device management keeps tracks of all devices. This module also responsible for this task
is known as the I/O controller. It also performs the task of allocation and de-allocation of the devices.
I/O System Management: One of the main objects of any OS is to hide the peculiarities of that hardware devices
from the user.
Secondary-Storage Management: Systems have several levels of storage which includes primary storage,
secondary storage, and cache storage. Instructions and data must be stored in primary storage or cache so that a
running program can reference it.
Security:- Security module protects the data and information of a computer system against malware threat and
authorized access.
Command interpretation: This module is interpreting commands given by the and acting system resources to
process that commands.
Networking: A distributed system is a group of processors which do not share memory, hardware devices, or a
clock. The processors communicate with one another through the network.
Job accounting: Keeping track of time & resource used by various job and users.
Communication management: Coordination and assignment of compilers, interpreters, and another software
resource of the various users of the computer systems.
Components of Operating Systems

An operating system is a large and complex system that can only be created by partitioning into
small pieces. These pieces should be a well-defined portion of the system, which carefully defined
inputs, outputs, and functions.

Major components of OS are-

File Management
Process Management
I/O Device Management
Network Management
Main Memory management
Secondary-Storage Management
Security Management
1. File Management
A file is a set of related information which is should define by its creator. It commonly represents
programs, both source and object forms, and data. Data files can be numeric, alphabetic, or
alphanumeric.
Function of file management in OS:
The operating system has the following important given activities in connections with file management:
File and directory creation and deletion.
For manipulating files and directories.
Mapping files onto secondary storage.
Backup files on stable storage media.
2. Process Management
The process management component is a procedure for managing the many processes that are
running simultaneously on the operating system. Every software application program has one or more
processes associated with them when they are running.
For example, when you use a browser like Google Chrome, there is a process running for that
browser program. The OS also has many processes running, which performing various functions.
All these processes should be managed by process management, which keeps processes for running
efficiently. It also uses memory allocated to them and shutting them down when needed.
The execution of a process must be sequential so, at least one instruction should be executed on
behalf of the process.
Functions of process management in OS:

The following are functions of process management.


Process creation and deletion.
Suspension and resumption.
Synchronization process
Communication process

3. I/O Device Management


One of the important use of an operating system that helps you to hide the variations of specific hardware devices from
the user.

Functions of I/O management in OS:

It offers buffer caching system


It provides general device driver code
It provides drivers for particular hardware devices.
I/O helps you to knows the individualities of a specific device.
4. Network Management
Network management is the process of administering and managing computer networks. It includes performance
management, fault analysis, provisioning of networks, and maintaining the quality of service.
The computers in the network are connected through a communication network, which can be configured in a number of
different ways. With the help of network management, the network can be fully or partially connected, which helps users
to design routing and connection strategies that overcome connection and security issues.

Functions of Network management:


Distributed systems help you to various computing resources in size and function. They may involve microprocessors,
minicomputers, and many general-purpose computer systems.
A distributed system also offers the user access to the various resources the network shares.
It helps to access shared resources that help computation to speed-up or offers data availability and reliability.
5. Main Memory management
Main Memory is a large array of storage or bytes, which has an address. The memory management process is conducted
by using a sequence of reads or writes of specific memory addresses.
In order to execute a program , it should be mapped to absolute addresses and loaded inside the Memory. The selection
of a memory management method depends on several factors.

Functions of Memory management in OS:


An Operating System performs the following functions for Memory Management:
It helps you to keep track of primary memory.
Determine what part of it are in use by whom, what part is not in use.
In a multiprogramming system, the OS takes a decision about which process will get Memory and how much.
Allocates the memory when a process requests
It also de-allocates the Memory when a process no longer requires or has been terminated.
6. Secondary-Storage Management
The most important task of a computer system is to execute programs. These programs, along with the data, helps you to
access, which is in the main memory during execution.
This Memory of the computer is very small to store all data and programs permanently. The computer system offers
secondary storage to back up the main Memory. Today modern computers use hard drives/SSD as the primary storage of
both programs and data. However, the secondary storage management also works with storage devices, like a USB flash
drive, and CD/DVD drives.

Functions of Secondary storage management in OS:


Here, are major functions of secondary storage management in OS:
Storage allocation
Free space management
Disk scheduling

7. Security Management
The various processes in an operating system need to be secured from each other's activities. For that purpose, various
mechanisms can be used to ensure that those processes which want to operate files, memory CPU, and other hardware
resources should have proper authorization from the operating system.
Services of Operating System

An Operating System supplies different kinds of services to both the users and to the programs as
well. It also provides application programs (that run within an Operating system) an environment to
execute it freely. It provides users the services run various programs in a convenient manner.

List of common services offered by an almost all operating systems:


User Interface
Program Execution
File system manipulation
Input / Output Operations
Communication
Resource Allocation
Error Detection
Accounting
Security and protection
Operating System Type
• Batch Operating System

• Multiprogramming Operating System

• Time-Sharing Operating Systems

• Distributed Operating System

• Netw ork Operating System

• Real Time Operating System


• t f a r d r e a l - t i m e systems
• Soft r e a l - t i m e systems

• Mobile Operating System

• Multiprocessor Operating System

• Interactive Operating System

• Multithreading Operating System


Batch Operating System
• The users of a batch operating
system do not interact w i t h 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 w i t h
similar needs are batched together
and r u n as a group.
The problems with Batch Systems
• Lack of interaction between the
user and the job.
• CPU is often idle, because the speed
of the mechanical I / O devices is
slower t han the CPU.
• Difficult to provide the desired
priority.
Multiprogramming Operating System
To overcome the problem of under utilization of CPU and main memory, the multi-programming
was introduced. The multi-programming is interleaved execution of multiple jobs by the
same computer.
In multi-programming system, when one program is waiting for I/O transfer; there is another
program ready to utilize the CPU. So it is possible for several jobs to share the time of the CPU.
But it is important to note that multi-programming is not defined to be the execution of jobs at
the same instance of time. Rather it does mean that there are a number of jobs available to the
CPU (placed in main memory) and a portion of one is executed then a segment of another and
so on. A simple process of multi-programming is shown in figure
Time-sharing operating systems
• Time-sharing is a technique which enables m a n y people, located a t various
terminals, t o use a particular computer system a t the same time.Add your
second bullet point here.
• Processor's t im e which is shared among multiple users simultaneously is
termed as time-sharing.
• Multiple jobs are executed by the CPU by switching between them, but the
switches occur so frequently. Thus, the user can receive an immediate
response. For example, in a transaction processing, the processor executes
each user pr ogr am in a short burst or quantum of computation. That is,
if n users are present, then each user can get a t im e quantum. When the
user submits the command, the response t im e is in few seconds a t most.
The oper a ting system uses CPU scheduling and m u lt i p rogram m ing to
provide each user w i t h a small portion of a time. Computer systems t h a t
were designed pr imarily as batch systems have been modified to t i m e -
sharing systems.

Advantage Disadvantage
* Avoids duplication of software. * Problem of reliability
* Reduces CPU idle time. * Problem of data communication.

* Provides the advantage of quick * Question of security and integrity of


response. user programs and data.
Distributed operating System
• Distributed systems use multiple
central processors to serve multiple
r e a l - ti me applications and multiple
users.

• Data processing jobs are distributed


among the processors accordingly.

• Processors in a distributed system


m a y vary in size and function.

• These processors are referred as


sites, nodes, computers, and so on.
Advantages
• With resource sharing facility, a user a t
one site ma y be able to use the
resources available a t another.
• Speedup the exchange of data w i t h one
another via electronic mail.
• If one site fails in a distributed system,
the remaining sites can potentially
continue operating.
• Better service to the customers.
• Reduction of the load on t he host
computer.
• Reduction of delays in data processing.
Network operating System
• A Network Operating System runs on
a server and provides the server the
capability to manage data, users,
groups, security, applications, and
other networking functions.

• The p r i m a r y purpose of the network


operating system is to allow shared
file and p r i n t e r access among multiple
computers in a network, typically a
local area network LAN, a private
network or to other networks.
Examples of network operating systems include Microsoft Windows Server
2 0 0 3 , Microsoft Windows Server 2 0 0 8 , UNIX, Linux, Mac OS X.

Advantage Disadvantage
• Centralized servers are highly • tfigh cost of buying and
stable. running a server.
• Security is server managed. • Dependency on a central
• Upgrades to new technologies location for most operations.
and hardware can be easily • Regular maintenance and
integrated into the system. updates are required.
• Remote access to servers is
possible f r o m different
locations and types of systems.
Real Time operating System
• A r e a l - t i me system is defined as a
data processing system in which
the t i me interval required to
process and respond to inputs is so
small t h a t i t controls the
environment.
• The t i me taken by the system to
respond to an input and display of
required updated information is
termed as the response time.
• So in this method, the response
t i me is very less as compared to
online processing
• Real-time systems are used when there are
rigid t i me requirements on the operation of a
processor or the flow of data and r e a l - t i m e
systems can be used as a control device in a
dedicated application.

• A r e a l - t i me operating system must have w e l l -


defined, fixed t i m e constraints, otherwise the
system will fail.

• For example, Scientific experiments, medical


imaging systems, industrial control systems,
weapon systems, robots, air traffic control
systems, etc.
There are two types of real-time operating systems.

Hard Real-Time OS. Soft Real-Time OS.


• t f a r d r e a l - t i m e systems • Soft r e a l - t im e systems are less
restrictive.
guarantee t h a t critical tasks
complete on time. • A critical r e a l - t i m e task gets
p r i o r it y over other tasks and
• In hard r e a l - t i me systems, retains the p r io r it y until i t
completes.
secondary storage is limited or
missing and the data is stored • Soft r e a l - t im e systems have limited
in ROM. u t ilit y than hard r e a l - t im e systems.
For example, multimedia, virtual
• In these systems, virtual reality, Advanced Scientific Projects
like undersea exploration and
me mo r y is almost never found. planetary rovers, etc
Mobile Operating System
• Mobile operating system is the software platform on top of
which other programs can run on mobile devices.
• A mobile operating system is an Operating System t h a t is
specifically designed t o r u n on mobile devices such as mobile
phones, smartphones, PDAss, tablet computers and other
handheld devices. Like:
• Android OS (Google Inc.)
• lackBerry OS (Research In Motion)
• iPhone OS / iOS (Apple)
• Symbian OS (Nokia)
• Windows Mobile (Windows Phone 7)
Multiprocessor Operating System
Multiprocessor Operating System refers to the use of two or more central processing
units (CPU) within a single computer system. These multiple CPUs are in a close
communication sharing the computer bus, memory and other peripheral devices. These
systems are referred as tightly coupled systems.
These types of systems are used when very high speed is required to process a large
volume of data. These systems are generally used in environment like satellite control,
weather forecasting etc. The basic organization of multiprocessing system is shown in fig.
Interactive Operating System
In Interactive Operating System there is a direct interaction between
the user and the computer. Mostly all the Personal Computers are
Interactive Operating System. In this kind of Operating system, the user
input some command in the system and the system works according to
it.

Advantages-
User has the option of controlling his job from its submission to
completion.
Delay time can be reduced by terminating jobs taking long time
Disadvantages-
User interaction can affect other job that are running on current
system.
Extra resources and involved in interactive system.
Multithreading Operation System
A thread is a path which is followed during a program’s execution. Majority of programs written now
a days run as a single thread. Lets say, for example a program is not capable of reading
keystrokes while making drawings. These tasks cannot be executed by the program at the same
time. This problem can be solved through multitasking so that two or more tasks can be executed
simultaneously.
The concept of multi-threading needs proper understanding of these two terms – a process and
a thread. A process is a program being executed. A process can be further divided into
independent units known as threads.
A thread is like a small light-weight process within a process. Or we can say a collection of threads
is what is known as a process.
Kernel in OS
Kernel in Operating System

Kernel is the core part of an operating system which manages system resources. It also acts like a bridge
between application and hardware of the computer. It is one of the first programs loaded on start-up.
Kernel loads first into memory when an operating system is loaded and remains into memory until
operating system is shut down again. It is responsible for various tasks such as disk management, task
management, and memory management.
It decides which process should be allocated to processor to execute and which process should be kept
in main memory to execute. It basically acts as an interface between user applications and hardware. The
major aim of kernel is to manage communication between software i.e. user-level applications and
hardware i.e., CPU and disk memory.
Kernel mode and User mode of CPU operation

The CPU can execute certain instruction only when it is in the kernel mode. These
instruction are called privilege instruction. They allow implementation of special
operation whose execution by the user program could interface with the functioning of
operating system or activity of another user program. For example, instruction for
managing memory protection.
Objectives of Kernel

To establish communication between user level application and hardware.


To decide state of incoming processes.
To control disk management.
To control memory management.
To control task management.
Types of Kernel
1. Micro Kernel –

Microkernel is one of the classification of the kernel. Being a kernel it manages all system resources. But
in a 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,
thus also reduces the size of kernel and size of operating system as well.
Microkernel Architecture –
Since kernel is the core part of the operating system, so it is meant for handling the most important
services only. Thus in this architecture only the most important services are inside kernel and rest of the
OS services are present inside system application program. Thus users are able to interact with those not-
so important services within the system application. And the microkernel is solely responsible for the
most important services of operating system they are named as follows:
Inter process-Communication
Memory Management
CPU-Scheduling

Example :
Mach, L4, AmigaOS, Minix, K42 etc
Advantage :
It is more stable.
Disadvantage :
There are lots of system calls and context switches.
2. Monolithic Kernel –
Monolithic Kernel is another classification of Kernel. Like microkernel this one also manages system
resources between application and hardware, but user services and kernel services are implemented
under same address space. It increases the size of the kernel, thus increases size of operating
system as well.
This kernel provides CPU scheduling, memory management, file management and other
operating system functions through system calls. As both services are implemented under same
address space, this makes operating system execution faster.
Example :
Unix, Linux, Open VMS, XTS-400 etc
Advantage :
It has good performance.
Disadvantage :It has dependencies between
system component and lines of code in millions.
3. Hybrid Kernel –

It is the combination of both monolithic kernel and mircrokernel. It has speed and design of
monolithic kernel and modularity and stability of microkernel.
Example :
Windows NT, Netware, BeOS etc.
Advantage :
It combines both monolithic kernel and microkernel.
Disadvantage :
It is still similar to monolithic kernel.

4. Reentrant Kernel-

A re-entrant kernel enables processes (or, to be more precise, their corresponding kernel threads)
to give away the CPU while in kernel mode. They do not hinder other processes from also entering
kernel mode. In the case of single processor systems multiple may be scheduled together
An example of this case is a disk read. User program issues a system call for a disk read the
scheduler will assign the CPU to another process (kernel thread) until an interrupt from the disk
controller indicates that the data is available and our thread can be resumed. This process can still
access I/O (which needs kernel functions), like user input. The system stays responsive and CPU
time waste due to IO wait is reduced.
In a non reentrant kernel, the original function (whatever requested data) would be blocked until the
disk read was complete
Difference Between Microkernel and Monolithic
Kernel
Assignment No 1
Q1. How are network computers different from the traditional personal
computers?
Q2. What are the main difference between the operating system for
mainframe computers and personal computers?
Q3. What is the main advantage of the microkernel approach to system
design?
Q4. Define the following:
Batch
Interactive
Time Sharing
Q5. Identify the several advantages and disadvantages of the open-source
operating system?
Sources of Contents
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley
2. https://www.w3schools.in/
3. https://www.geeksforgeeks.org/
4. https://www.guru99.com/
5. https://www.tutorialspoint.com/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy