Lecture 5
Lecture 5
UNIT-I
Lecture 5 :
Operating System Structures
Staff Incharge
Mr.R.Prabhu AP/CSE
OPERATING SYSTEM Structures
What Is In This Chapter?
• System Components
• System Calls
• How Components Fit Together
• Virtual Machine
2: OS Structures 2
SYSTEM COMPONENTS
These are the pieces of the system we’ll be looking at:
• Process Management
• Main Memory Management
• File Management
• I/O System Management
• Secondary Management
• Networking Protection System
• Command-Interpreter System
2: OS Structures 3
PROCESS MANAGEMENT
A process has resources (CPU time, files) and attributes that must be managed.
2: OS Structures 4
MAIN MEMORY MANAGEMENT
Allocation/de-allocation for processes, files, I/O.
Maintenance of several processes at a time
Keep track of who's using what memory
Movement of process memory to/from secondary storage.
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.
• Mapping files onto secondary storage.
• File backup on stable (nonvolatile) storage media.
2: OS Structures 5
I/O MANAGEMENT
Buffer caching system
Generic device driver code
Drivers for each device - translate read/write
commands.
Disk scheduling
2: OS Structures 6
NETWORKING
Communication system between distributed processors.
Getting information about files/processes/etc. on a remote machine.
Can use either a message passing or a shared memory model.
PROTECTION
Of files, memory, CPU, etc.
Means controlling of access
Depends on the attributes of the file and user
SYSTEM PROGRAMS
Command Interpreters -- Program that accepts control statements
(shell, GUI interface, etc.)
Compilers/linkers
Communications (ftp, telnet, etc.)
2: OS Structures 7
System Tailoring
Modifying the Operating System program for a particular machine. The goal is to includ
all the necessary pieces, but not too many extra ones.
Typically a System can support many possible devices, but any one installation ha
only a few of these possibilities.
Plug and play allows for detection of devices and automatic inclusion of the cod
(drivers) necessary to drive these devices.
2: OS Structures 8
System Calls
A System Call is the main way a user program interacts with the
Operating System.
Figure
3.1
Figure
2.8
2: OS Structures
9
HOW A SYSTEM CALL WORKS
2: OS Structures 10
Example of Windows API
11
Two ways of passing
data between programs.
Shared Memory
Msg Passing
2: OS Structures 12
These are examples
of various system
calls.
2: OS Structures 13
How An Operating System Is Put Together
A SIMPLE STRUCTURE:
Example of MS-DOS.
Application Programming
MS-DOS Drivers
2: OS Structures 14
How An Operating System Is Put Together
A LAYERED STRUCTURE:
Example of Windows 2000.
System Services
Windows Security
VM Proces
MGR Referenc
Manager s
& e
Manag IO
GDI Monitor
er Manager
Graphic
s Windows 2000 Kernel
Device
Drivers
2: OS Structures 15
How An Operating System Is Put Together
A LAYERED STRUCTURE:
Example of UNIX.
2: OS Structures 16
Virtual Machine
The resources of the physical machine are shared. Virtual devices are
sliced out of the physical ones. Virtual disks are subsets of physical ones.
Useful for running different OS simultaneously on the same machine.
Protection is excellent, but no sharing possible.
Virtual privileged instructions are trapped.
Virtual User
Physical User
Virtual Machine
2: OS Structures 17
Virtual Machine
2: OS Structures 18
Virtual Machine
DOS APPLICATION
Physical User
BIOS DRIVERS
2: OS Structures 19
Virtual Machine
2: OS Structures 20