Top Banner
Chapter 3 Operating Systems
32

Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

Chapter 3

Operating Systems

2

Chapter 3 Operating Systems 31 The Evolution of Operating

Systems 32 Operating System Architecture 33 Coordinating the Machinersquos

Activities 34 Handling Competition Among

Processes 35 Security

3

Some functions of an operating system Control and Oversee operation of

computer Store and retrieve files Schedule programs for execution Execute programsExMicrosoft Linux(By Linus Torvalds)Open

sourcce

4

Evolution of shared computing Single-Processor Systems1048708 Program execution of earlier computers requires significant

preparation of equipments1048708 Mounting placing the punched cards setting the switches

and so on1048708 Each program execution is referred to as a job an isolated

activity1048708 The next user only gains the full control of the computer after

the completion of the current user [sequentially]1048708 Batching processing executes a batch of collected

jobs pending in the job queue(first-in first-out) (FIFO) without further interaction with users

5

Evolution of shared computing Single-Processor Systems1048708 Interactive processing carries on a dialogue with the user1048708 --It involves real-time processing for the machine to interact with its

environment1048708 --Reservation systems word processing computer games1048708 To serve more than one user or job at a time time-sharing technique

divides time into time intervals or time slices each designated to one task1048708

--Time-sharing used in single-user systems is usually called multitasking1048708 --Tradeoffs1048708 The overhead to rapidly shuffle the jobs to gain the illusion of

concurrent execution of several jobs1048708 The time wasted to await the completion of peripheral devices or userrsquos

inputs1048708 Multiprocessor Systems With networks like the Internet many small

machines can flexibly collaborate for computing in contrast to an expensive large central machine [Grid Computing]

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 2: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

2

Chapter 3 Operating Systems 31 The Evolution of Operating

Systems 32 Operating System Architecture 33 Coordinating the Machinersquos

Activities 34 Handling Competition Among

Processes 35 Security

3

Some functions of an operating system Control and Oversee operation of

computer Store and retrieve files Schedule programs for execution Execute programsExMicrosoft Linux(By Linus Torvalds)Open

sourcce

4

Evolution of shared computing Single-Processor Systems1048708 Program execution of earlier computers requires significant

preparation of equipments1048708 Mounting placing the punched cards setting the switches

and so on1048708 Each program execution is referred to as a job an isolated

activity1048708 The next user only gains the full control of the computer after

the completion of the current user [sequentially]1048708 Batching processing executes a batch of collected

jobs pending in the job queue(first-in first-out) (FIFO) without further interaction with users

5

Evolution of shared computing Single-Processor Systems1048708 Interactive processing carries on a dialogue with the user1048708 --It involves real-time processing for the machine to interact with its

environment1048708 --Reservation systems word processing computer games1048708 To serve more than one user or job at a time time-sharing technique

divides time into time intervals or time slices each designated to one task1048708

--Time-sharing used in single-user systems is usually called multitasking1048708 --Tradeoffs1048708 The overhead to rapidly shuffle the jobs to gain the illusion of

concurrent execution of several jobs1048708 The time wasted to await the completion of peripheral devices or userrsquos

inputs1048708 Multiprocessor Systems With networks like the Internet many small

machines can flexibly collaborate for computing in contrast to an expensive large central machine [Grid Computing]

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 3: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

3

Some functions of an operating system Control and Oversee operation of

computer Store and retrieve files Schedule programs for execution Execute programsExMicrosoft Linux(By Linus Torvalds)Open

sourcce

4

Evolution of shared computing Single-Processor Systems1048708 Program execution of earlier computers requires significant

preparation of equipments1048708 Mounting placing the punched cards setting the switches

and so on1048708 Each program execution is referred to as a job an isolated

activity1048708 The next user only gains the full control of the computer after

the completion of the current user [sequentially]1048708 Batching processing executes a batch of collected

jobs pending in the job queue(first-in first-out) (FIFO) without further interaction with users

5

Evolution of shared computing Single-Processor Systems1048708 Interactive processing carries on a dialogue with the user1048708 --It involves real-time processing for the machine to interact with its

environment1048708 --Reservation systems word processing computer games1048708 To serve more than one user or job at a time time-sharing technique

divides time into time intervals or time slices each designated to one task1048708

--Time-sharing used in single-user systems is usually called multitasking1048708 --Tradeoffs1048708 The overhead to rapidly shuffle the jobs to gain the illusion of

concurrent execution of several jobs1048708 The time wasted to await the completion of peripheral devices or userrsquos

inputs1048708 Multiprocessor Systems With networks like the Internet many small

machines can flexibly collaborate for computing in contrast to an expensive large central machine [Grid Computing]

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 4: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

4

Evolution of shared computing Single-Processor Systems1048708 Program execution of earlier computers requires significant

preparation of equipments1048708 Mounting placing the punched cards setting the switches

and so on1048708 Each program execution is referred to as a job an isolated

activity1048708 The next user only gains the full control of the computer after

the completion of the current user [sequentially]1048708 Batching processing executes a batch of collected

jobs pending in the job queue(first-in first-out) (FIFO) without further interaction with users

5

Evolution of shared computing Single-Processor Systems1048708 Interactive processing carries on a dialogue with the user1048708 --It involves real-time processing for the machine to interact with its

environment1048708 --Reservation systems word processing computer games1048708 To serve more than one user or job at a time time-sharing technique

divides time into time intervals or time slices each designated to one task1048708

--Time-sharing used in single-user systems is usually called multitasking1048708 --Tradeoffs1048708 The overhead to rapidly shuffle the jobs to gain the illusion of

concurrent execution of several jobs1048708 The time wasted to await the completion of peripheral devices or userrsquos

inputs1048708 Multiprocessor Systems With networks like the Internet many small

machines can flexibly collaborate for computing in contrast to an expensive large central machine [Grid Computing]

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 5: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

5

Evolution of shared computing Single-Processor Systems1048708 Interactive processing carries on a dialogue with the user1048708 --It involves real-time processing for the machine to interact with its

environment1048708 --Reservation systems word processing computer games1048708 To serve more than one user or job at a time time-sharing technique

divides time into time intervals or time slices each designated to one task1048708

--Time-sharing used in single-user systems is usually called multitasking1048708 --Tradeoffs1048708 The overhead to rapidly shuffle the jobs to gain the illusion of

concurrent execution of several jobs1048708 The time wasted to await the completion of peripheral devices or userrsquos

inputs1048708 Multiprocessor Systems With networks like the Internet many small

machines can flexibly collaborate for computing in contrast to an expensive large central machine [Grid Computing]

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 6: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

6

Evolution of shared computing Batch processing Job queue Time-sharing

Multi-tasking multiple tasks for a single user

Interactive processing Real-time processing

Scheduling multiprocessor machines

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 7: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

7

Figure 31 Batch processing

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 8: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

8

Figure 32 Interactive processing

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 9: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

9

Types of software Application software

perform specific tasks for users spreadsheets database systems word processing systems program development software games and so forth

System software perform tasks needed by all computer systems Operating system abstracts the underlying hardware for

the rest of software

Utility software performs fundamental activities yet not included in the OS for simplicity1048708Disk formatting file copying

dial-up compression etc

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 10: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

10

Figure 33 Software classification

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 11: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

11

Components of an operating system Shell portion that communicates with

users Graphical user interface (GUI) pictorially represents

the objects on the screen and accept the commands like mouse-clicking for execution

Textual shells(Borne shell Korn shell C shell TC shell MS-DOS) is light weighted only accepting the commands issued by a keyboard1048708

Window manager is the component to govern the screen layout of GUI

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 12: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

12

Components of an operating system Kernel contains components

performing basic required functions File manager--coordinates the use of mass storage

facilitiesIt keeps records of all the files location (directory folder sub-directory path) access permission and history (file descriptor) free available space etc

Device drivers--are installed into the kernel to drive the corresponding peripheral devices using encapsulated activation steps specified for each device

Memory manager Scheduler and dispatcher

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 13: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

13

Components of an operating system

Scheduler--According to some priorities or concerns it determines which activities should be considered for execution

Dispatcher--It administrates the allocation of time slices to the activitiesbeing executed

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 14: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

14

Figure 34 The shell as an interface between users and the operating system

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 15: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

15

File Manager Directory or folder user-created

group or bundle of files Path position of a file in directory

hierarchy File descriptor information needed

to access an open file

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 16: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

16

Memory manager Coordinate the machinersquos use of main

memory Total main memory required exceeds

available(Ie 512MB is requires but only 256MB available) it creates the illusion of additional memory space by rotating back and forth of program and data between main memory and mass storage

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 17: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

17

Memory manager

Page divide the required space into units called page (a few kilobytes) and store the content of the page in mass storage

Virtual memory illusionary memory space Created by shuffling units of data

called pages between actual main memory space and mass storage

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 18: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

18

Getting it started (bootstrapping)

Bootstrap program in read only memory (ROM) Run by the CPU when power is turned

on Transfers operating system from

mass storage to main memory Executes jump to operating system

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 19: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

19

Figure 35 The booting process

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 20: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

20

BIOS(Basic Inputoutput System)

In addition to bootstrap read only memory (ROM) contains a set of routines for fundamental inputoutput activities

Receive information from keyboard display message on screen

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 21: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

21

Processes Program = a static set of directions

--A program can be run multiple times each instanceactivity called a process

Process = the activity of executing a program --Each process has its own process state

recording the current status of the activity Process state = current status of the activity

Snapshot of relevant parts of the machine state Program counter other registers associated main

memory

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 22: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

22

Process administration Scheduler

Keeps state of all processes in an process table(in main memory)

It containsmdashassigned memory area priority and readywaiting

Ready if its progress can continue or waiting if it is awaiting some external events to occur and so on

Priority Non-scheduling information memory

pages etc

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 23: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

23

Process administration (continued) Dispatcher

Gives one time slice or quantum to a process that is ready Executes a process switch (or context switch) when the

running processrsquos time slice is over A timer circuit counts down the quantum and generates an

interrupt at the end1048708 Such process switch involves updating the snapshot of

the current process restoring the snapshot of the next process and then starting its execution1048708

A program called interrupt handler is run for scheduler to update the process table select the next process hellipEarly termination of quantum is also possible

Interrupt indicates that time slice is over Interrupt handler part of dispatcher

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 24: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

24

Figure 36 Time-sharing between process A and process B

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 25: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

25

Handling competition for a resource System resources are shared among

processes1048708 --Some non-shareable resources like printers should not be

simultaneously written by more than one process1048708 Using a flag with the status of set(allocated) and

clear(available) there seems to be only one process allowed to write to the very resource

OS checks the flag and to decide set or clear(notecheck and set may require several machine cycle to finish)

Due to process switch two processes may just be aware of the clear flag right before being preempted1048708

During the following quantum they will proceed to write rArrproblem occurs

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 26: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

26

Handling competition for a resource Remedies testing and setting the flag must be

completed wo interruption (atomic) Semaphore = a control flag telling if resource is

in use Test and set must be done together for proper

function Critical region = sequence of instructions that

should be executed by only one process at a time Usually protected by a semaphore

Mutual exclusion = requirement for proper implementation of a critical region

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 27: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

27

Deadlock Two processes block each other from

continuing Conditions that lead to deadlock

1 Competition for non-sharable resources2 At least two resources are needed by both

processesThe resources are requested on a partial basis

having some while requesting more

3 An allocated resource can not be forcibly retrieved

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 28: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

28

Deadlock Deadlock hArrcyclic wait-for graphs in the

process table 1048708 The super-users may kill some processes

for the rest to be finished1048708 Deadlock avoidance schemes try to alter

the first two conditions1048708 To avoid the 2nd condition each process is

required to request all its resources at a time1048708

To prevent the 1st condition non-shareable resources are converted into sharable ones1048708

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 29: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

29

Figure 37 A deadlock resulting from competition for nonshareable railroad intersections

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 30: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

30

Spooling Postpone requested operation until a

later time Makes a non-shareable resource appear

shareable Technique of deadlock avoidance Printer spooling may be used for processes to

write to their own designated disk space instead of directly to the printerThen OS sends these printouts to the printer in series1048708

Multiple read accesses to a file finely coexist but conflict with any other write access

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 31: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

31

Security from outside attacks Most common protection require

user name and password Problem password stealing Problem automated password guessers Counter measures

Always tell user when heshe last logged in Report repeated bad guesses Log the guesser into a captive account to

spy on the guesser

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel

Page 32: Chapter 3 Operating Systems. 2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the.

32

Security from attacks from within Operating system prevents illegal

access to resources Different memory for different processes Privileged instructions only allowed in

kernel All file access passes through the kernel Other devices can only be accessed

through the kernel