Professional Documents
Culture Documents
SUSHMA RAWAL
SUSHMA RAWAL
Users
People, machines
Operating system
Controls and coordinates use of hardware among
various applications and users
SUSHMA RAWAL
Operating System
Operating System
is a program that manages the computer
hardware.
Provides basis for application programs
acts as an intermediary between the user
and computer hardware.
SUSHMA RAWAL
Operating System
Goals of OS
Efficient use of computer system when
shared by many users.
User convenience - PC.
SUSHMA RAWAL
Operating System
Operating System controls the execution of
application programs and coordinates the
use of the hardware among various
application programs for various users.
SUSHMA RAWAL
Operating System
OS can be viewed as
Resource Allocator- Manages all resources
i.e CPU time, memory space, file-storage space,
I/O devices etc.
- Decides between conflicting requests for
efficient and fair resource use
Control program- Manages execution of
programs to prevent errors. It is concerned with
operation and control of I/O devices
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
10
Computer Startup
bootstrap program is loaded at power-up
or reboot
Typically stored in ROM or EEPROM,
generally known as firmware
Initializes all aspects of system from CPU
registers to device controllers
Loads operating system kernel
SUSHMA RAWAL
11
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
SUSHMA RAWAL
12
13
SUSHMA RAWAL
14
Structure of an OS
Kernel
Non kernel programs
User interface
SUSHMA RAWAL
15
Structure of an OS
Kernel
- core of the OS
- controls the operation of the computer
- provides a set of functions and services to
use the CPU and resources of the computer.
SUSHMA RAWAL
16
Structure of an OS
Non-kernel programs
- implement user commands
- they use the facilities provided by kernel
programs to interact with the hardware.
SUSHMA RAWAL
17
Structure of an OS
Programs in the user interface
- provide a command line interface or GUI
to the user.
- these programs use the facilities of the
non-kernel programs.
- user interacts with the programs in the
user interface to request use of resources
and services provided by the system
SUSHMA RAWAL
18
Operating-System Structures
System Components
Operating System Services
System Calls
System Programs
System Structure
SUSHMA RAWAL
19
System Components
Process Management
Main Memory Management
File Management
I/O System Management
Secondary Memory Management
Networking
Protection System
Command-Interpreter System
SUSHMA RAWAL
20
Process Management
A process is a program in execution.
A process needs certain resources: CPU time,
memory, files, and I/O devices, to accomplish its
task.
The operating system is responsible for the
following activities in connection with process
management.
Process creation and deletion.
Process suspension and resumption.
Provision of mechanisms for:
process synchronization
process communication
SUSHMA RAWAL
21
Main-Memory Management
Memory is a large array of bytes, each with its own
address.
Main memory is a repository of quickly accessible data
shared by the CPU and I/O devices.
Main memory is a volatile storage device. It loses its
contents in the case of system failure.
The operating system is responsible for the following
activities in connections with memory management:
Keep track of which parts of memory are currently being used and
by whom.
Decide which processes to load when memory space becomes
available.
Allocate and deallocate memory space as needed.
SUSHMA RAWAL
22
File Management
A file is a collection of related information defined
by its creator. Commonly, files represent
programs (both source and object forms) and data.
The operating system is responsible for the
following activities in connections with file
management:
File creation and deletion.
Directory creation and deletion.
Support of primitives for manipulating files and
directories.
- File backup on stable (nonvolatile) storage media.
SUSHMA RAWAL
23
SUSHMA RAWAL
24
Secondary-Storage Management
Since main memory (primary storage) is volatile
and too small to accommodate all data and
programs permanently, the computer system must
provide secondary storage to back up main
memory.
Most modern computer systems use disks as the
principle storage medium, for both programs and
data.
The operating system is responsible for the
following activities in connection with disk
management:
Free space management
Storage allocation
SUSHMA RAWAL
25
SUSHMA RAWAL
26
27
Protection System
Protection refers to a mechanism for
controlling access of programs, processes,
or users to resources.
The protection mechanism must:
distinguish between authorized and
unauthorized usage.
specify the controls to be imposed.
provide a means of enforcement.
SUSHMA RAWAL
28
Command-Interpreter System
An important systems programs for OS is
command interpreter.
It is an interface between user and the OS.
Many commands are given to the operating
system by control statements which deal with:
29
SUSHMA RAWAL
30
31
SUSHMA RAWAL
32
33
System Calls
System calls provide an interface to the
services made available by 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++)
SUSHMA RAWAL
34
System Calls
Parameters need to be passed for some of the
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 operating system.
SUSHMA RAWAL
35
SUSHMA RAWAL
36
Process control
File management
Device management
Information maintenance
Communications
SUSHMA RAWAL
37
SUSHMA RAWAL
38
SUSHMA RAWAL
39
SUSHMA RAWAL
40
SUSHMA RAWAL
41
SUSHMA RAWAL
42
System Programs
System programs/system utilities provide a
convenient environment for program development
and execution.
They can be divided into:
File manipulation
Status information
File modification
Programming language support
Program loading and execution
Communications
43
SUSHMA RAWAL
44
SUSHMA RAWAL
45
SUSHMA RAWAL
46
Layered Approach
The operating system is divided into a number of
layers (levels), each built on top of lower layers.
The bottom layer (layer 0), is the hardware; the
highest (layer N) is the user interface.
With modularity, layers are selected such that each
uses functions (operations) and services of only
lower-level layers.
SUSHMA RAWAL
47
SUSHMA RAWAL
48
SUSHMA RAWAL
49
SUSHMA RAWAL
50
Monolithic Kernel
All kernel services run in the kernel space
All kernel modules run within the same memory space
under a single kernel thread
The tight internal integration of kernel modules in
monolithic kernel architecture allows the effective
utilization of the low-level features of the underlying
system
The major drawback of monolithic kernel is that any error
or failure in any one of the kernel modules leads to the
crashing of the entire kernel application
LINUX, SOLARIS, MS-DOS kernels are examples of
monolithic kernel
SUSHMA RAWAL
51
Monolithic Kernel
Applications
SUSHMA RAWAL
52
Microkernel
The microkernel design incorporates only the essential set
of Operating System services into the kernel
Rest of the Operating System services are implemented in
programs known as Servers which runs in user space
All servers are kept separate and run in different address
spaces
The kernel design is highly modular and provides OSneutral abstraction
Memory management, process management, timer systems
and interrupt handlers are examples of essential services,
which forms the part of the microkernel
SUSHMA RAWAL
53
Microkernel
The communication in microkernels is done via message
passing.
The servers communicate through IPC (Interprocess
Communication).
Servers invoke "services" from each other by sending
messages.
Mach, QNX, Minix 3, windows NT kernels are examples
for microkernel
SUSHMA RAWAL
54
Microkernel
Servers (kernel
services running
in user space)
Applications
55
Microkernel
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
SUSHMA RAWAL
56