Lecture 11

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: ington ExcepJon Table IA32 (Excerpt) Excep&on Number Descrip&on Excep&on Class 0 Divide error Fault 13 General protec:on fault Fault 14 Page fault Fault 18 Machine check Abort 32-­‐127 OS-­‐defined Interrupt or trap 128 (0x80) System call Trap 129-­‐255 OS-­‐defined Interrupt or trap hep://download.intel.com/design/processor/manuals/253665.pdf Processes 15 University of Washington Summary ¢  ExcepJons §  Events that require non-­‐standard control flow §  Generated externally (interrupts) or internally (traps and faults) §  A]er an excep:on is handled, one of three things may happen: §  §  §  Re-­‐execute the current instruc:on Resume execu:on with the next instruc:on Abort the process that caused the excep:on Processes 16 University of Washington Processes ¢  ¢  ¢  What is a process CreaJng processes Fork-­‐Exec Processes 17 University of Washington What is a process? ¢  What is a program? A processor? A process? Processes 18 University of Washington What is a process? ¢  Why are we learning about processes? §  Processes are another abstrac/on in our computer system – the process abstrac:on provides an interface between the program and the underlying CPU + memory. ¢  What do processes have to do with excep:onal control flow (previous slides)? §  Excep:onal control flow is the mechanism that the OS uses to enable mul:ple processes to run on the same system. Processes 19 University of Washington Processes ¢  DefiniJon: A process is an instance of a running program §  One of the most important ideas in computer science §  Not the same as “program” or “processor” ¢  Process provides each program with two key abstracJons: §  Logical control flow Each process seems to have exclusive use of the CPU §  Private virtual address space §  Each process seems to have exclusive use of main memory §  ¢  ¢  Why are these illusions important? How are these illusions maintained? §  Process execu:ons are interleaved (mul:-­‐tasking) §  Address spaces managed by virtual memory system – next course topic Processes 20 University of Washington Concurrent Processes ¢  ¢  ¢  Two processes run concurrently (are concurrent) if their instrucJon execuJons (flows) overlap in Jme Otherwise, they are sequen&al Examples: §  Concurrent: A & B, A & C §  Sequen:al: B & C Process A Process B Process C Jme Processes 21 University of Washington User View of Concurrent Processes ¢  Control flows for concurrent processes are physically disjoint in Jme §  CPU only executes instruc:ons for one process at a :me ¢  However, we can think of concurrent processes as execuJng in parallel Process A Process B Process C Jme Processes 22 University of Washington Context Switching ¢  Processes are managed by a shared chunk of OS code called the kernel §  Important: the kernel is not a separate process, but rather runs as part of a user process ¢  Control flow passes from one process to another via a context switch… (how?) Process A Process B user code kernel code Jme context switch user code kernel code context switch user code Processes 23 University of Washington Processes ¢  ¢  ¢  What is a process CreaJng processes Fork-­‐Exec Processes 24 University of Washington CreaJng New Processes & Programs ¢  fork-­‐exec model: §  fork() creates a copy of the current process §  e...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online