Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
Xiaoyu Zhang
Computing Devices
Everywhere
Computer System
Organization
Computer-system operation
One or more CPUs, device controllers connect
through common bus providing access to shared
memory
Concurrent execution of CPUs and devices
competing for memory cycles
How do we tame
complexity?
Questions:
Operating System
Application
Operating System
Hardware
Virtual Machines
Software emulation of an abstract machine
Programming simplicity
Fault Isolation
Memory Management
I/O Management
CPU Scheduling
Communications? (Does Email belong in OS?)
What about?
File System?
Multimedia Support?
User Interface?
Internet Browser?
Altair 8080
14
16
Facilitator
Still provides Standard libraries, facilities
Definition of interrupt:
An interrupt is a method to ensure that the CPU takes note
of an event.
Types of interrupt:
Hardware interrupts (e.g. from an I/O device)
Software interrupt (from an executing process. System Call)
Also called a trap or an exception
Generated to signal error (e.g. divide by zero)
or to request service from OS (e.g. I/O).
Interrupt Handling
The operating system preserves the state of
the CPU by storing registers and the program
counter.
The O.S. determines which type of interrupt
has occurred.
Separate segments of code determine what
action should be taken for each type of interrupt.
Simple Policy:
Programs are not allowed to read/write memory
of other Programs or of Operating System
20
Address Translation
Address Space
A group of memory addresses usable by something
Each program (process) and kernel has potentially
different address spaces.
Address Translation:
Translate from Virtual Addresses (emitted by CPU)
into Physical Addresses (of memory)
Mapping often performed in Hardware by Memory
Management Unit (MMU)
CPU
Virtual
Addresses
MMU
Physical
Addresses
21
Example of Address
Translation
Code
Data
Heap
Stack
Data 2
Code
Data
Heap
Stack
Stack 1
Heap 1
Code 1
Stack 2
Prog 1
Virtual
Address
Space 1
Data 1
Heap 2
Code 2
Prog 2
Virtual
Address
Space 2
OS code
Translation Map 1
OS data
OS heap &
Stacks
Translation Map 2
22
24
Applications
Standard Libs
Kernel Mode
Hardware
25
In conclusion
Operating systems provide a virtual machine
abstraction to handle diverse hardware
Operating systems simplify application
development by providing standard services
Operating systems coordinate resources and
protect users from each other
Operating systems can provide an array of
fault containment, fault tolerance, and fault
recovery
26
2006
Factor
CPU MHz,
Cycles/inst
10
310
3200x4
0.250.5
1,280
640
DRAM capacity
128KB
4GB
32,768
Disk capacity
10MB
1TB
100,000
Net bandwidth
9600 b/s
1 Gb/s
110,000
# addr bits
16
32
#users/machine
10s
0.1
Price
$25,000
$4,000
0.2
Dawn of time
ENIAC: (19451955)
31
Response
time
of millions
OS Technology maturing/stabilizing
Interactive timesharing:
Use cheap terminals (~$1000) to let multiple users
interact with the system at the same time
Sacrifice CPU time to get better response time
Users do debugging, editing, and email online
Problem: Thrashing
Performance very non-linear
response with load
Thrashing caused by many
factors including
Swapping, queueing
Users
32
Personal computing:
Xerox Star
Windows 3.1
34
Services
Computing
File Storage
35
Peer-to-peer systems
Many devices with equal responsibilities work together
Components of Operating System spread across globe
36
37
38
I/O operations
Communications
Control capabilities
Operating Systems
Components
(What are the pieces of the OS)
Process Management
Main-Memory Management
I/O System management
File Management
Networking
User Interfaces
41
Process Management
A process is a program in execution. It is a unit of work within
the system. Program is a passive entity, process is an active
entity.
Process needs resources to accomplish its task
CPU, memory, I/O, files
Initialization data
Process termination requires reclaim of any reusable resources
Single-threaded process has one program counter specifying
location of next instruction to execute
Process executes instructions sequentially, one at a time,
until completion
Multi-threaded process has one program counter per thread
Typically system has many processes, some user, some
operating system running concurrently on one or more CPUs
Concurrency by multiplexing the CPUs among the processes /
threads
42
Process Management
Activities
The operating system is responsible for the
following activities in connection with process
management:
Creating and deleting both user and system
processes
Suspending and resuming processes
Providing mechanisms for process
synchronization
Providing mechanisms for process communication
Providing mechanisms for deadlock handling
43
Memory Management
All data in memory before and after processing
All instructions in memory in order to execute
Memory management determines what is in
memory when
Optimizing CPU utilization and computer response to
users
Storage Management
OS provides uniform, logical view of information
storage
File-System management
45
Mass-Storage Management
Usually disks used to store data that does not fit in main memory
or data that must be kept for a long period of time.
Proper management is of central importance
Entire speed of computer operation hinges on disk subsystem and
its algorithms
OS activities
Free-space management
Storage allocation
Disk scheduling
46
I/O Subsystem
One purpose of OS is to hide peculiarities
of hardware devices from the user
I/O subsystem responsible for
Memory management of I/O including
buffering (storing data temporarily while it is
being transferred),
caching (storing parts of data in faster storage
for performance),
spooling (the overlapping of output of one job
with input of other jobs)
Conclusion
Rapid Change in Hardware Leads to
changing OS
Process Control
Main Memory
I/O
File System
UI