Professional Documents
Culture Documents
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
use
• Use the computer hardware in efficient
manner
3
OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for efficient
and fair resource use
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
OS is a control program
• Controls execution of programs to prevent errors
and improper use of the computer
4
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
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
the kernel.
Everything else is either
• a system program (ships with the operating system) , or
• an application program.
5
Dr. Akhtar Husain, Department of
Computer Science and Information
6
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Command Command Command Graphic User
Line User Line User Line User Interface
Interface Interface, Interface (GUI)
GUI
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
(2). Memory management:- Memory management
module takes care of allocation and de-allocation of
memory space to programs in need.
(3). File management:- It takes care of file-related
activities such as organization storage, retrieval,
naming, sharing, and protection of files. 8
(Contd..)
(4). Device Configuration:- Controls peripheral
devices connected to the computer.
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
(4). Interface Platform:- Allows the computer to run
other applications.
9
Dr. Akhtar Husain, Department of
Computer Science and Information
10
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
system with the capability of multitasking allows users to activate more than
one task, or application program, at a time. An Internet browser that
searches for some information and A word-processing software that is
activated to perform the word-processing task are applications.
• The operating system will switch between tasks based on the tasks current
states and their requirements and priorities.
• Multitasking is only possible when multiprogramming is the fundamental
capability of simultaneously executing pieces of software.
• Most modern operating systems, like UNIX, Linux, and Windows, support 19
multitasking.
Dr. Akhtar Husain, Department of
Computer Science and Information
20
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
request to a process at a time. For example, a browser can be made
to search simultaneously for more than one topic, even though there
is only one copy of the “browser program” in main memory.
• The multiprogramming methodology and technique are essential in
the implementation of multithreading. In this new environment, a
thread becomes the smallest functional object to which CPU is
assigned.
21
Dr. Akhtar Husain, Department of
Computer Science and Information
22
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
users
• Business application
• Communications application
• Multimedia application
• Entertainment and educational software
• Driver Programs (Device Driver)
• small program that allows a specific input or output
device to communicate with the rest of the computer 27
system
General-purpose OS is very large program
Various ways to structure ones
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
• More complex -- UNIX
• Layered – an abstrcation
• Microkernel -Mach
28
MS-DOS-written to provide the most functionality
in the least space
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
structure, its interfaces and
level of functionality are not
well separated
29
UNIX-limited by hardware functionality, the original UNIX
operating system had limited structuring. The UNIX
OS consists of two separable parts.
• System Programs
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
• The Kernel
Consists of everything below the system-call interface and
above the physical hardware
Provides the file system, CPU scheduling, memory
management, and other operating-system functions; a
large number of functions for one level
30
Dr. Akhtar Husain, Department of
Computer Science and Information
31
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
With modularity, layers are
selected such that each uses
functions (operations) and
services of only lower-level
layers
32
Mach example of microkernel
Moves as much from the kernel into user space
• Mac OS X kernel (Darwin) partly based on Mach
Communication takes place between user modules using
message passing
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Benefits:
• Easier to extend a microkernel
• Easier to port the operating system to new architectures
• More reliable (less code is running in kernel mode)
• More secure
Detriments:
• Performance overhead of user space to kernel space 33
communication
Application File Device user
Program System Driver mode
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
messages messages
microkernel
hardware
34
Process Management
Memory management
I/O Device management
File system
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Protection
Network management
Network services
User Interface
35
User Interface
Program Execution
I/O Operations
File system management
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Communication
Error detection and handling
Resources allocation
Accounting
Protection 36
Security
Dr. Akhtar Husain, Department of
Computer Science and Information
37
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Program execution
• Starting of programs, managing their execution and
communicating their results
I/O operations
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Error detection and handlings
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
Protection
• One process must be protected from another
Security
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
When a process makes requests of the kernel, the
request is called a system call. Various kernel designs
differ in how they manage system calls and resources
41
Dr. Akhtar Husain, Department of
Computer Science and Information
42
KERNEL
Hybrid
Micro
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
memory management, interrupt handling and I/O
communication, file system etc. in kernel space.
Examples are Linux, Unix.
(Contd..)
Advantages: It has very good performance
Disadvantages: Difficult to debug and maintain
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
are implemented in user-space programs, referred to
as servers.
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
operating systems and to have more than one active
simultaneously.
Advantages:
• Easy to maintain
• Crash resistant(if one server fails still other server
work efficiently)
• Portable
• Smaller in size 47
Disadvantage: Slower processing because of additional
message passing (Contd..)
Monolithic Kernel Micro Kernel
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
needed for memory memory management in
management in kernel userspace.
space.
The monolithic kernel The microkernel approach
approach handle I/O doesn't handle I/O
communication directly. communication directly. 48
Unstable Stable
This approach combines the speed and simpler
design of a monolithic kernel with the modularity and
execution safety of a microkernel
are a compromise between the monolithic and
microkernel designs.
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
49
Delegates virtually all services — including even the
most basic ones like interrupt controllers or the timer —
to device drivers to make the kernel memory
requirement even smaller than a traditional microkernel
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
50
• A re-entrant kernel enables a process (and it’s threads) to give away the CPU
while in kernel mode. They do not hinder other processes from also entering
kernel mode. This behavior allows CPU to be shared among multiple processes.
• A typical use case is IO wait. The process wants to read a file. It calls a kernel
function for this. Inside the kernel function, the disk controller is asked for the
data. Getting the data will take some time and the function is blocked during
that time.
University
Dr. Akhtar Husain, Department of
Computer Science and Information
Technology, FET, MJP Rohilkhand
• With a re-entrant kernel, 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 IO
(which needs kernel functions), like user input. The system stays responsive and
CPU time waste due to IO wait is reduced.
• All Unix kernels are reentrant. This means that several processes may be
executing in Kernel Mode at the same time. Of course, on uniprocessor systems,
only one process can progress, but many can be blocked in Kernel Mode when
waiting for the CPU or the completion of some I/O operation.
• If a hardware interrupt occurs, a reentrant kernel is able to suspend the current
running process even if that process is in Kernel Mode. This capability is very
important, because it improves the throughput of the device controllers that
issue interrupts. 51