Docsity

Coordinating the Machine’s Activities-Computer Architecture and Programming-Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Coordinating the Machine’s Activities-Computer Architecture and Programming-Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Operating SystemsCoordinating the Machine’s Activities

Coordinating the Machine’sActivities^ ^ We now consider how an operatingsystem coordinates the execution of:^ ◦^ Application Software^ ◦^ Utility Software^ ◦^ Units within the operating system itself.^ ^ Parts^ ◦^ The concept of process^ ◦^ Process administration

The concept of process^ ^ The activity of executing a program underthe control of the operating system isknow as a

process

^ Associated with the process is thecurrent status of the activity called the^ process state

.^ This state includes

◦^ The current position in the program beingexecuted( the value of program counter). ◦^ As well as the value in the other CPUregisters and the associated memory cells.

The concept of process^ ^ Roughly speaking, the process state is asnapshot of the machine at a particulartime.^ ^ At different times during the execution ofa program different snapshots will beobserved.^ ^ Time sharing/multi-tasking computers arerunning many processes, all competing forthe computer’s resources.

Process Administration^ ^ The tasks associated with coordinatingthe execution of processes are handled bythe scheduler and the dispatcher withinthe operating system’s kernal.^ ^ The scheduler:^ ◦^ Maintains a record of the processes present inthe computer system^ ◦^ Introduces new processes to this pool.^ ◦^ Removes complete processes from the pool

Process Administration(Contd.)^ ^ Thus when a user requests the executionof an application, it is the

scheduler

that

adds the execution of that application tothe pool of current processes.  To keep track of all the processes, thescheduler maintains a block ofinformation in main memory called process table

Process Administration(Contd.)^ ^ The dispatcher is the component of the kernelthat overseas the execution of the schedulerprocesses.^ ^ In a time-sharing/multitasking system this task isaccomplished by

multi-programming ◦^ That is, dividing time into short segment, eachcalled a time slice. ◦^ Then switching the CPU’s attention among theprocesses as each is allowed to execute for onetime slice. ◦^ The procedure of changing from one process toanother is called a

process switch

.^

Time-sharing between process Aand process B

Process Administration(Contd.)^ ^ When CPU receives an interrupt signal it:^ o^ completes its current machine cycle,^ o^ Saves its position in the current process^ o^ Begins executing a program called

interrupt

handler  It is stored at a predetermined location in mainmemory.  It is a part of the dispatcher  It describes how the dispatcher should respond tothe interrupt signal.

Process Administration(Contd.)^ ^ Thus the effect of the interrupt signal isto preempt the current process andtransfer control back to the dispatcher.^ ^ At this point, dispatcher:^ ◦^ Selects the process from the process tablethat has the highest priority among the readyprocesses,^ ◦^ Restarts the timer circuit,^ ◦^ Allows the selected process to begin its timeslice^

Process Administration(Contd.)^ ^ The CPUs also tend to have machine-language instructions for reloading apreviously saved state.^ ^ Such features simplify the task of thedispatcher when preforming a processswitch and exemplify how the design ofmodern CPUs is influenced by the needsof today’s operating system.

Questions^ ^ Summarize the difference between aprogram and a process.^ ^ Summarize the steps performed by theCPU when an interrupt occurs.^ ^ In a multiprogramming system, how canhigh-priority processes be allowed to runfaster than others?