review-14 - CS 414 Review Operating System: Definition...

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

View Full Document Right Arrow Icon
CS 414 Review
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Operating System: Definition Definition An Operating System (OS) provides a virtual machine on top of the real hardware, whose interface is more convenient than the raw hardware interface. Hardware Applications Operating System OS interface Physical machine interface Advantages Easy to use, simpler to code, more reliable, more secure, … You can say: “I want to write XYZ into file ABC”
Background image of page 2
3 What is in an OS? Operating System Services Interrupts, Cache, Physical Memory, TLB, Hardware Devices Generic I/O File System Memory Management Process Management Virtual Memory Networking Naming Access Control Windowing & graphics Windowing & Gfx Applications OS Interface Physical m/c Intf Device Drivers Shells System Utils Quake Sql Server Logical OS Structure
Background image of page 3

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

View Full DocumentRight Arrow Icon
Crossing Protection Boundaries User calls OS procedure for “privileged” operations Calling a kernel mode service from user mode program: Using System Calls System Calls switches execution to kernel mode User process System Call Trap Mode bit = 0 Save Caller’s state Execute system call Restore state Return Mode bit = 1 Resume process User Mode Mode bit = 1 Kernel Mode Mode bit = 0
Background image of page 4
5 What is a process? The unit of execution The unit of scheduling Thread of execution + address space Is a program in execution Sequential, instruction-at-a-time execution of a program. The same as “job” or “task” or “sequential process”
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Process State Transitions New Ready Running Exit Waiting admitted interrupt I/O or event wait I/O or event completion dispatch done Processes hop across states as a result of: Actions they perform, e.g. system calls Actions performed by OS, e.g. rescheduling External actions, e.g. I/O
Background image of page 6
7 Context Switch For a running process All registers are loaded in CPU and modified • E.g. Program Counter, Stack Pointer, General Purpose Registers When process relinquishes the CPU, the OS Saves register values to the PCB of that process To execute another process, the OS Loads register values from PCB of that process Context Switch - Process of switching CPU from one process to another - Very machine dependent for types of registers
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Threads and Processes Most operating systems therefore support two entities: the process , • which defines the address space and general process attributes the thread , which defines a sequential execution stream within a process A thread is bound to a single process. For each process, however, there may be many threads. Threads are the unit of scheduling Processes are containers in which threads execute
Background image of page 8
9 Schedulers Process migrates among several queues Device queue, job queue, ready queue Scheduler selects a process to run from these queues Long-term scheduler: load a job in memory Runs infrequently Short-term scheduler: Select ready process to run on CPU Should be fast Middle-term scheduler Reduce multiprogramming or memory consumption
Background image of page 9

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

View Full DocumentRight Arrow Icon
10
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2008 for the course CS 4410 taught by Professor Vollset during the Fall '07 term at Cornell University (Engineering School).

Page1 / 110

review-14 - CS 414 Review Operating System: Definition...

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

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