The pool consists of all processes residing on disk

This preview shows page 22 - 27 out of 38 pages.

" The pool consists of all processes residing on disk awaiting allocation of main memory. ! Job scheduling (chapter 5) selects jobs from the pool and loads them into memory for execution. ! If several jobs ready to run at the same time CPU scheduling (chapter 5) chooses among them. 44 Operating System Structure (cont’d) ! If processes don’t fit in memory, swapping moves them in and out to run (chapter 8). " Swap to a backing store (e.g., hard disks). " For example a higher-priority process arrives and wants service, the memory manager can swap out the lower-priority process and then load and execute the higher-priority process.
Image of page 22

Subscribe to view the full document.

Introduction to OS 23 45 Operating System Structure (cont’d) ! Virtual memory allows execution of processes not completely in memory (chapter 9). 46 Operating-System Operations ! Modern operating systems are event driven . " Waiting for something (event) to happen. ! Events are signaled by the occurrence of an interrupt or a trap (software interrupt) . " Interrupt driven by hardware . " Software error or request creates trap . # E.g., division by zero, request for operating system service. ! The operation structure of interrupt (event) driven operating system: " For each interrupt, separate segments of code in the operating system determine what action should be taken. " An interrupt service routine (IRS) is provided that is responsible for dealing with the interrupt.
Image of page 23
Introduction to OS 24 47 Operating-System Operations (cont’d) ! Since there are multiple running processes, we (operating system) need to make sure that an error in a program can not affect other programs. " Infinite loop in one process could prevent the correct operation of many other processes. " One erroneous (malicious) program might modify another program/data/OS. " Protection and security are very important!! 48 Dual-Mode Operation ! To ensure the proper execution of the operating system, we must be able to distinguish between the execution of operating-system code and user-defined code . " Computation resources can only be managed by operating- system code. " User-defined code can not cross the line. " Supported by hardware mechanism. ! Dual-mode: user mode and kernel mode . " Mode bit provided by hardware, kernel (0) or user (1). # Recent versions of the Intel CPU do provide dual-mode. " When a user application requests a service from operating system, it must transition from user to kernel mode to fulfill the request. " Request only through system call .
Image of page 24

Subscribe to view the full document.

Introduction to OS 25 49 Dual-Mode Operation (cont’d) Require a service from the operating system The operating system gains control of the computer Passing control to user program 50 Dual-Mode Operation (cont’d) ! The dual mode protects the operating system from errant users. " We designate some machine instructions that may cause harm as privileged instructions , and only executable in kernel mode. # I/O control, interrupt management are examples of privileged instruction. " Generally, control is switched to the operating system via an interrupt, a trap, or a system call.
Image of page 25
Introduction to OS 26 51 Dual-Mode Operation (cont’d) !
Image of page 26

Subscribe to view the full document.

Image of page 27
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung
  • OS, main memory

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern