Unit 1 (Kca 203)
Unit 1 (Kca 203)
Unit 1 (Kca 203)
Operating System Concepts – 9th Edition 1.1 Silberschatz, Galvin and Gagne
GOALS OF OPERATING SYSTEM
1.Convenience
2.Efficiency
Operating System Concepts – 9th Edition 1.2 Silberschatz, Galvin and Gagne
LAYERED ARCHITECTURE OF OS
Operating System Concepts – 9th Edition 1.3 Silberschatz, Galvin and Gagne
A system can be made modular in many ways .One method is
layered approach, in which the OS is broken into number of
layers.
The bottom layer(layer 0) is the hardware ,the highest (layer N)
is the user interface.
1. The outermost layer must be the User Interface layer.
2. The innermost layer must be the Hardware layer.
3. A particular layer can access all the layers present below it but
it cannot access the layers present above it. That is layer n-1
can access all the layers from n-2 to 0 but it cannot access the
nth layer.
Thus if the user layer wants to interact with the hardware layer,
the response will be traveled through all the layers from n-1 to
1. Each layer must be designed and implemented such that it
will need only the services provided by the layers below it.
Operating System Concepts – 9th Edition 1.4 Silberschatz, Galvin and Gagne
Advantages :
There are several advantages to this design :
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. Suppose an error
occurs in the CPU scheduling layer, so the developer can only search
that particular layer to debug, unlike the Monolithic system in which all
the services are present together.
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, unlike the Simple system in which the user had direct access
to the hardware
5. Abstraction :
Every layer is concerned with its own functions. So the functions and
implementations of the other layers are abstract to it.
Operating System Concepts – 9th Edition 1.5 Silberschatz, Galvin and Gagne
Disadvantages :
Though this system has several advantages over the Monolithic
and Simple design, there are also some disadvantages as follows.
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. Thus with great modularity comes complex
implementation.
2. Slower in execution :
If a layer wants to interact with another layer, it sends a request
that has to travel through all the layers present in 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.
Operating System Concepts – 9th Edition 1.6 Silberschatz, Galvin and Gagne
Computer System Structure
Computer system can be divided into four components:
Hardware – provides basic computing resources
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
Word processors, compilers, web browsers,
database systems, video games
Users
People, machines, other computers
Operating System Concepts – 9th Edition 1.7 Silberschatz, Galvin and Gagne
Four Components of a Computer System
Operating System Concepts – 9th Edition 1.8 Silberschatz, Galvin and Gagne
What Operating Systems Do
USER VIEW
Depends on the point of view
Users want convenience, ease of use and good
performance
Don’t care about resource utilization
But shared computer such as mainframe or
minicomputer must keep all users happy
Users of dedicate 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
Operating System Concepts – 9th Edition 1.9 Silberschatz, Galvin and Gagne
Operating System Definition
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
Operating System Concepts – 9th Edition 1.10 Silberschatz, Galvin and Gagne
FUNCTIONS OF OS
Operating System Concepts – 9th Edition 1.11 Silberschatz, Galvin and Gagne
Memory Management
Memory management refers to management of Primary Memory or Main
Memory. Main memory
is a large array of words or bytes where each word or byte has its own
address.
Main memory provides a fast storage that can be access directly by the CPU.
So for a program
to be executed, it must in the main memory. Operating System does the
following activities for
memory management.
Keeps tracks of primary memory i.e. what part of it are in use by whom, what
part are
not in use.
In multiprogramming, OS decides which process will get memory when and
how much.
Allocates the memory when the process requests it to do so.
De-allocates the memory when the process no longer needs it or has been
terminated.
Operating System Concepts – 9th Edition 1.12 Silberschatz, Galvin and Gagne
Processor Management
In multiprogramming environment, OS decides which process
gets the processor when and how much time. This function
is called process scheduling(CPU SCHEDULING). Operating
System does the following activities for processor
management
. Keeps tracks of processor and status of process. Program
responsible for this task is known as traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when processor is no longer required.
Operating System Concepts – 9th Edition 1.13 Silberschatz, Galvin and Gagne
Device Management
OS manages device communication via their respective drivers.
Operating System does the following activities for device
management.
Keeps tracks of all devices. Program responsible for this task
is known as the I/O controller.
Decides which process gets the device when and for how
much time.
Allocates the device in the efficient way.
De-allocates devices.
Operating System Concepts – 9th Edition 1.14 Silberschatz, Galvin and Gagne
File Management
A file system is normally organized into directories for easy
navigation and usage. These directories may contain files
and other directions. Operating System does the following
activities for file management.
Keeps track of information, location, uses, status etc. The
collective facilities are often known as file system.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources
Operating System Concepts – 9th Edition 1.15 Silberschatz, Galvin and Gagne
Other Important Activities
Following are some of the important activities that Operating
System does. Security -- By means of password and similar
other techniques, preventing unauthorized access to
programs and data.
Control over system performance -- Recording delays
between request for a service and response from the system.
Job accounting -- Keeping track of time and resources used
by various jobs and users.
Error detecting aids -- Production of dumps, traces, error
messages and other debugging and error detecting aids.
Coordination between other software and users --
Coordination and assignment of compilers, interpreters,
assemblers and other software to the various users of the
computer systems.
Operating System Concepts – 9th Edition 1.16 Silberschatz, Galvin and Gagne
TYPES OF OS
Operating System Concepts – 9th Edition 1.18 Silberschatz, Galvin and Gagne
Multiprogramming Operating System
In this the operating system picks up and begins to execute one of the
jobs from memory.
Once this job needs an I/O operation operating system switches to another
job (CPU and OS always busy).
Jobs in the memory are always less than the number of jobs on disk(Job
Pool).
If several jobs are ready to run at the same time, then the system chooses
which one to run through the process of CPU Scheduling.
In Non-multiprogrammed system, there are moments when CPU sits idle
and does not do any work.
In Multiprogramming system, CPU will never be idle and keeps on
processing.
Time Sharing Systems are very similar to Multiprogramming batch
systems. In fact time sharing systems are an extension of
multiprogramming systems.
In Time sharing systems the prime focus is on minimizing the response
time, while in multiprogramming the prime focus is to maximize the CPU
usage.
Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne
Multiprogramming Operating System
Operating System Concepts – 9th Edition 1.20 Silberschatz, Galvin and Gagne
Multiprocessor Systems
A Multiprocessor system consists of several processors that share
a common physical memory. Multiprocessor system provides
higher computing power and speed. In multiprocessor system all
processors operate under single operating system. Multiplicity of
the processors and how they do act together are transparent to
the others.
Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne
MULTIPROCESSOR SYSTEM
Parallel systems or tightly coupled systems
Have more than one processor in close communication
sharing the bus, clock and sometimes memory and
peripheral devices.
ADVANTAGES
Increased throughput
Economy of scale
Increased reliability
TYPES
Symmetric Multiprocessing-all processors are peers,no boss
Asymmetric Multiprocessing-A boss processor controls the
system,other processors either look to the boss for
instructions or they have specified task.
Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne
TIME SHARING SYSTEMS
Multitasking
Logical extension of multiprogramming
CPU executes multiple jobs by switching among them but
the switches occur so frequently that the users can interact
with each program while it is running.
Operating System Concepts – 9th Edition 1.23 Silberschatz, Galvin and Gagne
DISTRIBUTED SYSTEMS
TYPES
1.Client server systems
- Compute server and file server
Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne
CLUSTERED SYSTEMS
Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne
REAL TIME SYSTEMS
These are used when rigid time requirements have been
placed on the operation of a processor or flow of data.
TYPES
SOFT RTOS-meeting of deadline is not compulsory for every
time for every task but process should get processed and
give result.
HARD RTOS- guarantees that critical tasks complete in time.
APPLICATIONS
ROBOTICS
AIR TRAFFIC CONTROL
CONTROL SYSTEMS
MEDICAL IMAGING SYSTEMS
Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne
NETWORK OPERATING SYSTEM
Network operating System runs on a server and and provides server the
capability to manage data, users, groups, security, applications, and other
networking functions.
The primary purpose of the network operating system is to allow shared file
and printer 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 are Microsoft Windows Server
2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell
NetWare, and BSD.
Operating System Concepts – 9th Edition 1.27 Silberschatz, Galvin and Gagne
The advantages of network operating systems are following.
Centralized servers are highly stable.
Security is server managed.
Upgrades to new technologies and hardware can be easily integrated into
the system.
Remote access to servers is possible from different locations and types of
systems.
Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne
Kernel
A kernel is the core component of an operating system.
Using interprocess communication and system calls, it acts
as a bridge between applications and the data processing
performed at the hardware level.
When an operating system is loaded into memory, the kernel
loads first and remains in memory until the operating system
is shut down again. The kernel is responsible for low-level
tasks such as disk management, task management and
memory management.
A computer kernel interfaces between the three major
computer hardware components, providing services between
the application/user interface and the CPU, memory and
other hardware I/O devices.
Operating System Concepts – 9th Edition 1.29 Silberschatz, Galvin and Gagne
The kernel is responsible for:
Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne
Kernel vs OS
BASIS FOR
KERNEL OPERATING SYSTEM
COMPARISON
Basic Kernel is an important part of the operating Operating System is a system
system. program.
Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne
Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne
Types of Kernels
Monolithic Kernels: All operating system services run along the main
kernel thread in a monolithic kernel, which also resides in the same
memory area, thereby providing powerful and rich hardware access.
Microkernels: Define a simple abstraction over hardware that use
primitives or system calls to implement minimum OS services such
as multitasking, memory management and interprocess
communication.
Hybrid Kernels: Run a few services in the kernel space to reduce the
performance overhead of traditional microkernels where the kernel
code is still run as a server in the user space.
Nano Kernels: Simplify the memory requirement by delegating
services, including the basic ones like interrupt controllers or timers
to device drivers.
Exo Kernels: Allocate physical hardware resources such as
processor time and disk block to other programs, which can link to
library operating systems that use the kernel to simulate operating
system abstractions.
Operating System Concepts – 9th Edition 1.33 Silberschatz, Galvin and Gagne
MULTICORE AND
MULTIPROCESSOR
Operating System Concepts – 9th Edition 1.35 Silberschatz, Galvin and Gagne
Operating System Concepts – 9th Edition 1.36 Silberschatz, Galvin and Gagne
The main advantage of a multicore is that it is capable of
executing multiple instructions simultaneously on separate
cores.
It increases the overall speed and also implements parallel
computing. Overall, multicore is used for applications such
as embedded systems, networking, Digital Signal Processing
(DSP) and graphics (GPU).
Operating System Concepts – 9th Edition 1.37 Silberschatz, Galvin and Gagne
Multicores have multiple cores or processing units in a
single CPU. A multiprocessor contains multiple CPUs.
Both multicore and multiprocessors help to speed up the
computing process. A multicore does not require complex
configurations like a multiprocessor.
On the other hand, a multiprocessor is more reliable and
capable of executing multiple programs. In brief, a multicore
has a single CPU whereas a multiprocessor has many CPUs.
Operating System Concepts – 9th Edition 1.38 Silberschatz, Galvin and Gagne
MULTIPROCESSOR
A multiprocessor has two or more CPUs or processors. These
systems execute multiple instructions at the same time. Therefore,
it increases throughput. If one processor fails, it will not affect the
functioning of the other processors. Therefore, multiprocessors are
more reliable
Multiprocessor systems can use shared memory or distributed
memory. In a shared memory multiprocessor, each CPU shares main
memory and peripherals to execute instructions at the same time.
In these type of systems, all the CPUs use the same bus to access
the main memory. It offers a single memory space for all the CPUs.
Most CPUs will be idle as there is more traffic to access the bus.
These multiprocessors are also called symmetric multiprocessors.
In distributed memory multiprocessors, each CPU has their private
memory. Every CPU can operate on local data to perform
computational tasks. If the remote data is required, the CPU can
communicate with other CPUs or access the main memory via the
bus.
Operating System Concepts – 9th Edition 1.39 Silberschatz, Galvin and Gagne
Operating System Concepts – 9th Edition 1.40 Silberschatz, Galvin and Gagne
Difference Between Multicore and Multiprocessor
Definition
A multicore is a single CPU or processor with two or more
independent processing units called cores that are capable
of reading and executing program instructions.
Multiprocessor is a system with two or more CPUs that
allows simultaneous processing of programs.
Execution
Multicore executes a single program faster. On the other
hand, multiprocessor executes multiple programs faster.
Operating System Concepts – 9th Edition 1.41 Silberschatz, Galvin and Gagne
Reliability
Multiprocessor systems are more reliable than multicore
systems. A multiprocessor has more CPUs. Failure in one will
not affect the other CPUs. It is more tolerant to faults.
Traffic
The multicore systems have less traffic compared to a
multiprocessor because all the cores are integrated into a
single chip.
Conclusion
The difference between multicore and multiprocessor is that
multicore refers to a single CPU with multiple execution
units while multiprocessor refers to a system that has two or
more CPUs. Modern computers have multiple CPUs each with
multiple cores.
Operating System Concepts – 9th Edition 1.42 Silberschatz, Galvin and Gagne