chapter 4 process abstraction n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 4 Process Abstraction PowerPoint Presentation
Download Presentation
Chapter 4 Process Abstraction

Loading in 2 Seconds...

play fullscreen
1 / 8

Chapter 4 Process Abstraction - PowerPoint PPT Presentation


  • 61 Views
  • Uploaded on

Chapter 4 Process Abstraction. Chien -Chung Shen CIS, UD cshen@cis.udel.edu. Process. P rocess is a running program A program itself is a lifeless thing sitting on disk with instructions (and static data) OS transforms a program into a running process Need to run many processes at once

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 4 Process Abstraction' - rashad-morin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 4 process abstraction

Chapter 4Process Abstraction

Chien-Chung Shen

CIS, UD

cshen@cis.udel.edu

process
Process
  • Process is a running program
    • A program itself is a lifeless thing sitting on disk with instructions (and static data)
    • OS transforms a program into a running process
  • Need to run many processes at once
  • Problem: how to provide the illusion of many CPUs?
    • virtualize the CPU – run one process, stop it, and then run another process, etc.
    • time sharing
    • scheduling policy & context switching mechanism
machine state of process
Machine State of Process
  • Address space (including stack)

http://www.cs.umd.edu/class/spring2003/cmsc311/Notes/Mips/stack.html

  • CPU registers (including PC, SP, FP)
  • Opened files
process api
Process API
  • Create – a process is created when an application icon is double-clicked
  • Destroy
  • Wait
  • Miscellaneous control – stop& resume
  • Status
process creation
Process Creation
  • Load code and static data into memory (address space)
  • Initialize (run-time) stack with argc & argv
  • Initialize 3 default file descriptors (0, 1, and 2)
  • Jump to main()
process state life cycle
Process State (Life Cycle)
  • Running – using CPU
  • Ready – someone else is using CPU
  • Blocked – not ready until some other event takes place (e.g., initiate I/O request to disk)
data structures of os
Data Structures of OS
  • OS is a program itself containing data structures
  • Process lists (or queues)
    • running queue (single CPU)
    • ready queue
    • I/O queues
  • PCB (Process Control Block)
    • register context
    • process state
    • for context switching
pcb in xv6 kernel
PCB in xv6 Kernel

struct context { // registers saved/restored in context switch

inteip; intesp; intebx; intecx; intedx; intesi;

intedi; intebp; };

enumproc_state// process state

{ UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };

structproc { // PCB

char *mem; uintsz; char *kstack;

enumproc_statestate;

intpid;

structproc *parent; void *chan;

intkilled; structfile *ofile[NOFILE];

structinode *cwd;structcontext context;

structtrapframe *tf;

};