Lec04 - Computer Science Lecture 4, page 1 Computer Science...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Computer Science Lecture 4, page 1 Computer Science CS377: Operating Systems The Big Picture So Far From the Architecture to the OS to the User : Architectural resources, OS management, and User Abstractions. Hardware abstraction Example OS Services User abstraction Processor Process management, Scheduling, Traps, protection, accounting, synchronization Process Memory Management, Protection, virtual memory Address spaces I/O devices Concurrency with CPU, Interrupt handling Terminal, mouse, printer, system calls File System File management, Persistence Files Distributed systems Networking, security, distributed file system Remote procedure calls, network file system Computer Science Lecture 4, page 2 Computer Science CS377: Operating Systems Today: Process Management A process as the unit of execution. How are processes represented in the OS? What are possible execution states and how does the system move from one state to another? How do processes communicate? Is this efficient? Computer Science Lecture 4, page 3 Computer Science CS377: Operating Systems What's in a Process? Process : dynamic execution context of an executing program Several processes may run the same program, but each is a distinct process with its own state (e.g., MS Word). A process executes sequentially, one instruction at a time Process state consists of at least: ! the code for the running program, ! the static data for the running program, ! space for dynamic data (the heap), the heap pointer (HP), ! the Program Counter (PC), indicating the next instruction, ! an execution stack with the program's call chain (the stack), the stack pointer (SP) ! values of CPU registers ! a set of OS resources in use (e.g., open files) ! process execution state (ready, running, etc.). Computer Science Lecture 4, page 4 Computer Science CS377: Operating Systems Example Process State in Memory What you wrote: void X (int b){ if ( b == 1 ) } main(){ int a = 2; X ( a ); } Whats in memory PC -> Computer Science Lecture 4, page 5 Computer Science CS377: Operating Systems Process Execution State Execution state of a process indicates what it is doing new: the OS is setting up the process state running: executing instructions on the CPU ready: ready to run, but waiting for the CPU waiting: waiting for an event to complete terminated: the OS is destroying this process As the program executes, it moves from state to state, as a result of the program actions (e.g., system calls), OS actions (scheduling), and external actions (interrupts). Computer Science Lecture 4, page 6 Computer Science CS377: Operating Systems Process Execution State state sequence new Example: ready running void main() { waiting for I/O printf(Hello World); ready } running terminated The OS manages multiple active process using state queues (More on this in a minute) Computer Science Lecture 4, page 7 Computer Science CS377: Operating Systems Process Data Structures Process Control Block (PCB):...
View Full Document

Page1 / 12

Lec04 - Computer Science Lecture 4, page 1 Computer Science...

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

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