CS Advanced Operating Systems Structures and Implementation Lecture 4. OS Structure (Con t) Modern Architecture.

Size: px
Start display at page:

Download "CS Advanced Operating Systems Structures and Implementation Lecture 4. OS Structure (Con t) Modern Architecture."

Transcription

1 Goals for Today CS Advanced Operating Systems Structures and Implementation Lecture 4 OS Structure (Con t) Modern Architecture February 6 th, 2013 Prof. John Kubiatowicz OS Structure (Con t): The Linux Kernel Modern Computer Architecture Interactive is important! Ask Questions! Note: Some slides and/or pictures in the following are adapted from slides 2013 Lec 4.2 Recall: OS Resources at the center of it all! What do modern OSs do? Why all of these pieces running together? Is this complexity necessary? Control of Resources Access/No Access/ Partial Access» Check every access to see if it is allowed Resource Multiplexing» When multiple valid requests occur at same time how to multiplex access?» What fraction of resource can requester get? Performance Isolation» Can requests from one entity prevent requests from another? What or Who is a requester??? Process? User? Public Key? Think of this as a Principle Independent Requesters Access Control and Multiplexing Lec 4.3 Monolithic Kernel Recall: Microkernel Structure Figure Wikipedia Moves as much from the kernel into user space Small core OS running at kernel level OS Services built from many independent user-level processes Communication between modules with message passing Benefits: Easier to extend a microkernel Easier to port OS to new architectures More reliable (less code is running in kernel mode) Fault Isolation (parts of kernel protected from other parts) More secure Detriments: Performance overhead severe for naïve implementation Microkernel Lec 4.4

2 Recall: Modules-based Structure Most modern operating systems implement modules Uses object-oriented approach Each core component is separate Each talks to the others over known interfaces Each is loadable as needed within the kernel Overall, similar to layers but with more flexible Recall: ExoKernel Provide extremely thin layer to present hardware resources directly to users As little abstraction as possible Only Protection and Multiplexing of resources On top of Exokernel is the LibraryOS which provides much of the traditional functionality of OS in Library Low-level abstraction layer Lec 4.5 Lec 4.6 Concurrency The Basic Problem of Concurrency Thread of execution Independent Fetch/Decode/Execute loop Operating in some Address space Uniprogramming: one thread at a time MS/DOS, early Macintosh, Batch processing Easier for operating system builder Get rid concurrency by defining it away Does this make sense for personal computers? Multiprogramming: more than one thread at a time Multics, UNIX/Linux, OS/2, Windows NT/2000/XP, Mac OS X Often called multitasking, but multitasking has other meanings (talk about this later) ManyCore Multiprogramming, right? The basic problem of concurrency involves resources: Hardware: single CPU, single DRAM, single I/O devices Multiprogramming API: users think they have exclusive access to shared resources OS Has to coordinate all activity Multiple users, I/O interrupts, How can it keep all these things straight? Basic Idea: Use Virtual Machine abstraction Decompose hard problem into simpler ones Abstract the notion of an executing program Then, worry about multiplexing these abstract machines Dijkstra did this for the THE system Few thousand lines vs 1 million lines in OS 360 (1K bugs) Lec 4.7 Lec 4.8

3 Recall (61C): What happens during execution? R0 R31 F0 F30 PC Fetch Exec Execution sequence: Fetch Instruction at PC Decode Execute (possibly using registers) Write results to registers/mem PC = Next Instruction(PC) Repeat Addr Data1 Data0 Inst237 Inst236 Inst5 Inst4 Inst3 Inst2 Inst1 Inst0 Addr 0 PC PC PC PC Lec 4.9 How can we give the illusion of multiple processors? CPU1 CPU2 CPU3 Shared Memory CPU1 CPU2 CPU3 CPU1 CPU2 Time Assume a single processor. How do we provide the illusion of multiple processors? Multiplex in time! Each virtual CPU needs a structure to hold: Program Counter (PC), Stack Pointer (SP) Registers (Integer, Floating point, others?) How switch from one CPU to the next? Save PC, SP, and registers in current state block Load PC, SP, and registers from new state block What triggers switch? Timer, voluntary yield, I/O, other things Lec 4.10 Properties of this simple multiprogramming technique What needs to be saved in Modern X86? All virtual CPUs share same non-cpu resources I/O devices the same Memory the same Consequence of sharing: Each thread can access the data of every other thread (good for sharing, bad for protection) Threads can share instructions (good for sharing, bad for protection) Can threads overwrite OS functions? This (unprotected) model common in: Embedded applications Windows 3.1/Machintosh (switch only with yield) Windows 95 ME? (switch with both yield and timer) 64-bit Register Set Traditional 32-bit subset EFLAGS Register Lec 4.11 Lec 4.12

4 Modern Technique: SMT/Hyperthreading Hardware technique Exploit natural properties of superscalar processors to provide illusion of multiple processors Higher utilization of processor resources Can schedule each thread as if were separate CPU However, not linear speedup! If have multiprocessor, should schedule each processor first Original technique called Simultaneous Multithreading See Alpha, SPARC, Pentium 4 ( Hyperthreading ), Power 5 Chip-scale features of SandyBridge Significant pieces: Four OOO cores with Hyperthreads» New Advanced Vector extensions (256-bit FP)» AES instructions» Instructions to help with Galois-Field mult» 4 -ops/cycle Integrated GPU System Agent (Memory and Fast I/O) Shared L3 cache divided in 4 banks On-chip Ring bus network» Both coherent and non-coherent transactions» High-BW access to L3 Cache Integrated I/O Integrated memory controller (IMC)» Two independent channels of DDR3 DRAM High-speed PCI-Express (for Graphics cards) DMI Connection to SouthBridge (PCH) Lec 4.13 Lec 4.14 How to protect threads from one another? Recall: Program s Address Space Need three important things: 1. Protection of memory» Every task does not have access to all memory 2. Protection of I/O devices» Every task does not have access to every device 3. Protection of Access to Processor: Preemptive switching from task to task» Use of timer» Must not be possible to disable timer from usercode Address space the set of accessible addresses + state associated with them: For a 32-bit processor there are 2 32 = 4 billion addresses What happens when you read or write to an address? Perhaps Nothing Perhaps acts like regular memory Perhaps ignores writes Perhaps causes I/O operation» (Memory-mapped I/O) Perhaps causes exception (fault) Program Address Space Lec 4.15 Lec 4.16

5 Providing Illusion of Separate Address Space: Load new Translation Map on Switch X86 Memory model with segmentation Code Data Heap Stack Prog 1 Virtual Address Space 1 Data 2 Stack 1 Heap 1 Code 1 Stack 2 Data 1 Heap 2 Code 2 OS code Code Data Heap Stack Prog 2 Virtual Address Space 2 OS data Translation Map 1 Translation Map 2 OS heap & Stacks Physical Address Space Lec 4.17 Lec 4.18 The Six x86 Segment Registers UNIX Process CS - Code Segment SS - Stack Segment Stack segments are data segments which must be read/write segments. Loading the SS register with a segment selector for a nonwritable data segment generates a general-protection exception (#GP) DS - Data Segment ES/FS/GS - Extra (usually data) segment registers FS and GS used for thread-local storage/by glibc The hidden part is like a cache so that segment descriptor info doesn t have to be looked up each time. 19 Lec 4.19 Process: Operating system abstraction to represent what is needed to run a single program Originally: a single, sequential stream of execution in its own address space Modern Process: multiple threads in same address space! Two parts: Sequential Program Execution Streams» Code executed as one or more sequential stream of execution (threads)» Each thread includes its own state of CPU registers» Threads either multiplexed in software (OS) or hardware (simultaneous multithrading/hyperthreading) Protected Resources:» Main Memory State (contents of Address Space)» I/O state (i.e. file descriptors) This is a virtual machine abstraction Some might say that the only point of an OS is to support a clean Process abstraction Lec 4.20

6 How do we multiplex processes? The current state of process held in a process control block (PCB): This is a snapshot of the execution and protection environment Only one PCB active at a time Give out CPU time to different processes (Scheduling): Only one process running at a time Give more time to important processes Give pieces of resources to different processes (Protection): Controlled access to non-cpu resources Sample mechanisms:» Memory Mapping: Give each process their own address space» Kernel/User duality: Arbitrary multiplexing of I/O through system calls Process Control Block Modern Lightweight Process with Threads Thread: a sequential execution stream within process (Sometimes called a Lightweight process ) Process still contains a single Address Space No protection between threads Multithreading: a single program made up of a number of different concurrent activities Sometimes called multitasking, as in Ada Why separate the concept of a thread from that of a process? Discuss the thread part of a process (concurrency) Separate from the address space (Protection) Heavyweight Process Process with one thread Lec 4.21 Lec 4.22 Single and Multithreaded Processes Threads encapsulate concurrency: Active component Address spaces encapsulate protection: Passive part Keeps buggy program from trashing the system Why have multiple threads per address space? Preview: System-Level Control of x86 Full support for Process Abstraction involves a lot of system-level state This is state that can only be accessed in kernel mode! We will be talking about a number of these pieces as we go through the term There is a tradeoff between amount of system state and cost of switching from thread to thread! Lec 4.23 Lec 4.24

7 Additional system state for I/O Linux Structure SandyBridge System Configuration Platform Controller Hub Used to be SouthBridge, but no NorthBridge now Connected to processor with proprietary bus» Direct Media Interface Code name Cougar Point for SandyBridge processors Types of I/O on PCH: USB Ethernet Audio BIOS support More PCI Express (lower speed than on Processor) Sata (for Disks) Lec 4.25 Lec 4.26 Layout of Linux Sources System Calls Layout of basic linux sources: ls arch/ drivers/ Kbuild modules.builtin samples/ usr/ block/ firmware/ kernel/ modules.order scripts/ virt/ COPYING fs/ lib/ Module.symvers security/ vmlinux* CREDITS include/ MAINTAINERS net/ sound/ vmlinux.o crypto/ init/ Makefile README System.map Documentation/ ipc/ mm/ REPORTING-BUGS tools/ Specific Directories: arch: Architecture-specific source block: Block I/O layer crypto: Crypto API Documentation: Kernel source Documentation drivers: Device drivers firmware: Device firmware needed to use certain drivers fs: The VFS and individual filesystems include: Kernel headers init: Kernel boot and initialization ipc: Interprocess Communication code kernel: Core subsystems, such as the scheduler lib: Helper routines mm: Memory management subsystem and the vm net: Networking subsystem samples: Sample, demonstrative code scripts: Scripts used to build the kernel security: Linux Security Module sound: Sound subsystem usr: Early user-space code (called initramfs) tools: Tools helpful for developing Linux virt: Virtualization infrastructure Challenge: Interaction Despite Isolation How to isolate processes and their resources» While still permitting them to request help from the kernel» Letting them interact with resources while maintaining usage policies such as security, QoS, etc Letting processes interact with one another in a controlled way» Through messages, shared memory, etc Enter the System Call interface Layer between the hardware and user-space processes Programming interface to the services provided by the OS Mostly accessed by programs via a high-level Application Program Interface (API) rather than directly Get at system calls by linking with libraries in glibc Call to printf() Printf() in the C library Write() system call Three most common APIs are: Win32 API for Windows POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X) Java API for the Java virtual machine (JVM) Lec 4.27 Lec 4.28

8 Example of System Call usage System call sequence to copy the contents of one file to another file: Many crossings of the User/Kernel boundary! The cost of traversing this boundary can be high Lec 4.29 Example: Use strace to trace syscalls prompt% strace wc production.log execve("/usr/bin/wc", ["wc", "production.log"], [/* 52 vars */]) = 0 brk(0) = 0x mmap(null, 4096, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_ANONYMOUS, -1, 0) = 0x7ff24b8f7000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=s_ifreg 0644, st_size=137151,...}) = 0 mmap(null, , PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff24b8d5000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\241,0\0\0\0"..., 832) = 832 fstat(3, {st_mode=s_ifreg 0755, st_size= ,...}) = 0 mmap(0x302ca00000, , PROT_READ PROT_EXEC, MAP_PRIVATE MAP_DENYWRITE, 3, 0) = 0x302ca00000 mprotect(0x302cb89000, , PROT_NONE) = 0 mmap(0x302cd89000, 20480, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_FIXED MAP_DENYWRITE, 3, 0x189000) = 0x302cd89000 mmap(0x302cd8e000, 18600, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_FIXED MAP_ANONYMOUS, -1, 0) = 0x302cd8e000 close(3) = 0 mmap(null, 4096, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_ANONYMOUS, -1, 0) = 0x7ff24b8d4000 mmap(null, 4096, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_ANONYMOUS, -1, 0) = 0x7ff24b8d3000 mmap(null, 4096, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_ANONYMOUS, -1, 0) = 0x7ff24b8d2000 arch_prctl(arch_set_fs, 0x7ff24b8d3700) = 0 mprotect(0x302cd89000, 16384, PROT_READ) = 0 mprotect(0x302c81f000, 4096, PROT_READ) = 0 munmap(0x7ff24b8d5000, ) = 0 brk(0) = 0x brk(0x19a8000) = 0x19a8000 open("/usr/lib/locale/locale-archive", O_RDONLY) = 3 fstat(3, {st_mode=s_ifreg 0644, st_size= ,...}) = 0 mmap(null, , PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff245a41000 close(3) = 0 stat("production.log", {st_mode=s_ifreg 0644, st_size=526550,...}) = 0 open("production.log", O_RDONLY) = 3 read(3, "# Logfile created on Fri Dec 28 "..., 16384) = open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 4 fstat(4, {st_mode=s_ifreg 0644, st_size=26060,...}) = 0 mmap(null, 26060, PROT_READ, MAP_SHARED, 4, 0) = 0x7ff24b8f0000 close(4) = 0 read(3, "m: cannot remove `/tmp/fixrepo/g"..., 16384) = read(3, "a36de93203e0b4972c1a3c81904e': P"..., 16384) = read(3, "xrepo/git-tess/gitolite-admin/.g"..., 16384) = Many repetitions of these reads read(3, "ixrepo/git-tess/gitolite-admin\n "..., 16384) = read(3, "ite/redmine/vendor/plugins/redmi"..., 16384) = read(3, "ited with positive recursionchec"..., 16384) = read(3, "ting changes to gitolite-admin r"..., 16384) = 2262 read(3, "", 16384) = 0 fstat(1, {st_mode=s_ifchr 0620, st_rdev=makedev(136, 3),...}) = 0 mmap(null, 4096, PROT_READ PROT_WRITE, MAP_PRIVATE MAP_ANONYMOUS, -1, 0) = 0x7ff24b8ef000 write(1, " production."..., production.log) = 36 close(3) = 0 close(1) = 0 munmap(0x7ff24b8ef000, 4096) = 0 close(2) = 0 exit_group(0) Lec 4.30 Example of Standard API System Call Implementation Typically, a number associated with each system call System-call interface maintains a table indexed according to these numbers The fact that the call is by number, is essential for security reasons! The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values Return value: often a long (integer)» Return of zero is usually a sign of success, but not always» Return of -1 is almost always reflects an error On error return code placed into global errno variable» Can translate into human-readable errors with the perror() call The caller need know nothing about how the system call is implemented Just needs to obey API and understand what OS will do as a result call Most details of OS interface hidden from programmer by API» Managed by run-time support library (set of functions built into libraries included with compiler) Lec 4.31 Lec 4.32

9 API System Call OS Relationship System Call Parameter Passing Often, more information is required than simply identity of desired system call Exact type and amount of information vary according to OS and call Three general methods used to pass parameters to the OS Simplest: pass the parameters in registers» In some cases, may be more parameters than registers Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register» This approach taken by Linux and Solaris Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system Block and stack methods do not limit the number or length of parameters being passed Lec 4.33 Lec 4.34 Parameter Passing via Table Types of System Calls Process control end, abort load, execute create process, terminate process get process attributes, set process attributes wait for time wait event, signal event allocate and free memory Kernel must always verify parameters passed to it by the user Are parameters in a reasonable range? Are memory addresses actually owned by the calling user (rather than bogus addresses) Dump memory if error Debugger for determining bugs, single step execution Locks for managing access to shared data between processes Lec 4.35 Lec 4.36

10 Types of System Calls File management create file, delete file open, close file read, write, reposition get and set file attributes Device management request device, release device read, write, reposition get device attributes, set device attributes logically attach or detach devices Types of System Calls (Cont.) Information maintenance get time or date, set time or date get system data, set system data get and set process, file, or device attributes Communications create, delete communication connection send, receive messages if message passing model to host name or process name» From client to server Shared-memory model create and gain access to memory regions transfer status information attach and detach remote devices Lec 4.37 Lec 4.38 Types of System Calls (Cont.) POSIX standard Protection Control access to resources Get and set permissions Allow and deny user access Lec 4.39 Portable Operating System Interface for UNIX» An attempt to standardize a UNIXy interface Conformance: IEEE POSIX and ISO/IEC 9945 Latest version from 2008 Originally one document consisting of a core programming inteface now 19 separate docs Many OSes provide partial conformance (including Linux) What does POSIX define? POSIX.1: Core Services» Process Creation and Control» Signals» Floating Point Exceptions, Segmentation/memory violations, illegal instructions, Bus Erors» Timers» File and Directory Operations» Pipes» C Library (Standard C)» I/O Port Interface and Control» Process Triggers POSIX.1b: Realtime Extensions POSIX.2: Shell and Utilities Lec 4.40

11 POSIX (cont) Process Primitives: fork, execl, execlp, execv, execve, execvp, wit, waitpid _exit, kill, sigxxx, alarm, pause, sleep. Example file access primitives: opendir, readdir, rewinddir, closedir, chdir, getcwd, open, creat, umask, link, mkdir, unlink, rmdir, rename, stat, fstat, access, fchmod, chown, utime, ftruncate,pathconf,fpathconf I/O primitives: pipe, dup, dup2, close, read, write, fcntl, lseek, fsync C-Language primitives: abort, exit, fclose, fdopen, fflush, fgetc, fgets, fileno, fopen, fprintf, fputc, fputs, fread, freopen, fscanf, fseek, ftell, fwrite, getc, getchar, gets, perror, printf, putc, putchar, puts, remove, rewind, scanf, setlocale, siglongjmp, sigsetjmp, tmpfile, tmpnam, tzset Synchronization: sem_init, sem_destroy, sem_wait, sem_trywait, sem_post, pthread_mutex_init, pthread_mutex_destroy, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock Memory Management mmap, mprotect, msync, munmap ETC How to get information on a system call? Type man callname, i.e. man open System calls are in section 2 of the man pages Portability POSIX does provide some portability But is still pretty high level Does not specify file systems, network interfaces, power management, other important things Many variations in compilers, user programs, libraries, other build environment aspects UNIX Portability: C-preprocessor conditional compilation Conditional and multi-target Makefile Rules GNU configure scripts to generate Makefiles Shell environment variables (LD_LIBRARY_PATH, LD_PRELOAD, others) Lec 4.41 Lec 4.42 Examples of Windows and Unix System Calls Standard C Library Example C program invoking printf() library call, which calls write() system call Lec 4.43 Lec 4.44

12 Summary Processes have two parts Threads (Concurrency) Address Spaces (Protection) Concurrency accomplished by multiplexing CPU Time: Unloading current thread (PC, registers) Loading new thread (PC, registers) Such context switching may be voluntary (yield(), I/O operations) or involuntary (timer, other interrupts) Protection accomplished restricting access: Memory mapping isolates processes from each other Dual-mode for isolating I/O, other resources System-Call interface This is the I/O for the process virtual machine Accomplished with special trap instructions which vector off a table of system calls Usually programmers use the standard API provided by the C library rather than direct system-call interface POSIX interface An attempt to standardize unixy Oses Lec 4.45

Disciplina Sistemas de Computação

Disciplina Sistemas de Computação Aula 09 Disciplina Sistemas de Computação Operating System Roles (recall) OS as a Traffic Cop: Manages all resources Settles conflicting requests for resources Prevent errors and improper use of the computer

More information

CS162 Operating Systems and Systems Programming Lecture 3. Concurrency: Processes, Threads, and Address Spaces. Review: History of OS

CS162 Operating Systems and Systems Programming Lecture 3. Concurrency: Processes, Threads, and Address Spaces. Review: History of OS Review: History of OS CS162 Operating Systems and Systems Programming Lecture 3 Concurrency: Processes, Threads, and Address Spaces September 8, 2008 Prof. John Kubiatowicz http://inst.eecs.berkeley.edu/~cs162

More information

Introduction to Operating Systems (Part III)

Introduction to Operating Systems (Part III) Introduction to Operating Systems (Part III) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/29 1 / 43 Operating

More information

Page 1. Virtual Machines (Recap)" Nachos: Virtual OS Environment" System Virtual Machines: Layers of OSs"

Page 1. Virtual Machines (Recap) Nachos: Virtual OS Environment System Virtual Machines: Layers of OSs Virtual Machines (Recap)" CS162 Operating Systems and Systems Programming Lecture 2 Concurrency: Processes, Threads, and Address Spaces" August 29, 2012! Ion Stoica! http://inst.eecs.berkeley.edu/~cs162!

More information

Chapter 5: Threads. Outline

Chapter 5: Threads. Outline Department of Electr rical Eng ineering, Chapter 5: Threads 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline Overview Multithreading Models Threading Issues 2 Depar

More information

Page 1. Virtual Machines (Recap)" Nachos: Virtual OS Environment (Recap)" System VMs: Layers of OSs (Recap)"

Page 1. Virtual Machines (Recap) Nachos: Virtual OS Environment (Recap) System VMs: Layers of OSs (Recap) Virtual Machines (Recap)" CS162 Operating Systems and Systems Programming Lecture 2 Concurrency: Processes, Threads, and Address Spaces" January 28, 2013! Anthony D. Joseph! http://inst.eecs.berkeley.edu/~cs162!

More information

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring Lecture 2 Fundamental OS Concepts Bo Tang @ 2018, Spring Our Roadmap Computer Organization Revision Kernel Data Structures in OS OS History Four fundamental OS concepts Thread Address space (with translation)

More information

File System User API

File System User API File System User API Blunk Microsystems file system API includes the file-related routines from Standard C and POSIX, as well as a number of non-standard functions that either meet a need unique to embedded

More information

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 4, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts

More information

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023 Operating Systems Autumn 2017-2018 Outline 1 2 3 Types of 2.4, SGG The OS Kernel The kernel is the central component of an OS It has complete control over everything that occurs in the system Kernel overview

More information

Operating-System Structures

Operating-System Structures Operating-System Structures Chapter 2 Operating System Services One set provides functions that are helpful to the user: User interface Program execution I/O operations File-system manipulation Communications

More information

Chapter 2. Operating-System Structures

Chapter 2. Operating-System Structures Chapter 2 Operating-System Structures 2.1 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

The Software Platform consists of device stacks and software services. This section describes both parts and how they are related to each other.

The Software Platform consists of device stacks and software services. This section describes both parts and how they are related to each other. Organization of the Software Platform Frozen Content Modified by Admin on Sep 13, 2017 Introduction to the Software Platform Organization of the Software Platform Using the Software Platform Builder Glossary

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

Page 1. CS162 Operating Systems and Systems Programming Lecture 3. Concurrency: Processes, Threads, and Address Spaces

Page 1. CS162 Operating Systems and Systems Programming Lecture 3. Concurrency: Processes, Threads, and Address Spaces History Phase 4 (1988 ): Internet CS162 Operating Systems and Systems Programming Lecture 3 Concurrency: Processes, Threads, and Address Spaces January 26, 2010 Ion Stoica http://inst.eecs.berkeley.edu/~cs162

More information

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 2: SYSTEM STRUCTURES By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 2: System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University Architectural Support for Operating Systems Jinkyu Jeong ( jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Basic services of OS Basic computer system

More information

Four Components of a Computer System

Four Components of a Computer System Four Components of a Computer System Operating System Concepts Essentials 2nd Edition 1.1 Silberschatz, Galvin and Gagne 2013 Operating System Definition OS is a resource allocator Manages all resources

More information

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition Chapter 2: Operating-System Structures Operating System Concepts Essentials 8 th Edition Silberschatz, Galvin and Gagne 2011 Chapter 2: Operating-System Structures Operating System Services User Operating

More information

Chapter 2: Operating-System

Chapter 2: Operating-System Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services! User Operating System Interface! System Calls! Types of System Calls! System Programs! Operating

More information

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition Chapter 2: Operating-System Structures Silberschatz, Galvin and Gagne 2013 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on Chapter 2: Operating-System Structures Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Objectives To describe the services an operating system provides to users, processes, and

More information

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Chapter 2: System Structures. Operating System Concepts 9 th Edition Chapter 2: System Structures Silberschatz, Galvin and Gagne 2013 Chapter 2: System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs

More information

Processes and Threads

Processes and Threads COS 318: Operating Systems Processes and Threads Kai Li and Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall13/cos318 Today s Topics u Concurrency

More information

Chapter 2: Operating-System Structures. Operating System Concepts 8 th Edition

Chapter 2: Operating-System Structures. Operating System Concepts 8 th Edition Chapter 2: Operating-System Structures Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009 Chapter 2: Operating-System Structures Different Services of Operating System. System Calls-

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

CS420: Operating Systems. OS Services & System Calls

CS420: Operating Systems. OS Services & System Calls OS Services & System Calls James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Operating

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 5 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 User Operating System Interface - CLI CLI

More information

Debugging: Love It, Hate It Or Reverse It?

Debugging: Love It, Hate It Or Reverse It? Debugging: Love It, Hate It Or Reverse It? Debugging: Love It, Hate It Or Reverse It?. Julian Smith, co-founder and CTO, Undo. jsmith@undo.io http://undo.io/ Overview Testing. Debugging: Debugging with

More information

CS 326: Operating Systems. Process Execution. Lecture 5

CS 326: Operating Systems. Process Execution. Lecture 5 CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation

More information

CS Advanced Operating Systems Structures and Implementation Lecture 5. Processes. Goals for Today

CS Advanced Operating Systems Structures and Implementation Lecture 5. Processes. Goals for Today Goals for Today CS194-24 Advanced Operating Systems Structures and Implementation Lecture 5 Processes February 11 th, 2013 Prof. John Kubiatowicz http://inst.eecs.berkeley.edu/~cs194-24 Processes Fork/Exec

More information

Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as

Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as System call Overview 2 Operating systems offer processes running in User Mode a set of interfaces to interact with hardware devices such as the CPU disks printers Unix systems implement most interfaces

More information

CSE 333 Lecture 8 - system calls, intro to file I/O

CSE 333 Lecture 8 - system calls, intro to file I/O CSE 333 Lecture 8 - system calls, intro to file I/O Steve Gribble Department of Computer Science & Engineering University of Washington A question from last lecture If you use the static specifier to declare

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls (important!) Types of System Calls (important!) System

More information

Lecture 2 - Fundamental Concepts

Lecture 2 - Fundamental Concepts Lecture 2 - Fundamental Concepts Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 43 Lecture Outline Operating

More information

W4118 Operating Systems. Junfeng Yang

W4118 Operating Systems. Junfeng Yang W4118 Operating Systems Junfeng Yang What is a process? Outline Process dispatching Common process operations Inter-process Communication What is a process Program in execution virtual CPU Process: an

More information

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. Operating System Services User Operating System Interface

More information

Distributed Systems Operation System Support

Distributed Systems Operation System Support Hajussüsteemid MTAT.08.009 Distributed Systems Operation System Support slides are adopted from: lecture: Operating System(OS) support (years 2016, 2017) book: Distributed Systems: Concepts and Design,

More information

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved. Processes Prof. James L. Frankel Harvard University Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved. Process Model Each process consists of a sequential program

More information

Lecture 2 Operating System Structures (chapter 2)

Lecture 2 Operating System Structures (chapter 2) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 2 Operating System Structures (chapter 2) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The

More information

System Call. Preview. System Call. System Call. System Call 9/7/2018

System Call. Preview. System Call. System Call. System Call 9/7/2018 Preview Operating System Structure Monolithic Layered System Microkernel Virtual Machine Process Management Process Models Process Creation Process Termination Process State Process Implementation Operating

More information

System Call System Program Linker/Loader with Examples Types of computing Environment

System Call System Program Linker/Loader with Examples Types of computing Environment CS341: Operating System Lect06 : 13 th Aug 2014 System Program Linker/Loader with Examples Types of computing Environment Dr A Sahu Dept of Comp Sc & Engg Indian Institute of Technology Guwahati 1 2 OS

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Operating System Structures [SGG7] Chapter 2 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin

More information

Operating System Services

Operating System Services CSE325 Principles of Operating Systems Operating System Services David Duggan dduggan@sandia.gov January 22, 2013 Reading Assignment 3 Chapter 3, due 01/29 1/23/13 CSE325 - OS Services 2 What Categories

More information

Operating System Architecture. CS3026 Operating Systems Lecture 03

Operating System Architecture. CS3026 Operating Systems Lecture 03 Operating System Architecture CS3026 Operating Systems Lecture 03 The Role of an Operating System Service provider Provide a set of services to system users Resource allocator Exploit the hardware resources

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures 2.1 Silberschatz, Galvin and Gagne 2009 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011 Threads Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011 Threads Effectiveness of parallel computing depends on the performance of the primitives used to express

More information

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and What are the services provided by an OS? What are system calls? What are some common categories of system calls? What are the principles behind OS design and implementation? What are common ways of structuring

More information

Design Overview of the FreeBSD Kernel CIS 657

Design Overview of the FreeBSD Kernel CIS 657 Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler (2%

More information

CSE 333 Lecture 6 - system calls, intro to file I/O

CSE 333 Lecture 6 - system calls, intro to file I/O CSE 333 Lecture 6 - system calls, intro to file I/O Hal Perkins Department of Computer Science & Engineering University of Washington Administrivia New exercise posted this morning, due before class Fri.

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Silberschatz, Galvin and Gagne 2009 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

Lecture 4: Threads; weaving control flow

Lecture 4: Threads; weaving control flow Lecture 4: Threads; weaving control flow CSE 120: Principles of Operating Systems Alex C. Snoeren HW 1 Due NOW Announcements Homework #1 due now Project 0 due tonight Project groups Please send project

More information

Operating System Structure

Operating System Structure Operating System Structure Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission Recap: Memory Hierarchy Fast, Expensive Slow, Inexpensive 2 Recap Architectural support

More information

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services Objectives Chapter 2: Operating-System Structures To describe the services an operating system provides to users, processes, and other systems To discuss the various ways of structuring an operating system

More information

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 General Info 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

More information

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals General Info EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

More information

Process Description and Control

Process Description and Control Process Description and Control 1 Process:the concept Process = a program in execution Example processes: OS kernel OS shell Program executing after compilation www-browser Process management by OS : Allocate

More information

UNIT I Linux Utilities

UNIT I Linux Utilities UNIT I Linux Utilities 1. a) How does Linux differ from Unix? Discuss the features of Linux. 5M b) Explain various text processing utilities, with a suitable example for each. 5M 2. a) Explain briefly

More information

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

CSCI 6411: Operating Systems. Acknowledgements: Some slide material derived from Silberschatz, et al.

CSCI 6411: Operating Systems. Acknowledgements: Some slide material derived from Silberschatz, et al. CSCI 6411: Operating Systems Acknowledgements: Some slide material derived from Silberschatz, et al. High level Cars Computers ...details... Cars Computers ... low level Cars Computers What is an Operating

More information

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD OPERATING SYSTEMS #2 After A.S.Tanenbaum, Modern Operating Systems, 3rd edition Uses content with permission from Assoc. Prof. Florin Fortis, PhD INTRODUCTION Operating systems structure OPERATING SYSTEM

More information

CSE 153 Design of Operating Systems Fall 2018

CSE 153 Design of Operating Systems Fall 2018 CSE 153 Design of Operating Systems Fall 2018 Lecture 4: Processes (2) Threads Process Creation: Unix In Unix, processes are created using fork() int fork() fork() Creates and initializes a new PCB Creates

More information

CS 5460/6460 Operating Systems

CS 5460/6460 Operating Systems CS 5460/6460 Operating Systems Fall 2009 Instructor: Matthew Flatt Lecturer: Kevin Tew TAs: Bigyan Mukherjee, Amrish Kapoor 1 Join the Mailing List! Reminders Make sure you can log into the CADE machines

More information

Chapter 2: System Structures

Chapter 2: System Structures Chapter 2: Operating System Structures Operating System Services System Calls Chapter 2: System Structures System Programs Operating System Design and Implementation Operating System Structure Virtual

More information

Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process

Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation Why are threads useful? How does one use POSIX pthreads? Michael Swift 1 2 What s in a process? Organizing a Process A process

More information

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation CSE 421/521 - Operating Systems Fall 2013 Lecture - II OS Structures Tevfik Koşar University at Buffalo August 29 th, 2013 1 Roadmap OS Design and Implementation Different Design Approaches Major OS Components!

More information

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013 CSE 421/521 - Operating Systems Fall 2013 Lecture - II OS Structures Roadmap OS Design and Implementation Different Design Approaches Major OS Components!! Memory management! CPU Scheduling! I/O Management

More information

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Processes and Non-Preemptive Scheduling. Otto J. Anshus Processes and Non-Preemptive Scheduling Otto J. Anshus Threads Processes Processes Kernel An aside on concurrency Timing and sequence of events are key concurrency issues We will study classical OS concurrency

More information

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Chapter 2: System Structures. Operating System Concepts 9 th Edition Chapter 2: System Structures Silberschatz, Galvin and Gagne 2013 Chapter 2: System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs

More information

Lecture 4: Memory Management & The Programming Interface

Lecture 4: Memory Management & The Programming Interface CS 422/522 Design & Implementation of Operating Systems Lecture 4: Memory Management & The Programming Interface Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken

More information

Operating System Structure

Operating System Structure Operating System Structure Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission Recap OS needs to understand architecture Hardware (CPU, memory, disk) trends and

More information

Operating Systems Overview. Chapter 2

Operating Systems Overview. Chapter 2 Operating Systems Overview Chapter 2 Operating System A program that controls the execution of application programs An interface between the user and hardware Masks the details of the hardware Layers and

More information

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007. CSC 4103 - Operating Systems Spring 2008 Lecture - II OS Structures Tevfik Ko!ar Louisiana State University January 17 th, 2007 1 Announcements Teaching Assistant: Asim Shrestrah Email: ashres1@lsu.edu

More information

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar CSC 4103 - Operating Systems Spring 2008 Lecture - II OS Structures Tevfik Ko!ar Teaching Assistant: Asim Shrestrah Email: ashres1@lsu.edu Announcements All of you should be now in the class mailing list.

More information

Chapter 2: System Structures

Chapter 2: System Structures Chapter 2: System Structures Chapter 2: System Structures 2.1 Operating-System Services 2.2 User and Operating-System Interface 2.3 System Calls 2.4 Types of System Calls 2.5 System Programs 2.6 Operating-System

More information

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent? Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler

More information

Mon Sep 17, 2007 Lecture 3: Process Management

Mon Sep 17, 2007 Lecture 3: Process Management Mon Sep 17, 2007 Lecture 3: Process Management September 19, 2007 1 Review OS mediates between hardware and user software QUIZ: Q: Name three layers of a computer system where the OS is one of these layers.

More information

DEBUGGING: TESTING WS 2017/2018. Martina Seidl Institute for Formal Models and Verification

DEBUGGING: TESTING WS 2017/2018. Martina Seidl Institute for Formal Models and Verification DEBUGGING: TESTING WS 2017/2018 Martina Seidl Institute for Formal Models and Verification Testing is a Huge Field... 1/42 Costs of Defective Software 2/42 Testing Testing is the execution of a program

More information

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Fall 2015 Lecture 4: Threads Geoffrey M. Voelker Announcements Project 0 due Project 1 out October 6, 2015 CSE 120 Lecture 4 Threads 2 Processes Recall that a process

More information

csci3411: Operating Systems

csci3411: Operating Systems csci3411: Operating Systems Lecture 3: System structure and Processes Gabriel Parmer Some slide material from Silberschatz and West System Structure System Structure How different parts of software 1)

More information

Chapter 2 Operating-System Structures

Chapter 2 Operating-System Structures This chapter will discuss the following concepts: 2.1 Operating System Services 2.2 User Operating System Interface 2.3 System Calls 2.4 System Programs 2.5 Operating System Design and Implementation 2.6

More information

What s in a process?

What s in a process? CSE 451: Operating Systems Winter 2015 Module 5 Threads Mark Zbikowski mzbik@cs.washington.edu Allen Center 476 2013 Gribble, Lazowska, Levy, Zahorjan What s in a process? A process consists of (at least):

More information

Processes and Exceptions

Processes and Exceptions Princeton University Computer Science 217: Introduction to Programming Systems Processes and Exceptions Much of the material for this lecture is drawn from Computer Systems: A Programmer s Perspective

More information

Protection and System Calls. Otto J. Anshus

Protection and System Calls. Otto J. Anshus Protection and System Calls Otto J. Anshus Protection Issues CPU protection Prevent a user from using the CPU for too long Throughput of jobs, and response time to events (incl. user interactive response

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Spring 2009 Lecture 4: Threads Geoffrey M. Voelker Announcements Homework #1 due now Project 0 due tonight Project 1 out April 9, 2009 CSE 120 Lecture 4 Threads

More information

Operating-System Structures

Operating-System Structures Recap Chapter 2: Operating-System Structures Presented By: Dr. El-Sayed M. El-Alfy Note: Most of the slides are compiled from the textbook and its complementary resources From: OS by Tanenbaum, 2008 March

More information

Processes. Johan Montelius KTH

Processes. Johan Montelius KTH Processes Johan Montelius KTH 2017 1 / 47 A process What is a process?... a computation a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other

More information

What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System

What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System What Is Operating System? Operating Systems, System Calls, and Buffered I/O emacs gcc Browser DVD Player Operating System CS 217 1 Abstraction of hardware Virtualization Protection and security 2 Academic

More information

Architectural Support for OS

Architectural Support for OS Architectural Support for OS Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3052: Introduction to Operating Systems, Fall 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

A process. the stack

A process. the stack A process Processes Johan Montelius What is a process?... a computation KTH 2017 a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other processes

More information

10/10/ Gribble, Lazowska, Levy, Zahorjan 2. 10/10/ Gribble, Lazowska, Levy, Zahorjan 4

10/10/ Gribble, Lazowska, Levy, Zahorjan 2. 10/10/ Gribble, Lazowska, Levy, Zahorjan 4 What s in a process? CSE 451: Operating Systems Autumn 2010 Module 5 Threads Ed Lazowska lazowska@cs.washington.edu Allen Center 570 A process consists of (at least): An, containing the code (instructions)

More information

Exceptions and Processes

Exceptions and Processes Exceptions and Processes Much of the material for this lecture is drawn from Computer Systems: A Programmer s Perspective (Bryant & O Hallaron) Chapter 8 1 Goals of this Lecture Help you learn about: Exceptions

More information

Threads Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Threads Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Threads Implementation Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics How to implement threads? User-level threads Kernel-level

More information

2 Processes. 2 Processes. 2 Processes. 2.1 The Process Model. 2.1 The Process Model PROCESSES OPERATING SYSTEMS

2 Processes. 2 Processes. 2 Processes. 2.1 The Process Model. 2.1 The Process Model PROCESSES OPERATING SYSTEMS OPERATING SYSTEMS PROCESSES 2 All modern computers often do several things at the same time. A modern operating system sees each software as a process. When a user PC is booted, many processes are secretly

More information

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed Process Management CS 537 Lecture 3: Processes Michael Swift This lecture begins a series of topics on processes, threads, and synchronization Today: processes and process management what are the OS units

More information

Killing Zombies, Working, Sleeping, and Spawning Children

Killing Zombies, Working, Sleeping, and Spawning Children Killing Zombies, Working, Sleeping, and Spawning Children CS 333 Prof. Karavanic (c) 2015 Karen L. Karavanic 1 The Process Model The OS loads program code and starts each job. Then it cleans up afterwards,

More information

Architectural Support for Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Architectural Support for Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Architectural Support for Operating Systems Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Basic structure of OS Basic computer

More information