1 / 52

Operating Systems

Operating Systems. Instructors David Browning Maggie Kirlakovsky Vishal Shah. Outline. Introduction Computer System Components Operating System Definition Process Management Process Concept Process Scheduling Memory Management Background Swapping, Paging, and Segmentation

satya
Télécharger la présentation

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. Operating Systems Instructors David Browning Maggie Kirlakovsky Vishal Shah

  2. Outline • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

  3. Outline • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

  4. What is an operating system? • Computer Hardware – basic computing resources (i.e.,CPU, memory, I/O devices) • Operating system – controls and coordinates the use of the hardware resources • Applications programs – controls how the system resources are used (i.e. compilers, video games) • Users (people, machines, other computers) Operating Systems

  5. Operating System Services Program Execution File-system Manipulation I/O Operations Services Communications Error Detection Operating Systems

  6. Outline Process Memory I/O • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

  7. Process Concept Process Memory I/O • Process Definition • Running program • Process state • new • running • waiting • ready • terminated Operating Systems

  8. Process Concept Process Memory I/O The Process Control Block (PCB) • Process state • Program counter • CPU registers • CPU scheduling information • Memory-management information • I/O status information Operating Systems

  9. Process Concept Process Memory I/O CPU switch from process to process • Process (Context) Switch Operating Systems

  10. Process Scheduling Process Memory I/O • Scheduler: Processes execution decisions • Preemptive and Nonpreemptive Scheduling • Scheduling criterion • Fairness • Efficiency • Response time • Turnaround • Throughput Operating Systems

  11. FIFO Scheduling P1 P2 P3 0 24 27 30 Process Memory I/O ProcessBurst (Completion) Time P1 24 P2 3 P3 3 • Suppose that the processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is: • Waiting time for P1 = 0; P2 = 24; P3 = 27 • Average waiting time: (0 + 24 + 27)/3 = 17 Operating Systems

  12. FIFO Scheduling P2 P3 P1 0 3 6 30 Process Memory I/O Suppose that the processes arrive in the order P2 , P3 , P1 . • The Gantt chart for the schedule is: • Waiting time for P1 = ?;P2 = ?; P3 = ? • Average waiting time: ? Operating Systems

  13. Priority Scheduling Queue headers Runnable Processes Highest Priority Priority 4 Priority 3 Priority 2 Lowest Priority Priority 1 Process Memory I/O • A priority number (integer) is associated with each process • The CPU is allocated to the process with the highest priority (smallest integer  highest priority). • Problem  Starvation • Solution  Aging Operating Systems

  14. Round Robin Scheduling Current Process Next Process Current Process B F D G A F D G A B Process Memory I/O • Each process gets a small unit of CPU time – time quantum • At the end of time quantum: • process is preempted • added to the end of the ready queue. • Example Operating Systems

  15. Multilevel Feedback Scheduling Process Memory I/O • A process can move between the various queues • Scheduler parameters: • number of queues • scheduling algorithms for each queue • method used to determine when to upgrade/demote a process • method used to determine which queue a process will enter when that process needs service Operating Systems

  16. Outline Process Memory I/O • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

  17. Background Process Memory I/O • Program must be brought into memory and placed within a process for it to be run. • Input queue – collection of processes on the disk that are waiting to be brought into memory to run the program. • User programs go through several steps before being run. Operating Systems

  18. Main Memory Process Memory I/O • Operating system responsibilities • Keep track of which parts of memory are currently being used and by whom. • Decide which processes to load when memory space becomes available. • Allocate and deallocate memory space as needed. Operating Systems

  19. Instruction and Data Binding Process Memory I/O • Central idea of memory management • Concept: logical address bound to separate physical address • Three possible stages • Compile time • Load time • Execution time Operating Systems

  20. Memory Management Unit (MMU) Process Memory I/O • Hardware device that maps virtual addresses to physical addresses • Implemented with relocation register • User programs deal with logical addresses only; they never see the real physical address Operating Systems

  21. Swapping Process Memory I/O • Temporary process shifting • “old” processes out • “new” processes in • Backing store • Fast disk • Large enough to accommodate copies of all memory images for all users • Provides direct access to these images Operating Systems

  22. Contiguous Allocation Process Memory I/O • Two partitions of main memory • Resident operating system in low memory • User processes in high memory • Single-partition • Relocation register • Protect user processes from each other • Protect operating system code and data • Limit register • Contains range of logical addresses • Multiple partition • Multiple blocks of available memory, or holes • Incoming processes allocated memory from hole large enough to accommodate them Operating Systems

  23. Single Partition Hardware Process Memory I/O Operating Systems

  24. Contiguous Allocation (cont.) Process Memory I/O • Operating system responsibility • Maintain partition information • Allocated partitions • Free partitions (holes) • Allocation Algorithms • First-fit • Best-Fit • Worst-Fit Operating Systems

  25. Allocation Example Process Memory I/O OS OS OS OS process 5 process 5 process 5 process 5 process 9 process 9 process 8 process 10 process 2 process 2 process 2 process 2 Operating Systems

  26. Paging and Address Translation Process Memory I/O Paging and Address Translation with TLB Paging and Address Translation Operating Systems

  27. Page Faults and Replacement Process Memory I/O Page Replacement Process Page Fault Handling Operating Systems

  28. Page Replacement Algorithms Process Memory I/O • First-In First-Out (FIFO) Algorithm • Optimal Algorithm • Least Recently Used (LRU) Algorithm • Second Chance (Clock) Algorithm Operating Systems

  29. Example: FIFO Algorithm Process Memory I/O 6! • 3 Frame Memory • 3 pages can be in memory at a time per process • Reference String: 7,0,1,2,0,3,0 • How many page faults? Operating Systems

  30. Thrashing Process Memory I/O • Thrashing  a process is busy swapping pages in and out. Operating Systems

  31. Segmentation Process Memory I/O • Memory-management scheme that supports user view of memory • Programs can be broken into logical segments, as follows: • Main program • Procedure • Method • Objects • Variables • Stack • Array • Etc. Operating Systems

  32. Segmentation Architecture Process Memory I/O • Logical address two tuple • <segment #, offset> • Segment table • Maps two-dimensional physical addresses • Base  starting physical address in memory • Limit  specifies length of segment Operating Systems

  33. Segmentation Example Process Memory I/O Operating Systems

  34. Outline Process Memory I/O • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

  35. What Is I/O? Process Memory I/O I/O is one of the main functions of an OS • Issues commands • Catches interrupts • Handles errors • Interface Operating Systems

  36. I/O Hardware Process Memory I/O • ECEs -> chips, wires, power supply … • CS -> commands that HW accepts, the functions it carries out, and errors reported • Two parts • Devices • Device controller • Communicates with OS • A model for connecting the CPU, memory, controllers and I/O devices Operating Systems

  37. Life Cycle of An I/O Request Process Memory I/O Operating Systems

  38. Outline Process Memory I/O • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplex Operating System Demo Operating Systems

  39. Windows 2000 Windows Linux • 32-bit multitasking OS for Intel microprocessors • System goals • Portability • Security • POSIX compliance (IEEE 1003.3 standard) • Multiprocessor support • Extensibility • Compatibility with MS-DOS and ms-windows applications Operating Systems

  40. Windows 2000 Architecture Windows Linux Operating Systems

  41. Virtual Memory Manager Windows Linux • Page-base management scheme • Two step process to allocate memory • Reserves a portion of the processor’s address space • Commits the allocation by assigning space in the 2000 paging file • Automatically reclaims allocated memory when a process terminates Operating Systems

  42. Virtual Memory Layout Windows Linux Operating Systems

  43. I/O Manager Windows Linux • Responsible for • file systems • cache management • device drivers • network drivers • Works with VM Manager to provide memory-mapped file I/O • Controls the 2000 cache manager • Synchronous and asynchronous operations Operating Systems

  44. Linux Basics Windows Linux • Main design goals are speed, efficiency, and standardization • Compliant with POSIX documents Operating Systems

  45. Process Management Windows Linux • Process control block • Process properties fall into three groups • Identity • Environment • Context • Scheduling • Virtual memory Operating Systems

  46. Scheduling Windows Linux • Running and interrupting of processes • Linux adds kernel tasks • Requested by a running process • Execute internally on behalf of a device driver. Operating Systems

  47. Process Scheduling Windows Linux • FIFO and Round-robin real-time scheduling • Runs the process with the highest priority • Continue to run until they either exit or block Operating Systems

  48. Memory Management Windows Linux Buddy-Heap Algorithm Operating Systems

  49. Input/Output Windows Linux • Two caches disk access • Page cache • Buffer cache • Three device classes • Block • Character • Network Operating Systems

  50. Outline Simplix • Introduction • Computer System Components • Operating System Definition • Process Management • Process Concept • Process Scheduling • Memory Management • Background • Swapping, Paging, and Segmentation • Virtual Memory • I/O Management • I/O Hardware • Transformation of requests to hardware • Case Studies • Simplix Operating System Demo Operating Systems

More Related