0% found this document useful (0 votes)
40 views

CH08 Operating System Support

The document summarizes key concepts in operating system support from Chapter 8 of William Stallings' Computer Organization and Architecture textbook. It discusses operating system services, interfaces between hardware and software, types of operating systems like interactive and batch systems, and early operating systems using memory-mapped monitors. It also summarizes scheduling techniques like long-term, medium-term, and short-term scheduling. Finally, it discusses memory management techniques like swapping, partitioning, paging, and virtual memory using demand paging.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

CH08 Operating System Support

The document summarizes key concepts in operating system support from Chapter 8 of William Stallings' Computer Organization and Architecture textbook. It discusses operating system services, interfaces between hardware and software, types of operating systems like interactive and batch systems, and early operating systems using memory-mapped monitors. It also summarizes scheduling techniques like long-term, medium-term, and short-term scheduling. Finally, it discusses memory management techniques like swapping, partitioning, paging, and virtual memory using demand paging.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

+

William Stallings
Computer Organization
and Architecture
9th Edition
+
Chapter 8
Operating System Support
8.1 Operating system overview
Computer Hardware and Software Structure
+
Operating System (OS) Services
 The most important system program

 Masks the details of the hardware from the programmer and provides
the programmer with a convenient interface for using the system

 The OS typically provides services in the following areas:


 Program creation
 Program execution
 Access to I/O devices
 Controlled access to files
 System access
 Error detection and response
 Accounting
+
Interfaces
Key interfaces in a typical computer system:

Instruction set Application Application


architecture binary interface programming
(ISA) (ABI) interface (API)

Gives a program access to the


hardware resources and
Defines the machine language
Defines a standard for binary services available in a system
instructions that a computer
portability across programs through the user ISA
can follow
supplemented with high-level
language (HLL) library calls

Defines the system call


interface to the operating Using an API enables
Boundary between hardware system and the hardware application software to be
and software resources and services ported easily to other systems
available in a system through that support the same API
the user ISA
+ Operating System
as
Resource Manager
A computer is a set of resources for the movement, storage, and
processing of data and for the control of these functions
 The OS is responsible for managing these resources

The OS as a control mechanism is unusual in two respects:


 The OS functions in the same way as ordinary computer
software – it is a program executed by the processor
 The OS frequently relinquishes control and must depend on
the processor to allow it to regain control
The OS as
Resource
Manager
+
Types of Operating Systems

 Interactive system
 The user/programmer interacts directly with the computer to request the
execution of a job or to perform a transaction
 User may, depending on the nature of the application, communicate with
the computer during the execution of the job

 Batch system
 Opposite of interactive
 The user’s program is batched together with programs from other users and
submitted by a computer operator
 After the program is completed results are printed out for the user
+
Early Systems
 From the late 1940s to the mid-1950s the programmer
interacted directly with the computer hardware – there was no OS
 Processors were run from a console consisting of display lights, toggle switches,
some form of input device and a printer

 Problems:
 Scheduling
 Sign-up sheets were used to reserve processor time
 This could result in wasted computer idle time if the user finished early
 If problems occurred the user could be forced to stop before resolving the
problem
 Setup time
 A single program could involve
 Loading the compiler plus the source program into memory
 Saving the compiled program
 Loading and linking together the object program and common functions
+

Memory
Layout
for a
Resident Monitor
+
Desirable Hardware Features
 Memory protection  Privileged instructions
 User program must not alter the
 Can only be executed by the monitor
memory area containing the monitor  If the processor encounters such an
 The processor hardware should detect instruction while executing a user
an error and transfer control to the program an error interrupt occurs
monitor  I/O instructions are privileged so the
 The monitor aborts the job, prints an monitor retains control of all I/O
error message, and loads the next job devices

 Timer  Interrupts
 Used to prevent a job from  Gives the OS more flexibility in
monopolizing the system relinquishing control to and
regaining control from user
 If the timer expires an interrupt
programs
occurs and control returns to
monitor
System Utilization Example

+
+

Multiprogramming
Example
+
Time Sharing Systems

 Used when the user interacts directly with the computer

 Processor’s time is shared among multiple users

 Multiple users simultaneously access the system through terminals,


with the OS interleaving the execution of each user program in a
short burst or quantum of computation

 Example:
 If there are n users actively requesting service at one time, each user will
only see on the average 1/n of the effective computer speed
Batch
Multiprogramming
versus
Time Sharing

+
+
8.2 Scheduling
 The key to multiprogramming

 Four types are typically involved:

Table 8.4 Types of Scheduling


Long Term Scheduling

In some systems a newly


created process begins in a
Once submitted, a job
Determines which programs swapped-out condition, in
becomes a process for the
are submitted for processing which case it is added to a
short term scheduler
queue for the medium-term
scheduler

Time-sharing system Batch system


• A process request is generated when a user
attempts to connect to the system • Newly submitted jobs are routed to disk
• OS will accept all authorized comers until and held in a batch queue
the system is saturated • The long-term scheduler creates
• At that point a connection request is met processes from the queue when it can
with a message indicating that the system
is full and to try again later
+
Medium-Term Scheduling
and Short-Term Scheduling

Medium-Term Short-Term
Part of the swapping function  Also known as the dispatcher
Swapping-in decision is based  Executes frequently and makes
on the need to manage the degree
the fine-grained decision of
of multiprogramming
which job to execute next
Swapping-in decision will
consider the memory
requirements of the swapped-out
processes
Five State Process Model
+

Process Control Block


Scheduling Example
Key Elements of O/S
Process Scheduling
+
8.3 Memory
Management

Swapping
+

Memory Management
Partitioning
Effect of Dynamic Partitioning

Logical address
- expressed as a location relative to the
beginning of the program

Physical address
- an actual location in main memory

Base address
- current starting location of the process
+

Memory Management
Paging
+

Logical and Physical


Addresses

Paging
+
Virtual Memory
Demand Paging
 Each page of a process is brought in only when it is needed

 Principle of locality
 When working with a large process execution may be confined to a small section of a program
(subroutine)
 It is better use of memory to load in just a few pages
 If the program references data or branches to an instruction on a page not in main memory, a
page fault is triggered which tells the OS to bring in the desired page

 Advantages:
 More processes can be maintained in memory
 Time is saved because unused pages are not swapped in and out of memory

 Disadvantages:
 When one page is brought in, another page must be thrown out (page replacement)
 If a page is thrown out just before it is about to be used the OS will have to go get the page again
 Thrashing
 When the processor spends most of its time swapping pages rather than executing instructions
Inverted Page
Table Structure
+

Operation of Paging
and Translation
Lookaside Buffer
(TLB)
TLB and
Cache
Operation
+
Segmentation

 Usually visible to the programmer


 Advantages:
 Provided as a convenience for  Simplifies the handling of
organizing programs and data and
growing data structures
as a means for associating
privilege and protection attributes  Allows programs to be altered
with instructions and data and recompiled independently
without requiring that an entire
 Allows the programmer to view set of programs be re-linked and
memory as consisting of multiple re-loaded
address spaces or segments  Lends itself to sharing among
processes
 Lends itself to protection
+ Summary Operating System
Support
Chapter 8
 Memory management
 Operating system objectives and  Swapping
functions  Partitioning
 Types of operating systems  Paging
 Scheduling  Virtual memory
 Long-term scheduling  Translation lookaside buffer
 Medium-term scheduling  Segmentation
 Short-term scheduling  ARM memory management
 Pentium memory management  Memory system organization
 Address spaces  Virtual memory address
 Segmentation translation
 Paging  Memory-management formats
 Access control
+ Key terms Chapter 8

 batch system  physical address


 demand paging  privileged instruction
 interactive operating system  process
 interrupt  process control block
 job control language (JCL)  process state
 kernel  real memory
 logical address  resident monitor
 long-term scheduling  segmentation
 medium-term scheduling  short-term scheduling
 memory management  swapping
 memory protection  thrashing
 multiprogramming  time-sharing system
 multitasking  translation lookaside buffer (TLB)
 nucleus  utility
 operating system (OS)  virtual memory
 paging
 page table
 partitioning
+ Summary Operating System
Support
Chapter 8

 8.3
 8.4
 8.6
 8.7
 8.8
 8.9
 8.13
 8.14

You might also like