07-Unix_Process_Env - CSC 4304 - Systems Programming Fall...

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

View Full Document Right Arrow Icon
1 CSC 4304 - Systems Programming Fall 2010 Tevfik Ko ! ar Louisiana State University September 14 th , 2010 Lecture - VII Unix Process Environment In Today’s Class • Unix Process Environment Process Concept ps -- get process info 2 3 Process Concept • a Process is a program in execution ; Typical process image implementation Stal ings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). ! A process image consists of three components 1. an executable program 2. the associated data needed by the program 3. the execution context of the process, which contains all information the O/S needs to manage the process (ID, state, CPU registers, stack, etc.) user address space Process Control Block 4 ! The Process Control Block (PCB) Typical process image implementation " is included in the context, along with the stack " is a “snapshot” that contains all necessary and sufficient data to restart a process where it left off (ID, state, CPU registers, etc.) " is one entry in the operating system’s process table (array or linked list) PCB 1 PCB 2 PCB 3 . . . context user address space program code data stack process control block (PCB) Process Control Block 5 Illustrative contents of a process image in (virtual) memory ! Example of process and PCB location in memory O/S process 2 process 1 context program code data program code data stack process control block (PCB) identification program code data stack CPU state info control info stack • numeric identifier • parent identifier • user identifier • etc. • user-visible registers • control & status registers • program counter • stack pointers, etc. • links to other proc’s • memory limits • open files • etc. 6 Process State As a process executes, it changes state new : The process is being created ready : The process is waiting to be assigned to a process running : Instructions are being executed waiting : The process is waiting for some event to occur terminated : The process has finished execution
Background image of page 1

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

View Full DocumentRight Arrow Icon
$ ps PID TTY TIME CMD 18684 pts/4 00:00:00 bash 18705 pts/4 00:00:00 ps 7 $ ps a PID TTY STAT TIME COMMAND 6702 tty7 Ss+ 15:10 /usr/X11R6/bin/X :0 -audit 0 7024 tty1 Ss+ 0:00 /sbin/mingetty --noclear tty1 7025 tty2 Ss+ 0:00 /sbin/mingetty tty2 7026 tty3 Ss+ 0:00 /sbin/mingetty tty3 7027 tty4 Ss+ 0:00 /sbin/mingetty tty4 7028 tty5 Ss+ 0:00 /sbin/mingetty tty5 7029 tty6 Ss+ 0:00 /sbin/mingetty tty6 17166 pts/6 Ss 0:00 -bash 17191 pts/6
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2011 for the course CSC 4303 taught by Professor Staff during the Fall '10 term at LSU.

Page1 / 5

07-Unix_Process_Env - CSC 4304 - Systems Programming Fall...

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

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