Operating System Recap of previous lecture
• Objectives of this course
• Overview Course Outline
Course Code: CS-205 • What an operating system Do?
• Computer-System Organization
Lecture # 2 • Computer-System Architecture
Syed Hasnain Haider • Computer-System Structure
Department of Computer Science
University of Gujrat
1 2
Scope of Lecture Operating System Operations
• Operating System Operations • Modern operating systems are interrupt driven.
• If there are no processes to execute,
• Process Management • No I/O devices to service
• Memory Management • No users to whom to respond
• An operating system will sit quietly, waiting for something to happen.
• Input/Output Management
• Storage Management Summary
• File system management
• Command Line Interpreter
• Accounting
3 4
Operating System Operations Operating System Operations
• Dual-Mode Operation • Timer
o User mode o Generate interrupt after a specified period
o Kernel mode o When timer interrupts control transfer
o Timer prevent user program from running too long
5 6
Operating System Operations Operating System Operations
• Process Management • Memory Management
o Create a process o Program always execute from RAM
o Delete a process o Contention will start for allocation
o Suspend a process o How to manage RAM sizes for concurrent process
o Resume a process o Allocation memory to processes
o Clone a process o Reallocate memory
memor to processes
o Inter-process communication o Process asking the OS for allocation (Explicit allocation)
o Inter-process synchronization
o Create / delete a child process
7 8
Operating System Operations Operating System Operations
• Input/Out Management Storage Management
o A Big Chunk Of OS Kernel deals with I/O
o Millions of Lines in windows XP (including drivers) Secondary storage (disk, tape) is persistent memory
o The OS provides standard interface between programs and devices o Often magnetic media survives power failures (hopefully)
o Device drivers are the routines that interact with specific device types:
o Encaps lates de
Encapsulates device
ice specific kno
knowledge
ledge Routines that interact with disks are typically at a very low level in the OS
o E.g. how to initialize a device, how to request the I/O, Used by many components
o how to handle interrupts and errors o Handle scheduling of disk operations, head movement,
o E.g. SCSI device drivers, Ethernet card drivers, o Error handling and often management of space on disk
o video card drivers, sound card drivers.
o Note: windows has ~35000 device drivers.
9 10
Operating System Operations Operating System Operations
File System File System Operations
o Secondary storage device are crude and awkward • The file system interface defines standard operations
o E.g. write 4096 byte block to a sector
o File (or directory) creation and deletion
o Manipulating of files and directories
o File system are convenient abstraction
o Copy
o Lock
o A file is a basic long term storage unit
• File system also provide higher level services
o A directory is just a special kind of file o Accounting and quotes
o Backup
o Indexing or search
o File versioning
11 12
Operating System Operations Operating System Operations
Command Line Interpreter
Accounting
A particular program that handles the interpretation of users
o commands and helps to manage processes
o Keeps track of resource usage
On some systems, command interpreter may
o be a standard part of the OS
o Both to enforce quotas “you’re
you re over the disk limit”
limit Or
to produce bills
On others, its just not privileged code that
o provides an interface to the user
o Important for time shared computers like mainframes
13 14
What we did?
• Operating System Operations
• Process Management
• Memory Management
•
•
Input/Output Management
Storage Management Summary
Thanks
• File system management
• Command Line Interpreter
• Accounting
15 16