40 likes | 196 Views
Drivers, Interrupts, and Trap Explained. COMP346/5461 - Operating Systems Tutorial 3.5 Revision 1.2 September 30, 2003. Interrupts and Trap Revisited. Neither interrupt nor trap are function calls!
E N D
Drivers, Interrupts, and Trap Explained COMP346/5461 - Operating Systems Tutorial 3.5 Revision 1.2 September 30, 2003 Serguei A. Mokhov, mokhov@cs.concordia.ca
Interrupts and Trap Revisited • Neither interrupt nor trap are function calls! • Interrupt is an event, or a signal (do not confuse with UNIX signals), notifying the system that something happened. • Interrupts are not necessarily used to switch between processes (in scheduling), but cause a context swicth. • Trap is a software interrupt, it's synchronous, whereas an ordinary interrupt is asynchronous. • Trap is a CPU instruction, which is invoked when a user program wants either some service from an OS (system call) or causes an error (division by zero, segmentation fault, page fault, etc.) Serguei A. Mokhov, mokhov@cs.concordia.ca
User-running syscall() - trap exit() Kernel-running Zombie wait() Blocked Ready Common Interface: open, close, read, write The “Big” Picture System Call Interface App App App App App User mode SW Kernel mode MM kernel PM HDDD PTRDD CDDD int Ready queue Bus CPU: add mult mov trap HW DMA Ctl Mon Ctl Ptr Ctl CD Ctl int int (IRQ) Serguei A. Mokhov, mokhov@cs.concordia.ca
That’s It :-) Serguei A. Mokhov, mokhov@cs.concordia.ca