Beruflich Dokumente
Kultur Dokumente
Chapter 2
CS 5348 OS Concepts 1
OS Objectives and Functions
CS 5348 OS Concepts 2
The OS as a Platform for System Evolution
CS 5348 OS Concepts 3
OS as a Software Services
CS 5348 OS Concepts 4
Layered Software and Hardware of an OS
CS 5348 OS Concepts 5
Operating System Software Layers
Application Binary Interface (ABI)
Services that provide access to basic Operating System services.
i.e. access to the OS Kernel / privileged services.
Also known as System Calls (syscalls).
Instructions that execute in Kernel Mode.
CS 5348 OS Concepts 6
Operating System Tools & Services
CS 5348 OS Concepts 7
Operating System Services
CS 5348 OS Concepts 8
Operating System Services
CS 5348 OS Concepts 9
The OS as a Resource Manager
The user program does not have direct access the system’s
devices, OS Kernel (instructions and data structures), etc.
The operating system provides syscalls (ABI) that provides a
program controlled access to protected resources.
CS 5348 OS Concepts 10
The OS as a Software System
CS 5348 OS Concepts 11
Operating System Evolution
CS 5348 OS Concepts 12
Serial Processing
CS 5348 OS Concepts 13
IBM 701
http://en.wikipedia.org/wiki/IBM_701
CS 5348 OS Concepts 14
A Punch Card Containing a Single Line of Code
CS 5348 OS Concepts 15
Serial Processing Shortcomings
CS 5348 OS Concepts 16
Kernel: The OS Instructions and Data
CS 5348 OS Concepts 17
The Kernel is always resident in Memory
CS 5348 OS Concepts 18
Four Innovations in Processor Design
that allowed the development of
Modern Operating Systems
Protected Memory
Privileged Instructions
Interrupts
Timers
CS 5348 OS Concepts 19
Protected Memory
System memory is divided into two regions:
Protected Memory: Contains the instructions and data
structures that make up the OS Kernel.
User Memory: Contains the instructions and data
structures of multiple user programs.
CS 5348 OS Concepts 20
Hardware Restricted Memory Access
Simple Memory Management Hardware
CS 5348 OS Concepts 21
Privileged Instructions
CS 5348 OS Concepts 22
Kernel and User Modes of Execution
CS 5348 OS Concepts 23
Kernel and User Modes
CS 5348 OS Concepts 24
Reasons for Mode Protection
CS 5348 OS Concepts 25
System Calls (SYSCALLS)
CS 5348 OS Concepts 26
The 4 Steps in Making A Linux System Call:
CS 5348 OS Concepts 27
Blocking System Calls
Typically I/O Operations
CS 5348 OS Concepts 28
Multiprocessing Operating Systems
Also called Multitasking Systems
CS 5348 OS Concepts 29
Preemptive Multiprocessing
CS 5348 OS Concepts 30
Multiprocessing is a Method of Sharing the
Processor between Multiple Processes
A process executes (runs) for a specific period of time.
After its time has expired, the running process is suspended and
the next process is executed.
CS 5348 OS Concepts 31
The OS uses a Timer Interrupt to preempt the
execution of the currently running program
A Timer is a HW device that delivers a regular interrupt to the
processor that signals the OS to perform a context switch.
The timer may signal / interrupt the processor every 10ms.
Context switch from the execution of Program A to Program B.
CS 5348 OS Concepts 32
Context Switching occurs when the currently
executing process is replaced by another
For example, the Context Switch from Process A to B.
1. Process A is currently executing. i.e. the processor is executing
instructions and acting on data owned by Process A.
2. The timer interrupt occurs ‘interrupting’ the execution of A.
3. The Timer Interrupt Handler, causes the processor to save the
context (state) of Process A in a data structure maintained by the
kernel.
4. The interrupt hander selects another process that is currently
eligible for execution (Process B) and restores its context in the
processor.
5. The processor returns from the timer interrupt resuming the
execution of Process B where it was last interrupted.
CS 5348 OS Concepts 33
Multiple Processes
Maintained in Memory
CS 5348 OS Concepts 34
The Process
A unit of activity characterized by a thread of execution, the
processor’s state, and an allocated set of resources.
A program executes within the context of a process.
processes.
Shard system resources (memory, I/O devices, etc.) must be fairly
CS 5348 OS Concepts 35
The Process State
CS 5348 OS Concepts 36
Memory Management
CS 5348 OS Concepts 37
Disk and File Management
CS 5348 OS Concepts 38
Process Scheduling
CS 5348 OS Concepts 39