Day 11-29 - Handler decides whether to • Abort or •...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Exceptions Abnormal control flow o Alternative execution sequence can be triggered by External event (eg. Interrupt) Internal event (eg, page fault, divide by zero) Explicit request (ask for file I/0) o These are called “exceptions Exception classes o 4 Triggers Interrupt – asynchronous timing Return: next instruction Fault – synchronous timing Return: current instruction (?) Abort - synchronous timing Return: never Trap - synchronous timing Return next instruciton Trigger 1: Interrupts o Action Complete current instruction Branch to vectored Interrupt Service Routine (ISR) Return to next instruction o When writing ISR Keep it short Handle immediate requirements, queue work for later Serious potential for priority inversion Trigger 2: Faults o Occur synchronously with current instruction o Action Branch to vectored exception handler
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Handler decides whether to • Abort, or • Return and restart current instruction • Trigger 3: Aborts o Unrecoverable hard error o Action Terminate program Question – is termination always best? • Trigger 4: Traps o Explicitly requested exception o Action Branch to vectored exception handler OS provides requested service at its convenience Return to next instruction o For synchronous triggers resumption of execution is whenever scheduled by OS • Processes o A process is an instance of a running program Logical flow control (determined by code) Private virtaual address space • Different Process o Use execve() to load and run a new program in the context of the current process int execve(char *filename, char *argv, char *envp) •...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Day 11-29 - Handler decides whether to • Abort or •...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online