110 likes | 250 Vues
This chapter delves into the essential functions of an Operating System (OS), including resource management, program scheduling, and memory management. It presents different types of OS, such as interactive and batch systems, and explains key concepts like multiprogramming and uniprogramming. The various scheduling types—long-term, medium-term, short-term, and I/O scheduling—are examined in detail. It also covers the five-state model of processes and the significance of the Process Control Block. Additionally, memory management techniques like swapping, partitioning, and paging, as well as the concept of virtual memory, are discussed extensively.
E N D
Chapter 8: Operating System Support CS 147 Fall 2010 Lester Tam
What is an OS (Operating System)? • Program that manages the computer’s resources • Provides services for programmers • Schedules the execution of other programs
Types of OS • Interactive or batch? • Interactive: Direct communication • Batch: Queued programs • Multiprogramming or uniprogramming? • Multiprogramming: Keep the OS as busy as possible • Uniprogramming: One at a time
Scheduling • Four types of scheduling • Long-term scheduling • Medium-term scheduling • Short-term scheduling • I/O scheduling
Five State Model Process • Used by the short-term scheduler • New • Ready • Running • Waiting • Halted
Process Control Block • Information kept by OS on every process • Identifier • State • Priority • Program counter • Memory pointers • Context data • I/O status information • Accounting information
Memory Management • Swapping • Processes are swapped into Intermediate queue • Partitioning • Fixed-sized partitions • Variable-size partitions
Compaction • Even with dynamic partitioning, memory will become fragmented • The OS will need to “defrag” the memory occasionally • Time consuming • Process may shift in main memory
Paging • Suppose memory is divided into small equal fixed-size chunks (frames) • Same for processes (pages) • Wasted space in memory a fraction of variable partitioning
Virtual Memory • Demand paging – brought in when needed (on demand) • At any time, only a few pages are loaded • Time saved by not having to swap • However, can lead to thrashing • Lead to development of complex algorithms to try to prevent it.