Unformatted text preview:

Description and ControlConcepts from chapters 1 & 2 Computer platform consists of a collection of hardware resources Computer applications are developed to perform some task Inefficient for applications to be written directly for a given hardware platform2Concepts from chapters 1 & 2 Operating system provides a convenient to use, feature rich, secure, and consistent interface for applications to use OS provides a uniform, abstract representation of resources that can be requested and accessed by application3Fundamental job of modern OS The fundamental task of any modern operating system is process management. It must: Allocate resources to processes Enable processes to share and exchange info Protect the resources of a process from other processes Enable synchronization among processes4Processes A process is a program in execution; process execution must progress in sequential fashion. Can be characterized by its trace. A process requires resources, which are managed by the operating system The OS interleaves the execution of several processes to maximize processor utilization  OS supports Inter-Process Communication (IPC) and user creation of processes5Example ExecutionMain MemoryAddressDispatcherProcess AProcess BProcess CProgram Counter010050008000800012000Figure 3.2 Snapshot of Example Execution (Figure 3.4)at Instruction Cycle 136Trace of Process Sequence of instruction that execute for a process Dispatcher switches the processor from one process to another789Time slice ~= 1/10thof a secondProcess state models The OS is responsible for interleaving the execution of the processes.  It is important to understand the possible behaviors of all the processes and how to react to them.  The behavior of processes is described by means of the process state model.10Two-State Process Model Process may be in one of two states Running Not-running11Queuing Diagram  Dispatcher Program that assigns the processor to one process or another Prevents a single process from monopolizing processor time12ProcessorEnterQueueDispatchExitPause(a) Queuing diagram5 Process States As a process executes, it changes state New: The process is being created. Running: Instructions are being executed. Waiting or blocked: The process is waiting for some event to occur. Ready: The process is waiting to be assigned to a process. Terminate or Exit: The process has finished execution.13Diagram of Process State14Process Creation Create a PCB:  Set PC, set registers, set state, set process id  Type “ps” at prompt to get a list of process ids. Allocate Address space in memory: Main memory is RAM Secondary memory is the hard disk, CD, and floppy  Update OS control structures:  e.g. Process table, memory tables, I/O tables 15Reason for Process Creation16Reasons for Process Termination17Reasons for Process Termination18Example for 3 Processes19Suspending Processes20Two Suspended States21OS Control Structures22MemoryI/OFileProcessesMemory TablesI/O TablesFile TablesProcess 1Process 2… Process NPrimary TableProcess ImageUser programUser dataSystem stackPCBProcess Control Block (PCB) Information associated with each process. Process ID Process state Program counter (PC) CPU registers (Context data) CPU scheduling information (Priority) Memory-management information (Memory pointer) Accounting information (Time, acct. #) I/O status information (requests, devices assigned)23Process Control Block Contains the process attributes Created and manage by the operating system Allows support for multiple processesProcess = Program code + Data + PCB24Process Control BlockIdentifierFigure 3.1 Simplified Process Control BlockStatePriorityProgram counterMemory pointersContext dataI/O statusinformationAccountinginformation25Process Scheduling Queues Job queue – set of all processes in the system. Ready queue – set of all processes residing in main memory, ready and waiting to execute. Device queues – set of processes waiting for an I/O device. Process migration between the various queues.26Ready Queue, I/O Device Queues27Process Scheduling28Schedulers Long-term scheduler: job scheduler selects which processes should be brought into the ready queue. invoked infrequently (seconds, minutes) controls the degree of multiprogramming Medium-term scheduler allocates memory for process. invoked periodically or as needed. Short-term scheduler: CPU scheduler selects which process should be executed next and allocates CPU. invoked frequently


View Full Document

Rose-Hulman CSSE 332 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?