1
CS 4410 Operating Systems
Hardware – OS & OS- Application interface
Summer 2011 Cornell University
Hardware OS & OS- Application interface Summer 2011 Cornell - - PowerPoint PPT Presentation
CS 4410 Operating Systems Hardware OS & OS- Application interface Summer 2011 Cornell University 1 Today How my device becomes useful for the user? HW-OS interface Device controller Device driver Interrupts
1
Summer 2011 Cornell University
2
3
memory CPU Disk controller USB controller Graphics adapter disks mouse keyboard printer monitor
4
memory device CPU OS device driver device controller
5
6
7
–
Device communication goes over the memory bus
–
Reads/Writes to special addresses are converted into I/O operations by dedicated device hardware
–
Each device appears as if it is part of the memory address space
–
CPU has dedicated, special instructions
–
CPU has additional input/output wires (I/O bus)
–
Instruction specifies device and operation
device controller device driver CPU device OS
8
– CPU constantly checks controller for new data – Inefficient
– Controller alert CPU for an event – Interrupt driven I/O
device controller device driver CPU device OS
9
memory CPU devices interrupt controller
10
11
follows
disk).
CPU.
12
13
memory CPU OS device driver Application device device controller
14
15
– e.g. HALT, change MMU settings, set clock, reset
– The operating system (OS)
16
17
18
19
20
21
22
Activation Records
OBJECT1 OBJECT2 OBJECT1 OBJECT2
HELLO WORLD GO BIG RED CS!
printf(char * fmt, …) { create the string to be printed SYSCALL 80 } malloc() { … } strcmp() { … } main() { printf (“HELLO WORLD”); printf(“GO BIG RED CS”); !
Stack Heap Data
Library Program
Text
23
USER OBJECT1 OBJECT2
OS Stack OS Heap OS Data
LINUX
syscall_entry_point() { … }
OS Text
Kernel Activation Records
OBJECT1 OBJECT2
Stack Heap Data
HELLO WORLD GO BIG RED CS!
printf(char * fmt, …) { main() { … }
Program Library
Activation Records
24
user application
expects it
application
25
PC
26
27
to obtain service from the OS
OS in response to an exceptional event
OS
28
29