操作系統(tǒng)精髓與設(shè)計原理英文Chapter03_第1頁
操作系統(tǒng)精髓與設(shè)計原理英文Chapter03_第2頁
操作系統(tǒng)精髓與設(shè)計原理英文Chapter03_第3頁
操作系統(tǒng)精髓與設(shè)計原理英文Chapter03_第4頁
操作系統(tǒng)精髓與設(shè)計原理英文Chapter03_第5頁
已閱讀5頁,還剩62頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

Process

Description

and

ControlChapter

312Requirements

concerned

withProcesses

in

an

Operating

System

Interleave

the

execution

of

multipleprocesses

to

maximize

processorutilization

while

providing

reasonableresponse

timeAllocate

resources

to

processes

Support

interprocess

communication

anduser

creation

of

processes3Concepts

Computer

platform

consists

of

a

collectionhardware

resources

Computer

applications

are

developed

toperform

some

task

Inefficient

for

applications

to

be

writtendirectly

for

a

given

hardware

platform

Operating

system

provides

a

convenient

touse,

feature

rich,

secure,

and

consistentinterface

for

applications

to

use

OS

provides

a

uniform,

abstract

representatof

resources

that

can

be

requested

andaccessed

by

application4Manage

Execution

ofApplications

Resources

are

made

available

to

multiapplications

Processor

is

switched

among

multiptlapplication

The

processor

and

I/O

devices

can

beused

efficiently5ProcessA

program

in

execution

An

instance

of

a

program

running

on

acomputer

The

entity

that

can

be

assigned

to

andexecuted

on

a

processor

A

unit

of

activity

characterized

by

t

execution

of

a

sequence

of

instructio

a

current

state,

and

an

associated

set

system

instructions6Process

ElementsIdentifierStatePriorityProgram

counterMemory

pointersContext

dataI/O

status

informationAccounting

information7Process

Control

BlockContains

the

process

elements

Created

and

manage

by

the

operatingsystemAllows

support

for

multiple

processeProcess

Control

Block89Trace

of

Process

Sequence

of

instruction

that

executea

processDispatcherA

program

that

moves

the

processor

from

one

process

to

anotherswitches

the

processor

from

one

processanother

to

prevent

a

single

process

frommonopolizing

the

processor

timeTrace

of

Processes1011Example

Execution12Two-State

Process

ModelProcess

may

be

in

one

of

two

statesRunningNot-running13Not-Running

Process

in

aQueue14Process

Creation15Process

Termination16Process

Termination1718ProcessesNot-runningready

to

executeBlockedwaiting

for

I/O

Dispatcher

cannot

just

select

the

prothat

has

been

in

the

queue

the

longestbecause

it

may

be

blocked19A

Five-State

ModelRunningReadyBlockedNewExitFive-State

Process

Model20Process

States21Using

Two

Queues22Multiple

Blocked

Queues2324Suspended

Processes

Processor

is

faster

than

I/O

so

allprocesses

could

be

waiting

for

I/O

Swap

these

processes

to

disk

to

free

umore

memory

Blocked

state

becomes

suspend

statewhen

swapped

to

diskTwo

new

statesBlocked/SuspendReady/SuspendReasons

for

ProcessSuspension25One

Suspend

State26Two

Suspend

States27Processes

and

Resources2829Operating

System

ControlStructures

Information

about

the

current

statuseach

process

and

resource

Tables

are

constructed

for

each

entitoperating

system

managesmemory

tablesI/O

tablesfile

tablesprocess

tables3031Memory

TablesAllocation

of

main

memory

to

processe

Allocation

of

secondary

memory

toprocesses

Protection

attributes

for

access

to

smemory

regions

Information

needed

to

manage

virtualmemory32I/O

TablesI/O

device

is

available

or

assignedStatus

of

I/O

operation

Location

in

main

memory

being

used

asthe

source

or

destination

of

the

I/Otransfer33File

TablesExistence

of

filesLocation

on

secondary

memoryCurrent

StatusAttributes

Sometimes

this

information

ismaintained

by

a

file

management

syste34Process

TableWhere

process

is

locatedAttributes

in

the

process

control

bloProgramDataStackProcess

Image353637Process

Control

BlockProcess

identificationProcessor

State

InformationProcess

Control

Information38Process

Control

BlockProcess

identificationNumeric

identifiers

that

may

be

stored

withthe

process

control

block

includeIdentifier

of

this

processIdentifier

of

the

process

that

created

this

pr(parent

process)User

identifierOthers39Processor

State

InformationUser-visible

registersControl

and

status

registersStack

pointersProcess

Control

Block40Process

Control

BlockProcessor

State

InformationUser-Visible

RegistersA

user-visible

register

is

one

that

mayreferenced

by

means

of

the

machine

language

ththe

processor

executes

while

in

user

mode.Typically,

there

are

from

8to32

of

these

regialthough

some

RISC

implementations

have

over100.41Process

Control

BlockProcessor

State

InformationControl

and

Status

RegistersThese

are

a

variety

of

processor

registers

that

aemployed

to

control

the

operation

of

the

processor.

ThesincludeProgram

counter:

Contains

the

address

of

the

nextinstruction

to

be

fetched?Program

status

word

(PSW)Condition

codes:

Result

of

the

most

recent

arithmeticlogical

operation

(e.g.,

sign,

zero,

carry,

equal,

oveStatus

information:

Includes

interrupt

enabled/disaflags,

execution

modeExample:

the

EFLAGS

register

on

Pentium

machinesPentium

II

EFLAGS

Register424344Process

Control

BlockProcessor

State

InformationStack

PointersEach

process

has

one

or

more

last-in-firout

(LIFO)

system

stacks

associated

with

it.

Astack

is

used

to

store

parameters

and

callingaddresses

for

procedure

and

system

calls.

Thestack

pointer

points

to

the

top

of

the

stack.Process

Control

BlockProcess

Control

InformationScheduling

and

State

InformationThis

is

information

that

is

needed

by

the

operatingsystem

to

perform

its

scheduling

function.

Typical

items

oinformation:Process

state:

defines

the

readiness

of

the

processbe

scheduled

for

execution

(e.g.,

running,

ready,

waitinghalted).Priority:

One

or

more

fields

may

be

used

to

describethe

scheduling

priority

of

the

process.

In

some

systems,several

values

are

required

(e.g.,

default,

current,

highallowable)Scheduling-related

information:

This

will

dependthe

scheduling

algorithm

used.

Examples

are

the

amount

oftime

that

the

process

has

been

waiting

and

the

amount

oftime

that

the

process

executed

the

last

time

it

was

runningEvent:

Identity

of

event

the

process

is

awaitingbefore

it

can

be

resumed4546Process

Control

BlockProcess

Control

InformationData

StructuringA

process

may

be

linked

to

other

processa

queue,

ring,

or

some

other

structure.

Forexample,

all

processes

in

a

waiting

state

for

aparticular

priority

level

may

be

linked

in

a

quA

process

may

exhibit

a

parent-child

(creator-created)

relationship

with

another

process.

Tprocess

control

block

may

contain

pointers

toother

processes

to

support

these

structures.47Process

Control

BlockProcess

Control

InformationInterprocess

CommunicationVarious

flags,

signals,

and

messages

may

beassociated

with

communication

between

two

independentprocesses.

Some

or

all

of

this

information

may

bemaintained

in

the

process

control

block.Process

PrivilegesProcesses

are

granted

privileges

in

terms

of

thememory

that

may

be

accessed

and

the

types

of

instructionsthat

may

be

executed.

In

addition,

privileges

may

apply

tthe

use

of

system

utilities

and

services.48Process

Control

BlockProcess

Control

InformationMemory

ManagementThis

section

may

include

pointers

tosegment

and/or

page

tables

that

describe

thevirtual

memory

assigned

to

this

process.Resource

Ownership

and

UtilizationResources

controlled

by

the

process

maybe

indicated,

such

as

opened

files.

A

history

outilization

of

the

processor

or

other

resourcealso

be

included;

this

information

may

be

needby

the

scheduler.4950Typical

Functions

of

an

OperatinSystem

KernelProcess

ManagementMemory

ManagementI/O

ManagementSupport

Functions51Typical

Functions

of

an

OperatingSystem

KernelProcess

Management–Process

creation

and

termination–Process

scheduling

and

dispatching–Process

switching–Process

synchronization

and

support

for

inter-pcommunication–Management

of

process

control

blocks52Typical

Functions

of

an

OperatingSystem

KernelMemory

Management–Allocation

of

address

space

to

processes–Swapping–Page

and

segmentmanagementI/O

Management–Buffer

management–Allocation

of

I/O

channels

and

devices

to

proces53Typical

Functions

of

an

OperatinSystem

KernelSupport

Functions–Interrupt

handling–Accounting–Monitoring54Modes

of

ExecutionUser

modeLess-privileged

modeUser

programs

typically

execute

in

this

mode

System

mode,

control

mode,

or

kernelmodeMore-privileged

modeKernel

of

the

operating

system

User

mode

changes

to

system

modewhen

interrupt

or

system

trap

occurs55Process

CreationAssign

a

unique

process

identifierAllocate

space

for

the

processInitialize

process

control

blockSet

up

appropriate

linkagesEx:

add

new

process

to

linked

list

used

foscheduling

queueCreate

or

expand

other

data

structureEx:

maintain

an

accounting

file56When

to

Switch

a

ProcessClock

interruptprocess

has

executed

for

the

maximumallowable

time

sliceI/O

interruptMemory

faultmemory

address

is

in

virtual

memory

so

itmust

be

brought

into

main

memory57When

to

Switch

a

Process

Trap

(re-execute

the

same

instructiowhen

resuming)error

or

exception

occurredmay

cause

process

to

be

moved

to

Exit

statSupervisor

callsuch

as

file

open58Change

of

Process

State(Process

Switch)

Save

context

of

processor

including

programcounter

and

other

registers

Update

the

process

control

block

of

theprocess

that

is

currently

in

the

Running

statthat

is

it

may

go

into

ready,

blocked

orsuspended

state,

other

fields

like

the

reasoleaving

the

current

state

&

accountinginformation

may

also

be

updated

Move

process

control

block

to

appropriatequeue

ready;

blocked;

ready/suspendSelect

another

process

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論