Download [Lecture 1, part 3] Kernel interaction with the hardware: Interrupt

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Acorn MOS wikipedia , lookup

Security-focused operating system wikipedia , lookup

Burroughs MCP wikipedia , lookup

Berkeley Software Distribution wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

RSTS/E wikipedia , lookup

Copland (operating system) wikipedia , lookup

Distributed operating system wikipedia , lookup

CP/M wikipedia , lookup

Unix security wikipedia , lookup

Spring (operating system) wikipedia , lookup

VS/9 wikipedia , lookup

DNIX wikipedia , lookup

Kernel (operating system) wikipedia , lookup

Process management (computing) wikipedia , lookup

Transcript
[Lecture 1, part 3]
Kernel interaction with the hardware:
Interrupt:
Like input / output, user input, between kernel and device driver.
Devices call back by interrupts.
They are serviced immediately.
And they are user transparent.
Implementation:
Each device only has limited number of interrupt events.
So we can define an interrupt table
For each element, there is a pointer points to specific kernel code to handle this interrupt.
Pointer to specific kernel code
Typical hardware:
like keyboard, mouse, and some other processors like GPU.
Memory Hierarchy:
CPU
CPU2
registers
registers
Cache(L1L2L3)
Cache(L1L2L3)
The higher the faster,
But more expensive,
RAM
So typically smaller.
Flash
The lower the slower,
But cheaper,
So typically larger.
Disk
optional
tape
Cloud store
Difficulties:
Cache consistency
Cache coherency (for multiple CPU)
Process:
Program in RAM, Instance of a running program,
To start a running process, just load the stuff into memory, start the first instruction.
CPU Scheduling:
Divide CPU time to time slices to different processes.
The longer the time-slices are, the less interactive.
But too short will make context switching overwhelming, lost performance.
A
B
A
C
A
B
Implementation:
Set up a timer, call interrupt handler, switch out the process running, load other process.
OS Services:
Design Decision:
Real time operating system: like telesurgery.
Commodity operating system: easy to use, but less interactive, real-time is not as important.
Mechanism: is about How to do things.
Policy: is about What you want to do.
Separation of the two:
Mechanism can be reused, kept when policy was canceled.
The separation of Mechanism and Policy gives you flexibility.
Structure of real word OS:
MS-DOS
Application
Resident Systems
UNIX
users
Shell commands
library
User space
unprivileged
System call
Device drivers
hardware
Signal,
file Systems ,
I/O
Device drivers
Kernel space
privileged
Mac OS X
users
service
service
service
BSD emulator
Mac microkernel
Microkernel:
Push as much services as possible to user space.
Features of microkernel
Easy to swap out modules
Security, failed modules will not affect kernel.
Less code run in privilege mode, which makes it slower though.