380 likes | 543 Views
Text Book:1. Operating System Concepts - GalvinReferences:1. OS Book - William Stallings2. Operating Systems - Crowley3. UNIX Network Programming - Stevans. Content. Process Management1. Process 2. Threads 3. Scheduling 4. Synchronization 5. DeadlocksMemory Management1. Overview 2. Virtua
E N D
1. Operating Systems Biswas
Architecture
2. Text Book:
1. Operating System Concepts - Galvin
References:
1. OS Book - William Stallings
2. Operating Systems - Crowley
3. UNIX Network Programming - Stevans
3. Content Process Management
1. Process 2. Threads 3. Scheduling 4. Synchronization 5. Deadlocks
Memory Management
1. Overview 2. Virtual Memory
Storage Management
1. File System Interface 2. File System Implementation
I/O systems
1. I/O Systems 2. Mass-storage Structure
Protection and Security
1. Protection 2. Security
4. Introduction What is an operating system?
“Code” that:
sits between programs & hardware
sits between different programs
sits between different users
What does it do?
Provides an orderly and controlled allocation of the processors, memories and I/O devices among the various programs competing for them.
5. Introduction An operating system makes computers simple.
Resources:
Allocation: finite resources and competing demands
Protection: ensures some degree of safety and security
Reclamation: voluntary at run time, implied at termination, involuntary and cooperative
Virtualization: illusion of infinite, private resources
Services:
Abstraction 3. Convenience
2. Simplification 4. Standardization
6. Components of a Computer System
7. History of Operating Systems First generation 1945 – 1955
vacuum tubes, plug boards (no OS)
Second generation 1955 – 1965
transistors, batch systems
Third generation 1965 – 1980
ICs and multiprogramming
Fourth generation 1980 – present
personal computers, hand-held devices, sensors
8. History of Operating Systems
9. Computer Startup bootstrap program is loaded at power-up
Typically stored in ROM or EPROM, generally known as firmware
Initializes all aspects of system
Loads operating system kernel and starts execution
10. Computer Startup
11. Operating System Architectures Today’s operating systems tend to be complex
Provide many services
Support variety of hardware and software
Operating system architectures help manage this complexity
Organize operating system components
Specify privilege with which each component executes
12. Monolithic Architecture
13. Monolithic Architecture Monolithic operating system
Every component contained in kernel
Any component can directly communicate with any other
Tend to be highly efficient
Disadvantage is difficulty determining source of subtle errors
14. Monolithic Architecture Examples:
Linux
UNIX (BSD, Solaris)
MS-DOS
MAC-OS till 8.6
15. Layered Architecture
16. Layered Architecture Layered approach to operating systems
Tries to improve on monolithic kernel designs
Groups components that perform similar functions into layers
Each layer communicates only with layers immediately above and below it
Processes’ requests might pass through many layers before completion
System throughput can be less than monolithic kernels
Additional methods must be invoked to pass data and control
17. Microkernel Architecture
18. Microkernel Architecture Microkernel operating system architecture
Provides only small number of services
Attempt to keep kernel small and scalable
High degree of modularity
Extensible, portable and scalable
Increased level of intermodule communication
Can degrade system performance
19. Microkernel Architecture Examples:
MACH
NT
EROS
MINIX
20. Computer System Organization Computer-system operation
One or more CPUs, device controllers connect through common bus providing access to shared memory
Concurrent execution of CPUs and devices competing for memory cycles
21. 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.
22. Interrupts Suspends the normal sequence of execution
23. Simple Interrupt Processing
24. Multiple Interrupts
25. Multiple Interrupts
30. Direct Memory Access (DMA) DMA improves data transfer between memory and I/O devices
Devices and controllers transfer data to and from main memory directly
Processor is free to execute software instructions
DMA channel uses an I/O controller to manage data transfer
Notifies processor when I/O operation is complete
Improves performance in systems that perform large numbers of I/O operations (e.g., mainframes and servers)
31. Direct Memory Access (DMA)
32. Memory-Storage Hierarchy
33. Operating System Structure Multiprogramming needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times
Multiprogramming organizes jobs (code and data) so CPU always has one to execute
A subset of total jobs in system is kept in memory
One job selected and run via job scheduling
When it has to wait (for I/O for example), OS switches to another job
34. Operating System Structure Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing
Response time should be < 1 second
Each user has at least one program executing in memory ?process
If several jobs ready to run at the same time ? CPU scheduling
If processes don’t fit in memory, swapping moves them in and out to run
Virtual memory allows execution of processes not completely in memory
35. Operating System Structure Real-time systems rigid time requirements are placed, often used as a control device for a dedicated application.
Two flavors:
Hard real-time system: guarantees task to be completed in time. No virtual memory. Hence time sharing is not possible.
Soft real-time system: critical real-time task gets priority over other tasks, delays are bounded.
36. Operating-System Operations Dual-mode operation allows OS to protect itself and other system components
User mode and kernel mode
Mode bit provided by hardware
provides ability to distinguish when system is running user code or kernel code
some instructions designated as privileged, only executable in kernel mode
system call changes mode to kernel, return from call resets it to user
37. Transition from User to Kernel Mode Timer to prevent infinite loop / process hogging resources
Set interrupt after specific period
Operating system decrements counter
When counter zero generate an interrupt
Set up before scheduling process to regain control or terminate program that exceeds allotted time
38. End of Session 2