0% found this document useful (0 votes)
43 views25 pages

CS325 Operating Systems Spring 2021: Computer-System Structures

This document contains lecture slides on operating system structures from a CS325 Operating Systems course. It discusses the basic components of an operating system including the kernel, system calls, interrupts, and traps. It also covers different OS structures like simple/monolithic, layered, microkernel, and virtual machine approaches. Key topics covered include system call execution, types of system calls, OS implementation in assembly vs higher-level languages, and separation of mechanism and policy in system design. The next lecture will cover processes, process states, process control blocks, and scheduling queues.

Uploaded by

Aftab Jahangir
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)
43 views25 pages

CS325 Operating Systems Spring 2021: Computer-System Structures

This document contains lecture slides on operating system structures from a CS325 Operating Systems course. It discusses the basic components of an operating system including the kernel, system calls, interrupts, and traps. It also covers different OS structures like simple/monolithic, layered, microkernel, and virtual machine approaches. Key topics covered include system call execution, types of system calls, OS implementation in assembly vs higher-level languages, and separation of mechanism and policy in system design. The next lecture will cover processes, process states, process control blocks, and scheduling queues.

Uploaded by

Aftab Jahangir
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/ 25

CS325 Operating Systems

Spring 2021

Computer-System Structures

Owais Hakeem
SST

05/27/2021 Operating System, Owais Hakeem, 1


UMT
OS Kernel

Users
Applications
Operating System API, AUI
Operating System Kernel
Computer Hardware
Real work is done in the kernel
05/27/2021 Operating System, Owais Hakeem, 2
UMT
Entry Points into Kernel

System Call Signal

Interrupt Trap

05/27/2021 Operating System, Owais Hakeem, 3


UMT
System Calls
 User processes must not be given open access to the kernel
code

 The system call interface layer contains entry point in the


kernel code

 Any user or application request that involves access to any


system resource must be handled by the kernel code

05/27/2021 Operating System, Owais Hakeem, 4


UMT
Types Of System Calls
 Process Control
 End/Abort, load and execute, Creat and terminate process, Wait and
Signed Event, Allocate and free memory.

 File Management
 Create a file, Delete file, Open and close file, Read/write and
reposition, Get and set file attributes

 Device Management
 Request and release device, Logically attach/ detach devices, Get and
Set device attributes

 Information maintenance
 Get or set time and date, Get process and device attributes

 Communications
 Create/delete communications connections, Send/receive message, Help
OS to transfer status information, Attach or detach remote devices

05/27/2021 Operating System, Owais Hakeem, 5


UMT
System Call Execution

 The user program makes a call to a library function.

 Library routine puts appropriate parameters at a well-known


place (registers, stack, or a table in memory).

 The trap instruction is executed to change mode from user to


kernel.

 Control goes to operating system.

 Operating system determines which system call is to be carried


out.
05/27/2021 Operating System, Owais Hakeem, 6
UMT
Semantics of System Call Execution …

 Kernel indexes the dispatch table, which contains pointers to


service routines for system calls.

 Service routine is executed and return parameter or error code


placed at well-known places (usually a CPU register).

 Control given back to user program.

 Library function executes the instruction following trap.

05/27/2021 Operating System, Owais Hakeem, 7


UMT
System Call …
Process

Library Call

System Call
trap
Dispatch Table Service
Code
Kernel
Code

05/27/2021 Operating System, Owais Hakeem, 8


UMT
Operating System Structures

 Simple Structure

 Layered Approach

 Microkernels

 Virtual Machines

05/27/2021 Operating System, Owais Hakeem, 9


UMT
Simple/Monolethic Structures
MS-DOS : written to provide the most functionality in the
least space, so it was not divided into modules carefully

05/27/2021 Operating System, Owais Hakeem, 10


UMT
Simple Structures …
 UNIX consists of two separable parts, the kernel and the
system programs.

 Every thing below the system call interface and above the
physical hardware is the kernel.

 An enormous amount of functionality combined in one level,


UNIX is difficult to enhance as changes in one section could
adversely affect other areas.

05/27/2021 Operating System, Owais Hakeem, 11


UMT
UNIX System Structure

05/27/2021 Operating System, Owais Hakeem, 12


UMT
Layered Approach
• The OS is broken up into a number of layers
• Bottom layer is h/w and the topmost layer
(Layer N) is the user interface
• A typical layer consists of data structures and a
set of routines to service the layer above it
• “THE OPERATING SYSTEM” by Dijkstra
• IBM`s OS/2

05/27/2021 Operating System, Owais Hakeem, 13


UMT
Layered Approach …

05/27/2021 Operating System, Owais Hakeem, 14


UMT
Layered Approach …

 Modularity

 Each layer uses functions and services of only lower layers

 Simplifies debugging and system verification.

 The major difficulty with layered approach is careful


definition of layers, because a layer can only use the layers
below it

 Less efficient than other approaches

05/27/2021 Operating System, Owais Hakeem, 15


UMT
Microkernel
Structures the operating system by removing all non-essential
components from the kernel and implementing them as system
and user level programs

Smaller kernel

Main function is to provide a communication facility between


client programs and the various services that are also running
in the user space.
Microkernel …
Easier to extend the OS—new services are added to user space
and consequently do not require modification of the kernel
and/or its recompilation

Easier to maintain operating system code (enhancement,


debugging, etc.)

OS is easier to port from one hardware to another

More security and reliability

Mach, MacOS X Server, QNX, OS/2, and Windows NT


Microkernel v/s Monolithic kernel

05/27/2021 Operating System, Owais Hakeem, 18


UMT
Virtual Machines
CPU scheduling and virtual memory techniques used to emulate
hardware of the underlying machine, on which user can install
an operating system that the virtual machine supports

On a time-sharing system with virtual machine support, users


may be working on different operating systems

Pioneered by IBM VM operating system that ran CMS, a


single-user interactive operating system
Virtual Machines …

Difficult to implement.

System development done without disrupting normal system


operation.
Virtual Machines …

Non Virtual Machine Virtual Machine


System Design and Implementation

Design Goals

User: operating system should be convenient to use, easy to


learn, reliable, safe, and fast.

System designer and administrator: operating system should


be easy to design, implement, and maintain, as well as
flexible, reliable, error-free, and efficient.
System Design and Implementation …

Mechanism: determine how to do something

Policy: determine what will be done

Separation of mechanism and policy is important for


flexibility.
System Design and Implementation …

Implementation in:
 Assembly language

 Higher level languages:

 Easier to code

 Compact code

 Easier to port
Next time

• Process
• Process States
• Process Control Block
• Process Scheduling Queues
• Schedulers

05/27/2021 Operating System, Owais Hakeem, 25


UMT

You might also like