CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Mar 12 and 14. Winter Session 2017, Term 2

Size: px
Start display at page:

Download "CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Mar 12 and 14. Winter Session 2017, Term 2"

Transcription

1 CPSC 213 Introduction to Computer Systems Winter Session 2017, Term 2 Unit 2a Mar 12 and 14 I/O Devices, Interrupts and DMA

2 Overview Reading in Text 8.1, 8.2.1, Learning Goals Explain what PIO is, why it exists, what processor originates it, and how it is used Explain what DMA is, why it exists, what it does, and what processor originates it Explain what an interrupt is, why it exists, what it does, and what processor originates it Compare PIO and DMA by identifying when each can be used and when each should be used Compare PIO and interrupts by identify when each can be used and when each should be used Explain the relationship between polling, PIO and interrupts Explain the conditions that make polling acceptable or not Explain what happens when an interrupt occurs at the hardware level Explain what is means for an operation such as a disk read to be asynchronous and give examples of code that works when an operation is synchronous but does not work with it is asynchronous Write event-driven programs in C using function pointers Describe why event-driven programs may be harder to write, read, and debug 2

3 Looking Beyond the CPU and Memory CPU The Processors Memory Bus I/O Bus I/O Controllers Memory I/O Devices Memory Bus data/control path connecting CPU, Main Memory, and I/O Bus also called the Front Side Bus I/O Bus data/control path connecting Memory Bus and I/O Controllers e.g., PCI I/O Controller a processor running software (firmware) connects I/O Device to I/O Bus e.g.,scsi, SATA, Ethernet, I/O Device I/O mechanism that generates or consumes data e.g., disk, radio, keyboard, mouse, 3

4 Talking to an I/O Controller read 0x read 0x1000 addresses 0x0-0x7fffffff 0x x800000ff Programmed I/O (PIO) CPU transfers a word at a time between CPU and I/O controller typically use standard load/store instructions, but to I/O-mapped memory I/O-Mapped Memory memory addresses beyond the end of main memory used to name I/O controllers (usually configured at boot time) loads and stores are translated into I/O-bus messages to controller Example to read/write to controller at address 0x x x800004ff Real Memory I/O Memory ld $0x , r0 st r1 (r0) ld (r0), r1 # write the value of r1 to the device # read a word from device into r1 4

5 Limitations of PIO Reading or writing large amounts of data slows CPU requires CPU to transfer one word at a time controller/device is much slower than CPU and so, CPU runs at controller/device speed, mostly waiting for controller IO Controller can not initiate communication sometimes the CPU asks for data but, sometimes controller receives data for the CPU, without CPU asking - e.g., mouse click or network packet reception (everything is like this really as we will see) how does controller notify CPU that it has data the CPU should want? One not-so-good idea what is it? what are drawbacks? when is it okay? 5

6 Polling and I/O Memory CPU I/O Controller ready value v ready value int polldeviceforvalue () { volatile int* ready = 0x ; volatile int* value = 0x ; int v; while (*ready == 0) {; v = *value; 4 *ready = 0; void readyvalueforcpupoll (int v) { volatile int* ready = 0x ; volatile int* value = 0x ; while (*ready!= 0) {; 1 *value = v; 2 *ready = 1; 3 return v; readyvalueforcpupoll (7); Reading (or writing) I/O Memory IS SLOW CPU -> I/O Device: give me value at address X I/O Device -> CPU: here is value Polling is Okay If poll has low overhead or if high-probability of hit. 6

7 Key Observation The Processors CPU and I/O Controller are independent processors they should be permitted to work in parallel either should be able to initiate data transfer to/from memory either should be able to signal the other to get the other s attention 7

8 Autonomous Controller Operation PIO: data transfer CPU <-> Controller initiated by CPU Interrupt: control transfer controller -> CPU DMA: data transfer Controller <-> Memory initiated by Controller Direct Memory Access (DMA) controller can send/read data from/to any main memory address the CPU is oblivious to these transfers DMA addresses and sizes are programmed by CPU using PIO CPU Interrupts controller can signal the CPU CPU checks for interrupts on every cycle (its like a really fast, clock-speed poll) CPU jumps to controller s Interrupt Service Routine if it is interrupting 8

9 Adding Interrupts to Simple CPU New special-purpose CPU registers isdeviceinterrupting set by I/O Controller to signal interrupt interruptcontrollerid set by I/O Controller to identify interrupting device interruptvectorbase interrupt-handler jump table, initialized a boot time Modified fetch-execute cycle while (true) { if (isdeviceinterrupting) { r[5] r[5] - 4; m[r[5]] r[6]; r[6] pc; pc interruptvectorbase [interruptcontrollerid]; fetch (); execute (); 9 RTI: Return from Interrupt Instruction t r[6]; r[6] m[r[5]]; r[5] r[5] + 4; isdeviceinterrupting 0; pc t;

10 Interrupt Control Flow on CPU Current Program 1. CPU is running a program 2. Controller #0 interrupts 3. CPU detects interrupt 4. CPU jumps to its ISR 5. ISR returns to program ISR - Controller #0 rti ISR - Controller #1 rti ISR - Controller #2 rti ISR - Controller #3 rti 10 interruptvectorbase Register

11 Architectural View of Interrupts CPU I/O Controller 3 isdeviceinterrupting 01 myid 3 interruptcontroller ID 03 7 I/O Controller 7 myid 7 while (true) { if (isdeviceinterrupting) { r[5] r[5] - 4; m[r[5]] r[6]; r[6] pc; pc interruptvectorbase [interruptcontrollerid]; isdeviceinterrupting 0; fetch (); execute (); Polling on CPU register instead of I/O Memory: turning bad polling into good polling 11

12 Programming with I/O

13 Disk Read Timeline CPU 1. PIO to request read I/O Controller 2. PIO Received, start read do other things wait for read to complete 3. Read completes 4. Transfer data to memory (DMA) 6. Interrupt Received Call readcomplete 5. Interrupt CPU A disk stores blocks of data. Each block has a number. CPU can read or write. 13

14 Disk Read Timeline 1 PIO to request read 3 DMA data to memory CPU Memory 4 Interrupt CPU I/O Controllers I/O Devices 2 Transfer data from disk into controller memory CPU PIO Idle or do something else Read block Disk Controller Get block from disk, DMA transfer to Memory, Interrupt CPU Time 14

15 The Power of the Sequence Consider a program that reads data from a disk you can sort of think of the read has having three parts: 1. figure out what data you want 2. get the data 3. do something with the data you got these steps must happen in this order we think of these steps as a sequence For Example int sumdiskdata (blocknum, numbytes) { char buf [numbytes]; int sum = 0; diskread (buf, blocknum, numbytes); for (int i=0; i<numbytes; i++) sum += buf [i]; return sum; 15

16 Meets Reality int sumdiskdata (blocknum, numbytes) { char buf [numbytes]; int sum = 0; diskread (buf, blocknum, numbytes); for (int i=0; i<numbytes; i++) sum += buf [i]; return sum; must wait for read to complete diskread returns disk data in buf read buf to compute sum CPU PIO Idle or do something else Read block Disk Controller Get block from disk, DMA transfer to Memory, Interrupt CPU Time 16

17 Making Code Asynchronous This code requests something char buf[numbytes] diskread (buf, blocknum, numbytes); 2 These two pieces of code are not listed sequentially they are not synchronous int sum = 0; for (int i=0; i<numbytes; i++) sum += buf [i]; This code runs when that thing completes CPU 1 PIO Idle or do something else 3 Read block Disk Controller Get block from disk, DMA transfer to Memory, Interrupt CPU Time 17

18 Writing Asynchronous Code in C Events and Event Handlers the things that causes asynchronous code to run are called events - e.g., disk-read completion the code that runs when an event occurs is called an event handler (or callback) - e.g., the code that computes the checksum handlers are registered to a specific event events are fired to trigger the execution of the handler In Code request and registration of event handler are listed together in the code this code continues does not wait for event handler runs asynchronously when event occurs void computesum (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; int sum (blocknum, numbytes) { char buf [numbytes]; diskread (buf, blocknum, numbytes, computesum); 18

19 Asynchronous Execution char buf[numbytes] diskread (buf, blocknum, numbytes, computesum); 2 Registration of Handler Event Handler void computesum (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; CPU Disk Controller Time 1 PIO Event Fired 3 Idle or do something else Read block Get block from disk, DMA transfer to Memory, Interrupt CPU 19

20 Implementing Disk Read (Simplified) Interrupt Vector, Device ID, and PIO Address initialized before all this starts by operating system when device connects #define MAX_DEVICES void (*interruptvector [MAX_DEVICES])(); int diskid = 4; int* diskaddress = (int*) 0x ; interruptvector [diskid] = diskisr; Disk Read register event handler request block (PIO) void diskread (char* buf, int blocknum, int numbytes, void (*whencomplete) (char*, int, int)) { enqueue_handler (whencomplete, buf, blocknum, numbytes); // Perform PIO more in a moment Interrupt Handler find event handler and fire event firing means calling the handler procedure void diskisr() { struct handler_dsc { void (*handler) (char*, int, int); char* buf; int blocknum; int numbytes; ; struct handler_dsc hd; dequeue_handler (&hd); hd.handler (hd.buf, hd.blocknum, hd.numbytes); 20

21 Disk Read PIO Expanded Disk Read with PIO the message sent to disk has several fields each field had different device-memory address access it like a struct - but, keep in mind that writes are to device-memory; - they are messages across bus to device controller they are not writes to main memory void* diskaddress = (void*) 0x ; #DEFINE DISK_OP_READ 1 #DEFINE DISK_OP_WRITE 2 struct disk_ctl { int op; char* buf; int blocknum; int numbytes; void diskread (char* buf, int blocknum, int numbytes, ) { struct disk_ctl* dc = diskaddress; enqueue_handler (whencomplete, buf, blocknum, numbytes); dc->op = DISK_OP_READ; dc->buf = buf; dc->blocknum = blocknum; dc->numbytes = numbytes; 21

22 Did We Really Solve The Problem? We wanted to do this int sumdiskdata (blocknum, numbytes) { char buf [numbytes]; int sum = 0; diskread (buf, blocknum, numbytes); for (int i=0; i<numbytes; i++) sum += buf [i]; return sum; But, reality forced us to do this void computesum (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; void sumdiskdata (blocknum, numbytes) { char buf [numbytes]; diskread (buf, blocknum, numbytes, computesum); What s wrong? 22

23 Connecting Asynchrony to Program How do we use the value computed from the disk block lets say we want to print it void something () { int s = sumdiskdata (buf, blk, n); printf ( %d\n, s); but asynchronously? void computesum (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; free (buf); void sumdiskdata (blocknum, numbytes) { char* buf = malloc (numbytes); diskread (buf, blocknum, numbytes, computesum); 23

24 Ordering in Asynchronous Programs If something has to happen after event it must be triggered by the event often this means it must be part of (or called by) event s handler To print the checksum void computesumandprint (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; printf ( %d\n", sum); free (buf); void sum (blocknum, numbytes, whencomplete) { char* buf = malloc (numbytes); diskread (buf, blocknum, numbytes, whencomplete); sum (1234, 4096, computesumandprint); Huge problem often there s a ton of stuff that depend on returned data that is, that must come after a particular event 24

25 Improving the Code But making it worse void computesumandprint (char* buf, int blocknum, int numbytes) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; printf ( %d\n, xsum); // <= TOO SPECIFIC, MAKE THIS A PARAMETER free (buf); void printint (int i) { printf ( %d\n", i); void computesumandcallback (, void (*sumcallback) (int)) { int sum = 0; for (int i=0); i<numbytes; i++) sum += buf [i]; sumcallback (sum); free (buf); What if you want to do something after printint? Welcome to callback hell void sum (blocknum, numbytes, whencomplete, sumcallback) { char* buf = malloc (numbytes); diskread (buf, blocknum, numbytes, whencomplete, sumcallback); sum (1234, 4096, computesumandcallback, printint); 25

26 Happy System, Sad Programmer Humans like synchrony we expect each step of a program to complete before the next one starts we use the result of previous steps as input to subsequent steps with disks, for example, - we read from a file in one step and then usually use the data we ve read in the next step Computer systems are asynchronous the disk controller takes milliseconds (10-3 s) to read a block - CPU can execute 60 million instructions while waiting for the disk to complete one read - we must allow the CPU to do other work while waiting for I/O completion many devices send unsolicited data at unpredictable times - e.g., incoming network packets, mouse clicks, keyboard-key presses - we must allow programs to be interrupted many, many times a second to handle these things Asynchrony makes programmers sad it makes programs more difficult to write and much more difficult to debug 26

27 Possible Solutions Accept the inevitable use an event-driven programming model - event triggering and handling are de-coupled a common idiom in many Java programs - GUI programming follows this model CSP is a language boosts this idea to first-class status - no procedures or procedure calls - program code is decomposed into a set of sequential/synchronous processes - processes can fire events, which can cause other processes to run in parallel - each process has a guard predicate that lists events that will cause it to run - Javascript in web browsers and Node.js embrace asynchrony, albeit awkwardly Invent a new abstraction an abstraction that provides programs the illusion of synchrony but, what happens when - a program does something asynchronous, like disk read? - an unanticipated device event occurs? What s the right solution? we still don t know this is one of the most pressing questions we currently face 27

28 Promises This is an aside that you don t need to know A promise is a placeholder for a asynchronously computed value it is resolved when the value is computed to use the value you prove a function that should run when it is resolve You return a promise like a value you attach handler to the promise s resolve event by calling THEN Common in Javascript in browser and server (Node.js) 28

29 Asynchronous Disk Read with Promises Disk read now returns a promise promise_t diskread (char* buf, int blocknum, int numbytes) { struct diskread_args* args = malloc (sizeof (struct diskread_args)); enqueue_promise (promise_new(), buf, blocknum, numbytes); // PIO to disk to request numbytes of blocknum be sent to buf return args->promise; The promise is resolved by the interrupt void diskisr() { struct diskread_args { promise_t promise; char* buf; int blocknum; int numbytes; ; struct diskread_args* args = dequeue_diskread_args(); promise_resolve (args->promise, args); 29 Compare to Slide 20

30 Simplifies Building on Asynchronous Read You call diskread and then use the promise to use the promise you say what should happen when it resolves when diskread promise is resolved THEN computesum void* computesum (void* v) { struct diskread_args* args = v; int* sum = malloc (sizeof(int)); *sum = 0; for (int i=0; i<args->numbytes; i++) *sum += args->buf[i]; promise_free (args->promise); free (args->buf); free (args); return sum; promise_t sum (blocknum, numbytes) { char* buf = malloc (numbytes); return promise_then (diskread (buf, blocknum, numbytes), computesum); Notice that computesum returns a value THEN returns another promise whose value is result of computechecksum 30 Compare to Slide 22

31 Building on Compute Checksum The key advantage of Promises is that they return values instead of requiring a handler (callback) parameter asynchronous calls thus look like synchronous calls you build on one call using the THEN of its result Building on Compute Checksum void* printint (void* v) { int* sum = v; printf ( 0%d\n", *sum); free (sum); return 0; promise_t printsum (blocknum, numbytes) { return promise_then (sum (blocknum, numbytes), printint); 31 Compare to Slide 25

32 Anonymous (Lambda) Function Improvement Notice that in the previous code we had to define a procedure and give it a name in order to use it as a handler; i.e., pass it to then void* printint (void* v) { int* sum = v; printf ( %d\n", *sum); free (sum); return 0; promise_t printsum (blocknum, numbytes) { return promise_then (sum (blocknum, numbytes), printint); Anonymous functions in clang dialect of C (e.g., Mac), but not gnu dialect (e.g., Linux) use ^ instead of * for function pointers and include procedure code inline promise_t printsum (blocknum, numbytes) { return promise_then (checksum (blocknum, numbytes), ^void* (void* v) { char* xsum = v; printf ( %d\n", *sum); free (sum); return 0; ); 32

33 Putting it all together promise_t sum (blocknum, numbytes) { char* buf = malloc (numbytes); return promise_then (diskread (buf, blocknum, numbytes), ^ void* (void* v) { struct diskread_args* args = v; int* sum = malloc (4); *sum = 0; for (int i=0; i<args->numbytes; i++) *sum += args->buf[i]; promise_free (args->promise); free (args->buf); free (args); return sum; ); promise_t printsum (blocknum, numbytes) { return promise_then (checksum (blocknum, numbytes), ^void* (void* v) { int* sum = v; printf ("0x%1x\n", *sum); free (xsum); return 0; ); printsum (1234, 4096); There is subtle memory leak here, if you see it, great, but don t worry about it. The problem is that printchecksum returns a promise that needs to be freed. Freeing it is a bit tricky. 33

34 An Implementation of Promises struct promise; typedef struct promise* promise_t; struct promise { int resolved; void* value; void* (^callback) (void*); promise_t callbackpromise; ; promise_t promise_new() { promise_t p = malloc (sizeof (struct promise)); p->resolved = 0; p->value = 0; p->callback = 0; p->callbackpromise = 0; return p; void promise_free (promise_t p) { free (p); void promise_resolve (promise_t p, void* v) { p->resolved = 1; p->value = v; if (p->callback) promise_resolve (p->callbackpromise, p->callback (v)); promise_t promise_then (promise_t p, void* (^c) (void*)) { promise_t tp = promise_new(); if (p->resolved) promise_resolve (tp, c (p->value)); else { p->callback = c; p->callbackpromise = tp; return tp; 34

35 If you are taking CPSC 310 You are using AJAX to contact your Express/Node.js server the first A in AJAX stands for asynchronous it works exactly the same way as the diskread example You can use $.ajax with a callback $.ajax({ url: '/blah', success: function (data) { // do something with the data ) Or you can turn it into a Promise Promise.resolve ($.ajax ({url: '/blah')).then (function (data) { // do something with data ) To see the complexity of asynchrony, consider this lets say your application needs to make 2 independent calls via AJAX and then you want a callback to run when the are BOTH complete ideally - you want to make both calls first - then wait for both of them to complete but, how would you do that? its easy with promises, difficult with callbacks 35

36 Using Promises in Javascript To wait for multiple things Promise p1 = Promise.resolve ($.ajax ({url: '/blah')); Promise p2 = Promise.resolve ($.ajax ({url: '/blot')); p1.then (function (p1data) { return p2.then (function (p2data) { // do something with p1data and p2data ) ) 36

CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Oct 27, 29, 31. Winter Session 2014, Term 1

CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Oct 27, 29, 31. Winter Session 2014, Term 1 CPSC 213 Introduction to Computer Systems Winter Session 2014, Term 1 Unit 2a Oct 27, 29, 31 I/O Devices, Interrupts and DMA Overview Reading in Text 8.1, 8.2.1, 8.5.1-8.5.3 Learning Goals Explain what

More information

THE CPU SPENDS ALMOST ALL of its time fetching instructions from memory

THE CPU SPENDS ALMOST ALL of its time fetching instructions from memory THE CPU SPENDS ALMOST ALL of its time fetching instructions from memory and executing them. However, the CPU and main memory are only two out of many components in a real computer system. A complete system

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides were originally created by Deniz ALTINBUKEN. P&H Chapter 4.9, pages 445 452, appendix A.7 Manages all of the software and hardware on the

More information

I/O Management Intro. Chapter 5

I/O Management Intro. Chapter 5 I/O Management Intro Chapter 5 1 Learning Outcomes A high-level understanding of the properties of a variety of I/O devices. An understanding of methods of interacting with I/O devices. 2 I/O Devices There

More information

Today: I/O Systems. Architecture of I/O Systems

Today: I/O Systems. Architecture of I/O Systems Today: I/O Systems How does I/O hardware influence the OS? What I/O services does the OS provide? How does the OS implement those services? How can the OS improve the performance of I/O? Lecture 20, page

More information

I/O. Disclaimer: some slides are adopted from book authors slides with permission 1

I/O. Disclaimer: some slides are adopted from book authors slides with permission 1 I/O Disclaimer: some slides are adopted from book authors slides with permission 1 Thrashing Recap A processes is busy swapping pages in and out Memory-mapped I/O map a file on disk onto the memory space

More information

Bus System. Bus Lines. Bus Systems. Chapter 8. Common connection between the CPU, the memory, and the peripheral devices.

Bus System. Bus Lines. Bus Systems. Chapter 8. Common connection between the CPU, the memory, and the peripheral devices. Bus System Chapter 8 CSc 314 T W Bennet Mississippi College 1 CSc 314 T W Bennet Mississippi College 3 Bus Systems Common connection between the CPU, the memory, and the peripheral devices. One device

More information

ECEN 449 Microprocessor System Design. Hardware-Software Communication. Texas A&M University

ECEN 449 Microprocessor System Design. Hardware-Software Communication. Texas A&M University ECEN 449 Microprocessor System Design Hardware-Software Communication 1 Objectives of this Lecture Unit Learn basics of Hardware-Software communication Memory Mapped I/O Polling/Interrupts 2 Motivation

More information

Input/Output Interfaces: Ch

Input/Output Interfaces: Ch Input/Output Interfaces: Ch 8.1-8.3 hardware software H/w s/w interface Problems Algorithms Prog. Lang & Interfaces Instruction Set Architecture Microarchitecture (Organization) Circuits Devices (Transistors)

More information

Scuola Superiore Sant Anna. I/O subsystem. Giuseppe Lipari

Scuola Superiore Sant Anna. I/O subsystem. Giuseppe Lipari Scuola Superiore Sant Anna I/O subsystem Giuseppe Lipari Input Output and Device Drivers ERI Gennaio 2008 2 Objectives of the I/O subsystem To hide the complexity From the variability of the devices Provide

More information

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) I/O Devices Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) Hardware Support for I/O CPU RAM Network Card Graphics Card Memory Bus General I/O Bus (e.g., PCI) Canonical Device OS reads/writes

More information

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2. BASIC ELEMENTS Simplified view: Processor Slide 1 Computer System Overview Operating Systems Slide 3 Main Memory referred to as real memory or primary memory volatile modules 2004/S2 secondary memory devices

More information

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture 1 Last class: Course administration OS definition, some history Today: Background on Computer Architecture 2 Canonical System Hardware CPU: Processor to perform computations Memory: Programs and data I/O

More information

Input / Output. Kevin Webb Swarthmore College April 12, 2018

Input / Output. Kevin Webb Swarthmore College April 12, 2018 Input / Output Kevin Webb Swarthmore College April 12, 2018 xkcd #927 Fortunately, the charging one has been solved now that we've all standardized on mini-usb. Or is it micro-usb? Today s Goals Characterize

More information

Introduction to Operating Systems. Chapter Chapter

Introduction to Operating Systems. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

The Kernel Abstraction

The Kernel Abstraction The Kernel Abstraction Debugging as Engineering Much of your time in this course will be spent debugging In industry, 50% of software dev is debugging Even more for kernel development How do you reduce

More information

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int Operating Systems Lecture 1 Introduction Agenda: What Operating Systems Do Computer System Components How to view the Operating System Computer-System Operation Interrupt Operation I/O Structure DMA Structure

More information

Hardware OS & OS- Application interface

Hardware OS & OS- Application interface CS 4410 Operating Systems Hardware OS & OS- Application interface Summer 2013 Cornell University 1 Today How my device becomes useful for the user? HW-OS interface Device controller Device driver Interrupts

More information

Computer System Overview

Computer System Overview Computer System Overview Operating Systems 2005/S2 1 What are the objectives of an Operating System? 2 What are the objectives of an Operating System? convenience & abstraction the OS should facilitate

More information

CSCI-375 Operating Systems

CSCI-375 Operating Systems CSCI-375 Operating Systems Lecture 2 Note: Many slides and/or pictures in the following are adapted from: slides 2005 Silberschatz, Galvin, and Gagne Some slides and/or pictures in the following are adapted

More information

Main Memory. ICS332 Operating Systems

Main Memory. ICS332 Operating Systems Main Memory ICS332 Operating Systems Main Memory The OS must manage main memory because it manages processes that share main memory Main memory: A large array of bytes (words), each with its own address

More information

Input / Output. School of Computer Science G51CSA

Input / Output. School of Computer Science G51CSA Input / Output 1 Overview J I/O module is the third key element of a computer system. (others are CPU and Memory) J All computer systems must have efficient means to receive input and deliver output J

More information

Roadmap. CPU management. Memory management. Disk management. Other topics. Process, thread, synchronization, scheduling. Virtual memory, demand paging

Roadmap. CPU management. Memory management. Disk management. Other topics. Process, thread, synchronization, scheduling. Virtual memory, demand paging CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory, demand paging Disk management I/O Filesystem Other topics 1 I/O Heechul Yun Disclaimer: some slides

More information

I/O. CS 416: Operating Systems Design Department of Computer Science Rutgers University

I/O. CS 416: Operating Systems Design Department of Computer Science Rutgers University I/O Design Department of Computer Science http://www.cs.rutgers.edu/~vinodg/416 I/O Devices So far we have talked about how to abstract and manage CPU and memory Computation inside computer is useful only

More information

OPERATING SYSTEMS CS136

OPERATING SYSTEMS CS136 OPERATING SYSTEMS CS136 Jialiang LU Jialiang.lu@sjtu.edu.cn Based on Lecture Notes of Tanenbaum, Modern Operating Systems 3 e, 1 Chapter 5 INPUT/OUTPUT 2 Overview o OS controls I/O devices => o Issue commands,

More information

PC Interrupt Structure and 8259 DMA Controllers

PC Interrupt Structure and 8259 DMA Controllers ELEC 379 : DESIGN OF DIGITAL AND MICROCOMPUTER SYSTEMS 1998/99 WINTER SESSION, TERM 2 PC Interrupt Structure and 8259 DMA Controllers This lecture covers the use of interrupts and the vectored interrupt

More information

Introduction to Operating. Chapter Chapter

Introduction to Operating. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 5: Memory-mapped I/O review, APB, start interrupts. Mostly APB though Sept. 19 th 2018 1 Today Memory-mapped I/O

More information

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic) I/O Systems Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) I/O Systems 1393/9/15 1 / 57 Motivation Amir H. Payberah (Tehran

More information

CS 104 Computer Organization and Design

CS 104 Computer Organization and Design CS 104 Computer Organization and Design Exceptions and Interrupts CS104: Exceptions and Interrupts 1 Exceptions and Interrupts App App App System software Mem CPU I/O Interrupts: Notification of external

More information

Architecture and OS. To do. q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure

Architecture and OS. To do. q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure Architecture and OS To do q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure Computer architecture and OS OS is intimately tied to the hardware it runs on

More information

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand Device Programming Nima Honarmand read/write interrupt read/write Spring 2017 :: CSE 506 Device Interface (Logical View) Device Interface Components: Device registers Device Memory DMA buffers Interrupt

More information

Introduction to Operating Systems. Chapter Chapter

Introduction to Operating Systems. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World Computing Layers Problems Chapter 8 I/O Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Algorithms Language Instruction Set

More information

CSC227: Operating Systems Fall Chapter 1 INTERRUPTS. Dr. Soha S. Zaghloul

CSC227: Operating Systems Fall Chapter 1 INTERRUPTS. Dr. Soha S. Zaghloul CSC227: Operating Systems Fall 2016 Chapter 1 INTERRUPTS Dr. Soha S. Zaghloul LAYOUT 1.3 Devices Controlling Techniques 1.3.1 Polling 1.3.2 Interrupts H/W Interrupts Interrupt Controller Process State

More information

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture 168 420 Computer Architecture Chapter 6 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats All slower than CPU

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 3: Pointers. Bernhard Boser & Randy Katz

CS 61C: Great Ideas in Computer Architecture. Lecture 3: Pointers. Bernhard Boser & Randy Katz CS 61C: Great Ideas in Computer Architecture Lecture 3: Pointers Bernhard Boser & Randy Katz http://inst.eecs.berkeley.edu/~cs61c Agenda Pointers in C Arrays in C This is not on the test Pointer arithmetic

More information

Chapter 5 - Input / Output

Chapter 5 - Input / Output Chapter 5 - Input / Output Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 5 - Input / Output 1 / 90 1 Motivation 2 Principle of I/O Hardware I/O Devices Device Controllers Memory-Mapped

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel Chapter-6 SUBJECT:- Operating System TOPICS:- I/O Management Created by : - Sanjay Patel Disk Scheduling Algorithm 1) First-In-First-Out (FIFO) 2) Shortest Service Time First (SSTF) 3) SCAN 4) Circular-SCAN

More information

CPSC 213. Introduction to Computer Systems. Reading. Thread. The Virtual Processor. Virtual Processors. Unit 2b. Text. An abstraction for execution

CPSC 213. Introduction to Computer Systems. Reading. Thread. The Virtual Processor. Virtual Processors. Unit 2b. Text. An abstraction for execution Reading Text CPSC 213 2ed: 12.3 1ed: 13.3 Introduction to Computer Systems Unit 2b Virtual Processors The Virtual Processor 1 Thread 2 Originated with Edsger Dijkstra in the THE Operating System in The

More information

The von Neuman architecture characteristics are: Data and Instruction in same memory, memory contents addressable by location, execution in sequence.

The von Neuman architecture characteristics are: Data and Instruction in same memory, memory contents addressable by location, execution in sequence. CS 320 Ch. 3 The von Neuman architecture characteristics are: Data and Instruction in same memory, memory contents addressable by location, execution in sequence. The CPU consists of an instruction interpreter,

More information

Running Applications

Running Applications Running Applications Computer Hardware Central Processing Unit (CPU) CPU PC IR MAR MBR I/O AR I/O BR To exchange data with memory Brain of Computer, controls everything Few registers PC (Program Counter):

More information

Quiz: Address Translation

Quiz: Address Translation Quiz: Address Translation 8 bits 1 st level 8 bits 8 bits 2 nd level offset Virtual address format (24bits) 4 bits 3 Frame # Unused 1 V Page table entry (8bit) Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370

More information

CSC 2405: Computer Systems II

CSC 2405: Computer Systems II CSC 2405: Computer Systems II Dr. Mirela Damian http://www.csc.villanova.edu/~mdamian/csc2405/ Spring 2016 Course Goals: Look under the hood Help you learn what happens under the hood of computer systems

More information

Operating Systems (CS1022) Input/Output. Yagiz Özbek Evren

Operating Systems (CS1022) Input/Output. Yagiz Özbek Evren Operating Systems (CS1022) Input/Output Yagiz Özbek Evren 1 Content Principles of IO Hardware...3 IO Devices.. Device Controllers.. Memory-Mapped IO... Direct Memory Access... Interrupts. Principles of

More information

Computer Science 61C Spring Friedland and Weaver. Input/Output

Computer Science 61C Spring Friedland and Weaver. Input/Output Input/Output 1 A Computer is Useless without I/O I/O handles persistent storage Disks, SSD memory, etc I/O handles user interfaces Keyboard/mouse/display I/O handles network 2 Basic I/O: Devices are Memory

More information

EN1640: Design of Computing Systems Topic 07: I/O

EN1640: Design of Computing Systems Topic 07: I/O EN1640: Design of Computing Systems Topic 07: I/O Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring 2017 [ material

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 4 Introduction to C (pt 2) 2014-09-08!!!Senior Lecturer SOE Dan Garcia!!!www.cs.berkeley.edu/~ddgarcia! C most popular! TIOBE programming

More information

OPERATING SYSTEMS OVERVIEW. Operating Systems 2015 Spring by Euiseong Seo

OPERATING SYSTEMS OVERVIEW. Operating Systems 2015 Spring by Euiseong Seo OPERATING SYSTEMS OVERVIEW Operating Systems 2015 Spring by Euiseong Seo What is an Operating System? A program that acts as an intermediary between a user of a computer and computer hardware Operating

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 31: Computer Input/Output Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview for today Input and output are fundamental for

More information

CSE 303: Concepts and Tools for Software Development

CSE 303: Concepts and Tools for Software Development CSE 303: Concepts and Tools for Software Development Hal Perkins Winter 2009 Lecture 7 Introduction to C: The C-Level of Abstraction CSE 303 Winter 2009, Lecture 7 1 Welcome to C Compared to Java, in rough

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

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device) Devices -Host -CPU -Device -Controller device) +memory +OS -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, Communication -Registers -Control

More information

I/O Systems. Jo, Heeseung

I/O Systems. Jo, Heeseung I/O Systems Jo, Heeseung Today's Topics Device characteristics Block device vs. Character device Direct I/O vs. Memory-mapped I/O Polling vs. Interrupts Programmed I/O vs. DMA Blocking vs. Non-blocking

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. How does a processor interact

More information

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals William Stallings Computer Organization and Architecture 7 th Edition Chapter 7 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In

More information

OS: An Overview. ICS332 Operating Systems

OS: An Overview. ICS332 Operating Systems OS: An Overview ICS332 Operating Systems Why are we studying this? After all, you probably will not develop an OS Important to understand what you use: Develop better (apps); What can and cannot be done;

More information

I/O. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 6.5-6

I/O. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 6.5-6 I/O Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University See: P&H Chapter 6.5-6 Computer System = Input + Output + Memory + Datapath + Control Video Network Keyboard USB Computer System

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #3 C Strings, Arrays, & Malloc 2007-06-27 Scott Beamer, Instructor Sun announces new supercomputer: Sun Constellation CS61C L3 C Pointers

More information

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14 CS 134 Operating Systems April 8, 2013 Lecture 20 Input/Output Instructor: Neil Rhodes Hardware How hardware works Operating system layer What the kernel does API What the programmer does Overview 2 kinds

More information

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,

More information

Advanced Programming & C++ Language

Advanced Programming & C++ Language Advanced Programming & C++ Language ~6~ Introduction to Memory Management Ariel University 2018 Dr. Miri (Kopel) Ben-Nissan Stack & Heap 2 The memory a program uses is typically divided into four different

More information

CPSC 213, Winter 2016, Term 2 Final Exam Solution Date: April 19, 2017; Instructor: Mike Feeley and Alan Wagner

CPSC 213, Winter 2016, Term 2 Final Exam Solution Date: April 19, 2017; Instructor: Mike Feeley and Alan Wagner CPSC 213, Winter 2016, Term 2 Final Exam Solution Date: April 19, 2017; Instructor: Mike Feeley and Alan Wagner 1 (4 marks) Variables and Memory. Consider the following code running on 32-bit, big-endian

More information

Hardware, Modularity, and Virtualization CS 111

Hardware, Modularity, and Virtualization CS 111 Hardware, Modularity, and Virtualization Operating System Principles Peter Reiher Page 1 Outline The relationship between hardware and operating systems Processors I/O devices Memory Organizing systems

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu CPSC 341 OS & Networks Introduction Dr. Yingwu Zhu What to learn? Concepts Processes, threads, multi-processing, multithreading, synchronization, deadlocks, CPU scheduling, networks, security Practice:

More information

7/20/2008. What Operating Systems Do Computer-System Organization

7/20/2008. What Operating Systems Do Computer-System Organization Introduction to Operating Systems Introduction What Operating Systems Do Computer-System Organization Computer-System Architecture Operating-System Structure Operating-System Operations Process Management

More information

John Wawrzynek & Nick Weaver

John Wawrzynek & Nick Weaver CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory John Wawrzynek & Nick Weaver http://inst.eecs.berkeley.edu/~cs61c From Previous Lecture: Operating Systems Input / output (I/O) Memory

More information

CS 201. Exceptions and Processes. Gerson Robboy Portland State University

CS 201. Exceptions and Processes. Gerson Robboy Portland State University CS 201 Exceptions and Processes Gerson Robboy Portland State University Control Flow Computers Do One Thing From startup to shutdown, a CPU reads and executes (interprets) a sequence of instructions, one

More information

CS 341l Fall 2008 Test #4 NAME: Key

CS 341l Fall 2008 Test #4 NAME: Key CS 341l all 2008 est #4 NAME: Key CS3411 est #4, 21 November 2008. 100 points total, number of points each question is worth is indicated in parentheses. Answer all questions. Be as concise as possible

More information

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control.

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control. C Flow Control David Chisnall February 1, 2011 Outline What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope Disclaimer! These slides contain a lot of

More information

Introduction to Asynchronous Programming Fall 2014

Introduction to Asynchronous Programming Fall 2014 CS168 Computer Networks Fonseca Introduction to Asynchronous Programming Fall 2014 Contents 1 Introduction 1 2 The Models 1 3 The Motivation 3 4 Event-Driven Programming 4 5 select() to the rescue 5 1

More information

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: https://users.wpi.edu/~sjarvis/ece2049_smj/ We will come around checking your pre-labs

More information

Agenda. Components of a Computer. Computer Memory Type Name Addr Value. Pointer Type. Pointers. CS 61C: Great Ideas in Computer Architecture

Agenda. Components of a Computer. Computer Memory Type Name Addr Value. Pointer Type. Pointers. CS 61C: Great Ideas in Computer Architecture CS 61C: Great Ideas in Computer Architecture Krste Asanović & Randy Katz http://inst.eecs.berkeley.edu/~cs61c And in Conclusion, 2 Processor Control Datapath Components of a Computer PC Registers Arithmetic

More information

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter , Lecture Topics Today: Computer System Overview (Stallings, chapter 1.1-1.8) Next: Operating System Overview (Stallings, chapter 2.1-2.4, 2.8-2.10) 1 Announcements Syllabus and calendar available Consulting

More information

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13 I/O Handling ECE 650 Systems Programming & Engineering Duke University, Spring 2018 Based on Operating Systems Concepts, Silberschatz Chapter 13 Input/Output (I/O) Typical application flow consists of

More information

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester Operating System: Chap13 I/O Systems National Tsing-Hua University 2016, Fall Semester Outline Overview I/O Hardware I/O Methods Kernel I/O Subsystem Performance Application Interface Operating System

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 3: Pointers. Krste Asanović & Randy Katz

CS 61C: Great Ideas in Computer Architecture. Lecture 3: Pointers. Krste Asanović & Randy Katz CS 61C: Great Ideas in Computer Architecture Lecture 3: Pointers Krste Asanović & Randy Katz http://inst.eecs.berkeley.edu/~cs61c Agenda Pointers in C Arrays in C This is not on the test Pointer arithmetic

More information

Threads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits

Threads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits CS307 What is a thread? Threads A thread is a basic unit of CPU utilization contains a thread ID, a program counter, a register set, and a stack shares with other threads belonging to the same process

More information

CS 160: Interactive Programming

CS 160: Interactive Programming CS 160: Interactive Programming Professor John Canny 3/8/2006 1 Outline Callbacks and Delegates Multi-threaded programming Model-view controller 3/8/2006 2 Callbacks Your code Myclass data method1 method2

More information

19: I/O. Mark Handley. Direct Memory Access (DMA)

19: I/O. Mark Handley. Direct Memory Access (DMA) 19: I/O Mark Handley Direct Memory Access (DMA) 1 Interrupts Revisited Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires. Interrupts

More information

Pointers. A pointer is simply a reference to a variable/object. Compilers automatically generate code to store/retrieve variables from memory

Pointers. A pointer is simply a reference to a variable/object. Compilers automatically generate code to store/retrieve variables from memory Pointers A pointer is simply a reference to a variable/object Compilers automatically generate code to store/retrieve variables from memory It is automatically generating internal pointers We don t have

More information

CSE 451: Operating Systems Winter Module 2 Architectural Support for Operating Systems

CSE 451: Operating Systems Winter Module 2 Architectural Support for Operating Systems CSE 451: Operating Systems Winter 2017 Module 2 Architectural Support for Operating Systems Mark Zbikowski mzbik@cs.washington.edu 476 Allen Center 2013 Gribble, Lazowska, Levy, Zahorjan 1 Even coarse

More information

Parallel Programming: Background Information

Parallel Programming: Background Information 1 Parallel Programming: Background Information Mike Bailey mjb@cs.oregonstate.edu parallel.background.pptx Three Reasons to Study Parallel Programming 2 1. Increase performance: do more work in the same

More information

Parallel Programming: Background Information

Parallel Programming: Background Information 1 Parallel Programming: Background Information Mike Bailey mjb@cs.oregonstate.edu parallel.background.pptx Three Reasons to Study Parallel Programming 2 1. Increase performance: do more work in the same

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Seventh Edition By William Stallings Objectives of Chapter To provide a grand tour of the major computer system components:

More information

Singly linked lists in C.

Singly linked lists in C. Singly linked lists in C http://www.cprogramming.com/tutorial/c/lesson15.html By Alex Allain Linked lists are a way to store data with structures so that the programmer can automatically create a new place

More information

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT C Review MaxMSP Developers Workshop Summer 2009 CNMAT C Syntax Program control (loops, branches): Function calls Math: +, -, *, /, ++, -- Variables, types, structures, assignment Pointers and memory (***

More information

Even coarse architectural trends impact tremendously the design of systems

Even coarse architectural trends impact tremendously the design of systems CSE 451: Operating Systems Winter 2015 Module 2 Architectural Support for Operating Systems Mark Zbikowski mzbik@cs.washington.edu 476 Allen Center 2013 Gribble, Lazowska, Levy, Zahorjan 1 Even coarse

More information

Newbie s Guide to AVR Interrupts

Newbie s Guide to AVR Interrupts Newbie s Guide to AVR Interrupts Dean Camera March 15, 2015 ********** Text Dean Camera, 2013. All rights reserved. This document may be freely distributed without payment to the author, provided that

More information

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture Last 2 Classes: Introduction to Operating Systems & C++ tutorial User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the

More information

Architectural Support for Operating Systems

Architectural Support for Operating Systems OS and Architectures Architectural Support for Operating Systems Emin Gun Sirer What an OS can do is dictated, at least in part, by the architecture. Architecture support can greatly simplify (or complicate)

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides were originally created by Deniz ALTINBUKEN. P&H Chapter 4.9, pages 445 452, appendix A.7 Manages all of the software and hardware on the

More information

18-447: Computer Architecture Lecture 16: Virtual Memory

18-447: Computer Architecture Lecture 16: Virtual Memory 18-447: Computer Architecture Lecture 16: Virtual Memory Justin Meza Carnegie Mellon University (with material from Onur Mutlu, Michael Papamichael, and Vivek Seshadri) 1 Notes HW 2 and Lab 2 grades will

More information

(Refer Slide Time: 1:26)

(Refer Slide Time: 1:26) Information Security-3 Prof. V Kamakoti Department of Computer science and Engineering Indian Institute of Technology Madras Basics of Unix and Network Administration Operating Systems Introduction Mod01,

More information

Traps, Exceptions, System Calls, & Privileged Mode

Traps, Exceptions, System Calls, & Privileged Mode Traps, Exceptions, System Calls, & Privileged Mode Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University P&H Chapter 4.9, pages 509 515, appendix B.7 Operating Systems 2 Control Transfers

More information

Visual Profiler. User Guide

Visual Profiler. User Guide Visual Profiler User Guide Version 3.0 Document No. 06-RM-1136 Revision: 4.B February 2008 Visual Profiler User Guide Table of contents Table of contents 1 Introduction................................................

More information

Organisasi Sistem Komputer

Organisasi Sistem Komputer LOGO Organisasi Sistem Komputer OSK 5 Input Output 1 1 PT. Elektronika FT UNY Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats

More information

Operating Systems 2010/2011

Operating Systems 2010/2011 Operating Systems 2010/2011 Input/Output Systems part 1 (ch13) Shudong Chen 1 Objectives Discuss the principles of I/O hardware and its complexity Explore the structure of an operating system s I/O subsystem

More information