1 / 74

Chapter 11 Operating Systems

Chapter 11 Operating Systems. Outline. Functional overview of an operating system Process management Resource allocation CPU allocation Memory allocation Interprocess communication. Operating System Overview. Operating System Management Functions Operating System Layers.

kellan
Download Presentation

Chapter 11 Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 11Operating Systems

  2. Outline • Functional overview of an operating system • Process management • Resource allocation • CPU allocation • Memory allocation • Interprocess communication

  3. Operating System Overview • Operating System Management Functions • Operating System Layers

  4. Operating System Overview • The operating system oversees all hardware resources and allocates them to user and applications as needed. • The operating system performs many low-level tasks on behalf of users and application programs.

  5. Operating System Overview Operating System Management Functions The operating system manages: • Hardware resources • Users and their programs

  6. Operating System Overview Operating System Layers • Command Layer • Service Layer • Kernel

  7. Operating System Layers

  8. Operating System Layers Operating System Layers • Command Layer – the user’s interface to the operating system. • Service Layer – contains a set of functions called by application programs and the command layer. • Kernel – manages resources and directly interacts with computer hardware.

  9. Outline • Functional overview of an operating system • Process management • Resource allocation • CPU allocation • Memory allocation • Interprocess communication

  10. Process Management Process Control Data Structures • A process is a unit of executing software that is managed independently by the operating system. • A process can request and receive hardware resources and operating system services.

  11. Process Management Process Control Data Structures • Process Control Block (PCB) – keeps track of each process by creating and updating a data structure. • The PCB is created when the process is created, updated when the process changes and deleted when the process terminates.

  12. Process Management Data included in a PCB: • A unique process identification number • The current state of the process • Events for which the process is waiting • Resources allocated exclusively to the process • Machine resources consumed • Process ownership and/or access privileges • Scheduling priority

  13. Process Management Threads • A portion of a process that can be scheduled and executed independently. • Process light • Thread can execute concurrently on a single processor or simultaneously on multiple processors.

  14. Outline • Functional overview of an operating system • Process management • Resource allocation • CPU allocation • Memory allocation • Interprocess communication

  15. Resource Allocation • Single Process Resource Allocation • Multiple Process Resource Allocation • Resource Allocation Processes • Real and Virtual Resources

  16. Resource Allocation Single Process Resource Allocation • Involves only two executing programs – application and operating system. • When an application program begins executing, the operating system grants it control of all unused resources.

  17. Resource Allocation Single Process Resource Allocation • Most service calls are actually indirect requests for system resources. • MS-DOS is a single-tasking operating system.

  18. Resource Allocation Multiple Process Resource Allocation • Multitasking operating systems are the norm for general-purpose computers. • Multitasking operating systems must be able to handle multiple programs and users.

  19. Resource Allocation Multiple Process Resource Allocation • A multitasking operating system manages hardware resources to achieve the following: • Meet the resource needs of processes • Prevent processes from interfering with one another • Efficiently use hardware and other resources

  20. Resource Allocation Resource Allocation Processes • Keeps detailed records of available resources. • Knows which resource are used to satisfy which requests. • Schedules resources based on specific allocation policies to meet present and anticipated demands. • Updates records to reflect resources commitment and release by processes and users.

  21. Resource Allocation Real and Virtual Resources • Real resource – a computer system’s physical devices and associated system software. • Virtual resource – the resources that are apparent to a process or user.

  22. Real and Virtual Resources Providing virtual resources that meet or exceed resources is accomplished by: • Rapidly shifting resources unused by one process to other processes that need them. • Substituting one type of resource for another when possible and necessary.

  23. CPU Allocation • Thread States • Interrupt Processing • Scheduling

  24. CPU Allocation • A thread controls the CPU for no more than a few milliseconds before it relinquishes control and the operating system gives another thread a turn. • CPU sharing is called concurrent execution or interleaved execution.

  25. CPU Allocation

  26. CPU Allocation Thread States • Ready • Running • Blocked

  27. CPU Allocation

  28. CPU Allocation Ready State – a thread is waiting for access to a CPU. Running State – the thread has control of the CPU. • The thread or its parent process terminates normally • An interrupt occurs Block State – the thread is suspended while an interrupt is being processed.

  29. CPU Allocation Interrupt Processing • A blocked thread is waiting for an event to occur. • If the event is the correction of an error and it can be corrected, the thread remains in the blocked state until the error condition is resolved; otherwise, the thread is halted.

  30. Scheduling • Preemptive Scheduling • Priority-based Scheduling • Real-time Scheduling

  31. Scheduling Preemptive Scheduling • A thread can be removed involuntarily from the running state. • A running process controls the CPU by controlling the content of the instruction pointer. • CPU control is lost whenever an interrupt is received.

  32. Scheduling

  33. Scheduling

  34. Scheduling Priority-Based Scheduling Methods: • First come First served • Explicit priority • Shortest time remaining

  35. Scheduling Priority-Based: First come first served: • The scheduler always dispatches the ready thread that has been waiting the longest.

  36. Scheduling Priority-Based: Explicit priority: • Uses a set of priority levels and assigns a level to each process or thread. • The scheduling method can use priority levels in two ways: • Always dispatch the highest priority ready thread • Assign larger time slices to high priority threads

  37. Scheduling Priority-Based: Shortest time remaining: • Chooses the next process to be dispatched based on the expected amount of CPU time needed to complete the process.

  38. Scheduling Real-Time Scheduling: • Guarantees a minimum amount of CPU time to a thread if the thread makes an explicit request when it is created. • Used when a thread must have enough resources to complete its function within a specified time.

  39. Technology Focus Windows 2000 Scheduling

  40. Technology Focus

  41. Memory Allocation • Single-Tasking Memory Allocation • Multitasking Memory Allocation • Memory Fragmentation • Noncontiguous Memory Allocation • Virtual Memory Management • Memory Protection • Memory Management Hardware

  42. Memory Allocation Single-Tasking Memory Allocation – Contiguous Memory Allocation • The bulk of the operating system occupies lower memory addresses. • The application program is loaded above the operating system. • The remaining space is available for user programs and data.

  43. Memory Allocation

  44. Memory Allocation Single-Tasking Memory Allocation – Noncontiguous Memory Allocation • To conserve physical memory, some operating system components are loaded into memory only when needed. • When loaded, they usually are placed in upper memory.

  45. Memory Allocation

  46. Memory Allocation Multitasking Memory Allocation The goals of multitasking memory allocation are: • Allow as many active processes as possible. • Respond quickly to changing memory demands of processes. • Prevent unauthorized changes to a process’s memory region(s). • Implement memory allocation and addressing as efficiently as possible.

  47. Memory Allocation

  48. Memory Allocation

  49. Memory Allocation

More Related