Overview. I/O Devices. Memory Access. Device Controller. Advanced Operating System Project. Device Drivers. M. Muztaba Fuad

Size: px
Start display at page:

Download "Overview. I/O Devices. Memory Access. Device Controller. Advanced Operating System Project. Device Drivers. M. Muztaba Fuad"

Transcription

1 Advanced Operating System Project Device Drivers M. Muztaba Fuad Overview Basics Definitions What the OS books say? Linux way of doing things (Kernel 2.4) Check Linux Source code. Windows way of doing things Check Windows Source code (just kidding!). Write your own driver in Linux What you need to know? How to write? Things to remember Changes in Kernel 2.6 Slide 2 I/O Devices! "$# %"! &! '( ' ) * + ',+ & # - -'. / 0 ' ) *1 " ( '1 2 # 3! ' I/O devices are attached to the computer bus. Each I/O device consists of a controller subassembly to control the detailed operation of the physical device itself. Slide 3 Slide 4 Device Controller Memory Access ;:6<6= >?? QH? O FCG6? 8 RS=FC:6? 8 Q6? O FCGH? 8 RX=FC:6? 8 DLQET DLQET DE:6FCFCGH<6I J6K G6K 5H7 9LG6K G D$:6<6K? :HU U =? D$:6<6K? :HU U =? M,:HN6O P Slide 5 Conventional DMA Slide 6 1

2 B Device Addressing Device Independent I/O Driver RS=FC:6? 8 LI6IE? =7,7 Q6? O FCGH? 8 RX=FC:6? 8 QH? O FCG6? 8 RX=FC:6? 8 9L=V6O P= RS=FC:6? 8 IHI6? =7,7 9L=V6O P= LI6I$? =7,7 9L=V6O P= 9L=V6O P= 9L=V6O P= 9L=V6O P= No Standard Interface Standard Interface Conventional Memory Mapped I/O Slide 7 Slide 8 Device Manager Abstraction Device Management =%GHI,@CB Common Device Interface 9L=V6O P=,<HK =? G6P= J867,K =F <6K =? G6P= &%%$U O PG6K O :$< Q6? :6P=%77 $O U = RXGH<6G6N6=? E=? FCO <HG6U 9L? O V6=6? QH? O <6K =6? 9;? O VW=H? 9LO 7 9;? O VW=H? LG6? ICG6? =,<6K =? G6P=!" "# "! # 9;=,V6O P%= RXG6<HG6NE=? E=? FCO <HG6U DE:6<HK? :6U U =? QH? O <6K =6? D$:6<6K? :HU U =? 9LO 7 DE:H<6K? :6U U =? D$:6FCFCG6<6I J6K G6K 5H7 9LGHK G XDE:$<6K? :HU U =? Slide 9 Slide 10 I/O Strategies Direct I/O with polling The CPU is responsible for data transfer between device and primary memory. Slow data transfer. Difficult to achieve effective CPU utilization Interrupt Driven I/O The controller don t needs to be checked for status constantly. Controller interrupts the device manager to indicate when it finishes its operation. Polling I/O Read 1? =G6I,@ B 9LGHK G 9L=V6O P=,<HK =? G6P= 9L=V6O P= 9;? O VE=? '$=G6I 56<EPK O :6< (? O K =) 56<HP,K O :H< ;G6? I GH? = <6K =%? G6P= G? U DE:6FCFCGH<6I JHK G6K 567 9;G6K 9L=V6O P=XD$:$<6K :6U =? Slide 11 Slide 12 2

3 ! Interrupt Processing When the kernel receives an interrupt from a particular device, the kernel passes control to its corresponding interrupt handler Interrupt handlers do not belong to any single process context Scheduler cannot place an interrupt handler in a run queue Thus, interrupt handler cannot sleep, call the scheduler, be preempted or raise faults or exceptions As a result, most interrupt handlers are designed to execute quickly Interrupts are divided into top and bottom halves Top half sets up. Bottom half performs the operation. 9;=,V6O P%=),<6K =? G6P,= ;G6? I G6? = <6K =? G6P= 2 Interrupt Driven I/O 1 9L=V6O P= 9;? O VE=? '$=%GHI 56<$P,K O :6< (? O K = 5H<6P,K O :6< 3 4? =G6I,@CB 9LG6K G J6K G6K 5H7 $G U = D$:6FCFCG6<6I J6K GHK 567 9LG6K G 9;=,V6O P%=SDE:$<6K? :6U U =%? LG6<6IHU =? <6K =%?? 5%6K LG6<6IHU =? 8 Slide 13 Slide 14 Linux Device Driver "# $ Initial Unix implementations has the device drivers coded inside the kernel. Problems???? Module is an independent software unit that can be loaded into the kernel dynamically at run time. Helps to install new device without modifying the kernel. Kernel provides common interface for I/O system calls. Slide 15 Slide 16 Kernel Driver Initialization Device files are more than half of the size of the kernel source. fs/devices.c % Defines all the device functions /devices directory % Holds all the device driver codes /devices/char /devices/block Kernel driver initialization: start_kernel & init/main.c setup_arch ' arch/i386/kernel/setup.c Sets up system variables, such as video type, root device etc. console_init ' driver/char/tty_io.c init ' init/main.c do_basic_setup ( init/main.c» Initialize all bus sub system prepare_namespace ( init/do_mounts.c» Mount root and device file system do_initcalls ( init/main.c» All built in device driver is initialized which are registered with initcall() Slide 17 Linux Device Driver Most have been written by independent developers. Typically implemented as loadable kernel modules. Device special files Most devices are represented by device special files. Entries in the )+*,.- directory that provide access to devices. List of devices in the system can be obtained by reading the contents of )/01324)3*,.-5 26,378 Devices are grouped into classes Three classes: Character Devices Block Devices Network Devices Members of each device class perform similar functions Slide 18 3

4 Linux Device Driver Major and minor identification numbers Used by device drivers to identify their devices Devices that are assigned the same major identification number are controlled by the same driver Minor identification numbers enable the system to distinguish between devices of the same class /usr/src/linux/documentation/devices.txt brw-rw root disk 3, 1 May hda1 brw-rw root disk 3, 2 May hda2 brw-rw root disk 3, 3 May hda3 crw root root 4, 0 Jan tty0 crw root root 4, 1 Oct 31 14:55 tty1 crw-r--r-- 1 root root 10, 135 Jan rtc Linux Device Driver Device special files are accessed via the virtual file system System calls pass to the VFS, which in turn issues calls to device drivers Most drivers implement common file operations such as, and To support tasks such as ejecting a CD-ROM tray or retrieving status information from a printer, Linux provides the system call Slide 19 Slide 20 I/O Interface Layers Character Device I/O Transmits data as a stream of bytes Represented by a structure that contains the driver name and a pointer to the driver s file_operations structure Maintains the operations supported by the device driver All registered drivers are referenced by a vector (major number) The file_operations structure Stores functions called by the VFS when a system call accesses a device special file! " # $ % & '(%() * + #,(-(. "(# $ % & '(%() * + #,(-(. chardevs / 0(132 /30:132 ;<7 = > / / ? Slide A Slide 22 Block Device I/O Block I/O subsystem Complex then character device Buffering Caching Direct I/O and so on. Represented by block_device_operations Different than file_operations Extra operations for caching, buffering and queue management When data from a block device is requested, kernel first searches page cache If found, data is copied to the process s address space Otherwise, typically added to a request queue Direct I/O Enables driver to bypass kernel caches when accessing devices Some times, need to provide advanced algorithms for certain devices Optimizing moving head storage Slide 23 Network I/O Network Device I/O Accessed via the IPC subsystem s socket interface. Network traffic can arrive at any time. The C DFEG and HIC J K D operations of a device special file are not sufficient to access data from network devices Kernel uses L DK M G DN<J OD structures to describe network devices No P Q R S3TUWVSX YZ Q UW[\ structure Packet processing Complex. Depends on different issues. Slide 24 4

5 Unified Device Model Attempts to simplify device management in the kernel Relates device classes to system buses Helps support hot-swappable devices Power management UDM defines structures to represent devices, device drivers, device classes, buses Kernel Module A new kernel module can be added on the fly While the OS is still running. No need to re-compile the kernel. They are not user program. Some times they are also called Loadable Kernel Modules Several types of kernel module: Device Drivers Virtual terminals Interpreters Only be controlled by super user. All installed modules: /lib/modules/kernel_version Slide 25 Slide 26 Modules! "!#$!% 9 : & '& ( )+*,-./ & 5( 03 D : ; ;: 6 / 07'.8) *,-+. / 012 < 9 ACB ACB. '304+& 5( 0 3 Slide 27 Slide 28 Windows Device Driver Windows Device Driver Organized into device driver stack. Device driver with different level of services. Device Object Stores data for device Driver Object Pointers to common driver routines Plug and Play (PnP) Dynamically add new hardware devices Slide 29 Slide 30 5

6 Windows Driver Model Windows Driver Model (WDM) Bus driver Interact directly with bus (PCI, SCSI) Mandatory one bus driver per bus Provide generic functions for devices on bus Filter driver Optional Modify device actions: encryption Add features: security checks Function driver Implements main function of device Slide 31 Slide 32 Things to do Understand the device characteristic and supported commands. Map device specific operations to Linux file operation Select the device name (user interface) /dev/virtual_device Select a major and minor number (a device special file creation) for VFS interface Implement interface subroutines Compile the device driver Install the device driver module. Or Rebuild (compile) the kernel Interface between Kernel & Driver!# #! "! # %$ "!#$! & #! '!# # (#)! $! #!%*+! #!%#!,! #)$ -#)$#.*+$ /!!(0 +1!%# 2(#)! $ # #. 3# #! :);3< = Ä B8C :3< = VWẌ Y 6 CD E F Ä D.G H B: 78)9:)E I3D H ; C+G 839 C J.> :);3< = K Ä B8C :3< = K H ;3D%H ;H D 7)L 8MNF3B:3< O8)HM= > E :PNHCD :)E 7M3: Ö HA:)< L I Q 8)E 73;)F3LR:3E ST.G 839C = U Slide 33 Slide 34 file_operation Structure From the file /usr/src/linux-2.4/include/linux/fs.h 5( 3. 6 ( Z & / 0)+,8 03 7( &, '5[ 5( 3. 6 (*,-./ 0\,N] '03 ^ /,(Z Z )+(1\ / / 5 003_215( 3. 6 ( Z & / 0`\3a+/,Z Z )+( a & ' ( 2 ^ 55& X 0) (1\ ( 3. 6 ( Z & / 0`\3a 6b 73c\3a+5& X 0) ( a+/,z Z )+( \2 ^ 55& X 0) (1\3] 3& ( 0215( 3. 6 ( Z & / 0\3a 6,'5( 63b 73 \3a+5& X 0)+( a+/,z Z )+(c\2 ^ & ' (1\307-- & ( 3. 6 ( Z & / 0d\3a(e, & -f\na%z & / / -+& 3 )+( 2 ^.'5& 4'+0-& '(1\+8,/ / 2 15( 3. 6 ( Z & / 0`\3a+5( 3. 6 (8,/ / )+( 7g/ 0) 5( 3. 6 (+\2 ^ & ' (1\&, 6 ( / 215( 3. 6 (& ',- 0d\3a 5( 3. 6 ( Z & / 0\3a.'5& 4' 0-& '( a.'5& 4' 0-/, '42 ^ & ' (1\**78215( 3. 6 ( Z & / 0d\3a 5( 3. 6 (.e*)+73 07) 5( 3. 6 (+\2 ^ & ' (1\,8 0'2 15( 3. 6 (& ', -0`\3a+5( 3. 6 ( Z & / 0`\2 ^ & ' (1\Z /.5 b 2 15( 3. 6 ( Z & / 0`\2 ^ & ' (1\30/ ( 3. 6 (& ',- 0`\3a+5( 3. 6 ( Z & / 0\2 ^ & ' (1\Z 5 W ' 6 215( 3. 6 ( Z & / 0`\3a+5( 3. 6 (-+0'( 3 W \3a & ' (-7( 75 W ' 6 2 ^ & ' (1\Z 75 W ' 6 21& '( a+5( 3. 6 ( Z & / 0`\3a+& '( 2 ^ & ' (1\/, 6 _215( 3. 6 ( Z & / 0`\3a+& '( a+5( 3. 6 ( Z & / 0)+/, 6 _f\2 ^ 55& X 0) (1\ e2 15( 3. 6 (cz & / 0`\3a 6,'5(5( 3. 6 (&,(e0 6 \3a+. '5& 4' 0-/,' 43a+/,Z Z )+( \2 ^ 55& X 0) (1\3] 3& ( 0e2 15( 3. 6 ( Z & / 0`\3a 6,'5(5( 3. 6 (&,3e+0 6 \3a+. '5& 4 '+0-/, '+43a /,Z Z )+( \2 ^ 55& X 0) (1\50 ' ( 3. 6 ( Z & / 0`\3a+5( 3. 6 (8740`\3a+& '( a+5& X 0) ( a+/,z Z )+( \3a& '( 2 ^.'5& 4'+0-/,'+4 1\4 0( ).'* ) ( 3. 6 ( Z & / 0\3a.'5& 4 '0-/, '43a+. '5& 4 '+0-/, '+43a. '5& 4' 0-/,' 43a+. '5& 4 '0- /, '42 ^ h3^ Slide 35 Things to remember Careful! You are programming in kernel mode! Can t use any standard functions. Can only use kernel functions, which are the functions you can see in /proc/ksyms. Version. Compile Need to use special gcc options. Device special file mknod /dev/device_name device_type major_number minor_number Slide 36 6

7 Kernel 2.6.x Lets check our driver code Creation of Unified Device Model is one of the most important changes in 2.6 kernel. Expanded the limitation of the major number from 255 to Now more than one million sub devices per type is allowed. PnP support. Module subsystem is changed: kbuild tool. New file naming concept. Modules now has.ko extension. Slide 37 Slide 38 Loooooooong way to go.. We can propose a course on device driver as after all that we didn t touch the following: I/O Buffering I/O Caching Block devices Network devices. Module programming Stacked Modules Controller interaction Interrupt processing References OS books: Operating System Concepts by Silberschatz & Galvin Operating System by Garry Nutt. Linux Device Driver book Linux Programmer s Guide The Linux Kernel Module Programming Guide Device Driver Development for Microsoft Windows Slide 39 Slide 40 Thanks Slide 41 7

Operating Systems. V. Input / Output

Operating Systems. V. Input / Output Operating Systems V. Input / Output Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Devices of a Computer System Applications OS CPU Memory

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University l Chapter 10: File System l Chapter 11: Implementing File-Systems l Chapter 12: Mass-Storage

More information

Module 12: I/O Systems

Module 12: I/O Systems Module 12: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Performance Operating System Concepts 12.1 Silberschatz and Galvin c

More information

CS330: Operating System and Lab. (Spring 2006) I/O Systems

CS330: Operating System and Lab. (Spring 2006) I/O Systems CS330: Operating System and Lab. (Spring 2006) I/O Systems Today s Topics 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

Silberschatz and Galvin Chapter 12

Silberschatz and Galvin Chapter 12 Silberschatz and Galvin Chapter 12 I/O Systems CPSC 410--Richard Furuta 3/19/99 1 Topic overview I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O requests to hardware operations

More information

The control of I/O devices is a major concern for OS designers

The control of I/O devices is a major concern for OS designers Lecture Overview I/O devices I/O hardware Interrupts Direct memory access Device dimensions Device drivers Kernel I/O subsystem Operating Systems - June 26, 2001 I/O Device Issues The control of I/O devices

More information

I/O SYSTEMS. Sunu Wibirama

I/O SYSTEMS. Sunu Wibirama I/O SYSTEMS Sunu Wibirama Are you surely IT class member? Then you should know these pictures... Introduction Main job of computer : I/O and processing (the latter is rarely happened) Browsing: read and

More information

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance I/O Hardware Incredible variety of I/O devices Common

More information

I/O Systems. 04/16/2007 CSCI 315 Operating Systems Design 1

I/O Systems. 04/16/2007 CSCI 315 Operating Systems Design 1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts with Java, by Silberschatz, Galvin, and Gagne (2007). Many, if not

More information

Principles of Operating Systems CS 446/646

Principles of Operating Systems CS 446/646 Principles of Operating Systems CS 446/646 5. Input/Output a. Overview of the O/S Role in I/O b. Principles of I/O Hardware c. I/O Software Layers Overview of the I/O software Interrupt handlers Device

More information

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

Computer Organization ECE514. Chapter 5 Input/Output (9hrs) Computer Organization ECE514 Chapter 5 Input/Output (9hrs) Learning Outcomes Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin

More information

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial) Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin

More information

5.b Principles of I/O Hardware CPU-I/O communication

5.b Principles of I/O Hardware CPU-I/O communication Three communication protocols between CPU and I/O 1. Programmed I/O (or polling or busy waiting ) the CPU must repeatedly poll the device to check if the I/O request completed 2. Interrupt-driven I/O the

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems COP 4610: Introduction to Operating Systems (Spring 2015) Chapter 13: I/O Systems Zhi Wang Florida State University Content I/O hardware Application I/O interface Kernel I/O subsystem I/O performance Objectives

More information

Device-Functionality Progression

Device-Functionality Progression Chapter 12: I/O Systems I/O Hardware I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Incredible variety of I/O devices Common concepts Port

More information

Chapter 12: I/O Systems. I/O Hardware

Chapter 12: I/O Systems. I/O Hardware Chapter 12: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations I/O Hardware Incredible variety of I/O devices Common concepts Port

More information

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University I/O Systems Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Device characteristics Block device vs. Character device Direct I/O vs.

More information

Input/Output Systems

Input/Output Systems Input/Output Systems CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating

More information

I/O Design, I/O Subsystem, I/O-Handler Device Driver, Buffering, Disks, RAID January WT 2008/09

I/O Design, I/O Subsystem, I/O-Handler Device Driver, Buffering, Disks, RAID January WT 2008/09 21 I/O Management (1) I/O Design, I/O Subsystem, I/O-Handler Device Driver, Buffering, Disks, RAID January 26 2009 WT 2008/09 2009 Universität Karlsruhe, System Architecture Group 1 Recommended Reading

More information

Embedded Linux Architecture

Embedded Linux Architecture Embedded Linux Architecture Types of Operating Systems Real-Time Executive Monolithic Kernel Microkernel Real-Time Executive For MMU-less processors The entire address space is flat or linear with no memory

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

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

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices.

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices. Input - Output Input-Output (I/O) operating system must control all I/O devices issue commands to devices catch interrupts handle errors provide interface between devices and rest of system main categories

More information

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests

More information

CS5460/6460: Operating Systems. Lecture 24: Device drivers. Anton Burtsev April, 2014

CS5460/6460: Operating Systems. Lecture 24: Device drivers. Anton Burtsev April, 2014 CS5460/6460: Operating Systems Lecture 24: Device drivers Anton Burtsev April, 2014 Device drivers Conceptually Implement interface to hardware Expose some high-level interface to the kernel or applications

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

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition Chapter 13: I/O Systems Silberschatz, Galvin and Gagne 2013 Chapter 13: I/O Systems Overview I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 2 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 2 System I/O System I/O (Chap 13) Central

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

Chapter 12: I/O Systems

Chapter 12: I/O Systems Chapter 12: I/O Systems Chapter 12: I/O Systems I/O Hardware! Application I/O Interface! Kernel I/O Subsystem! Transforming I/O Requests to Hardware Operations! STREAMS! Performance! Silberschatz, Galvin

More information

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations STREAMS Performance Silberschatz, Galvin and

More information

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition Chapter 12: I/O Systems Silberschatz, Galvin and Gagne 2011 Chapter 12: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations STREAMS

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin

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

Operating Systems. Lecture 09: Input/Output Management. Elvis C. Foster

Operating Systems. Lecture 09: Input/Output Management. Elvis C. Foster Operating Systems 141 Lecture 09: Input/Output Management Despite all the considerations that have discussed so far, the work of an operating system can be summarized in two main activities input/output

More information

Linux Device Driver. Analog/Digital Signal Interfacing

Linux Device Driver. Analog/Digital Signal Interfacing Linux Device Driver Analog/Digital Signal Interfacing User Program & Kernel Interface Loadable Kernel Module(LKM) A new kernel module can be added on the fly (while OS is still running) LKMs are often

More information

Operating Systems. Steven Hand. Michaelmas / Lent Term 2008/ lectures for CST IA. Handout 4. Operating Systems

Operating Systems. Steven Hand. Michaelmas / Lent Term 2008/ lectures for CST IA. Handout 4. Operating Systems Operating Systems Steven Hand Michaelmas / Lent Term 2008/09 17 lectures for CST IA Handout 4 Operating Systems N/H/MWF@12 I/O Hardware Wide variety of devices which interact with the computer via I/O:

More information

Operating Systems. V. Input / Output. Eurecom

Operating Systems. V. Input / Output. Eurecom Operating Systems V. Input / Output Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Issues OS manages devices Protection Sharing Ease-of-use

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

Lecture 13 Input/Output (I/O) Systems (chapter 13)

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

More information

Ausgewählte Betriebssysteme - Mark Russinovich & David Solomon (used with permission of authors)

Ausgewählte Betriebssysteme - Mark Russinovich & David Solomon (used with permission of authors) Outline Windows 2000 - The I/O Structure Ausgewählte Betriebssysteme Institut Betriebssysteme Fakultät Informatik Components of I/O System Plug n Play Management Power Management I/O Data Structures File

More information

Input/Output. 198:231 Introduction to Computer Organization Lecture 15. Instructor: Nicole Hynes

Input/Output. 198:231 Introduction to Computer Organization Lecture 15. Instructor: Nicole Hynes Input/Output 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Organization of a Typical Computer System We ve discussed processor and memory We ll discuss

More information

Module 12: I/O Systems

Module 12: I/O Systems Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Performance 12.1 I/O Hardware Incredible variety of I/O devices Common

More information

Table of Contents. Preface... xi

Table of Contents. Preface... xi ,ldr3toc.fm.4587 Page v Thursday, January 20, 2005 9:30 AM Table of Contents Preface................................................................. xi 1. An Introduction to Device Drivers.....................................

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

Module 11: I/O Systems

Module 11: I/O Systems Module 11: I/O Systems Reading: Chapter 13 Objectives Explore the structure of the operating system s I/O subsystem. Discuss the principles of I/O hardware and its complexity. Provide details on the performance

More information

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems Silberschatz, Galvin and Gagne 2013! Chapter 13: I/O Systems I/O Hardware" Application I/O Interface" Kernel I/O Subsystem" Transforming I/O Requests to Hardware Operations" STREAMS"

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

Chapter 5 Input/Output. I/O Devices

Chapter 5 Input/Output. I/O Devices Chapter 5 Input/Output 5.1 Principles of I/O hardware 5.2 Principles of I/O software 5.3 I/O software layers 5.4 Disks 5.5 Clocks 5.6 Character-oriented terminals 5.7 Graphical user interfaces 5.8 Network

More information

Lecture 15: I/O Devices & Drivers

Lecture 15: I/O Devices & Drivers CS 422/522 Design & Implementation of Operating Systems Lecture 15: I/O Devices & Drivers Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken from previous versions

More information

CSE 451: Operating Systems Winter I/O System. Gary Kimura

CSE 451: Operating Systems Winter I/O System. Gary Kimura CSE 451: Operating Systems Winter 2012 I/O System Gary Kimura What s Ahead Principles of I/O Hardware Structuring of I/O Software Layers of an I/O System Operation of an I/O System 2 Hardware Environment

More information

CS162 Operating Systems and Systems Programming Lecture 16. I/O Systems. Page 1

CS162 Operating Systems and Systems Programming Lecture 16. I/O Systems. Page 1 CS162 Operating Systems and Systems Programming Lecture 16 I/O Systems March 31, 2008 Prof. Anthony D. Joseph http://inst.eecs.berkeley.edu/~cs162 Review: Hierarchy of a Modern Computer System Take advantage

More information

Operating System Design Issues. I/O Management

Operating System Design Issues. I/O Management I/O Management Chapter 5 Operating System Design Issues Efficiency Most I/O devices slow compared to main memory (and the CPU) Use of multiprogramming allows for some processes to be waiting on I/O while

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 2 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 2 What is an Operating System? What is

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin

More information

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance Objectives Explore the structure of an operating

More information

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall I/O Device Controllers I/O Systems CS 256/456 Dept. of Computer Science, University of Rochester 10/20/2010 CSC 2/456 1 I/O devices have both mechanical component & electronic component The electronic

More information

操作系统概念 13. I/O Systems

操作系统概念 13. I/O Systems OPERATING SYSTEM CONCEPTS 操作系统概念 13. I/O Systems 东南大学计算机学院 Baili Zhang/ Southeast 1 Objectives 13. I/O Systems Explore the structure of an operating system s I/O subsystem Discuss the principles of I/O

More information

Module 2: Computer-System Structures. Computer-System Architecture

Module 2: Computer-System Structures. Computer-System Architecture Module 2: Computer-System Structures Computer-System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture Operating System Concepts 2.1 Silberschatz

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

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

What is an Operating System? A Whirlwind Tour of Operating Systems. How did OS evolve? How did OS evolve?

What is an Operating System? A Whirlwind Tour of Operating Systems. How did OS evolve? How did OS evolve? What is an Operating System? A Whirlwind Tour of Operating Systems Trusted software interposed between the hardware and application/utilities to improve efficiency and usability Most computing systems

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 and Device Drivers

I/O and Device Drivers I/O and Device Drivers Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered I/O Components I/O Interface I/O Operations Device Drivers 2 I/O Components

More information

Computer Organization

Computer Organization Chapter 5 Computer Organization Figure 5-1 Computer hardware :: Review Figure 5-2 CPU :: Review CPU:: Review Registers are fast stand-alone storage locations that hold data temporarily Data Registers Instructional

More information

Common Computer-System and OS Structures

Common Computer-System and OS Structures Common Computer-System and OS Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture Oct-03 1 Computer-System Architecture

More information

CS420: Operating Systems. Kernel I/O Subsystem

CS420: Operating Systems. Kernel I/O Subsystem Kernel I/O Subsystem James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne A Kernel I/O Structure 2 Kernel

More information

I/O Management Software. Chapter 5

I/O Management Software. Chapter 5 I/O Management Software Chapter 5 1 Learning Outcomes An understanding of the structure of I/O related software, including interrupt handers. An appreciation of the issues surrounding long running interrupt

More information

I/O Management Software. Chapter 5

I/O Management Software. Chapter 5 I/O Management Software Chapter 5 1 Learning Outcomes An understanding of the structure of I/O related software, including interrupt handers. An appreciation of the issues surrounding long running interrupt

More information

Computer Architecture CS 355 Busses & I/O System

Computer Architecture CS 355 Busses & I/O System Computer Architecture CS 355 Busses & I/O System Text: Computer Organization & Design, Patterson & Hennessy Chapter 6.5-6.6 Objectives: During this class the student shall learn to: Describe the two basic

More information

Introduction to I/O. 1-Slide Overview to File Management

Introduction to I/O. 1-Slide Overview to File Management Introduction to I/O 1-Slide Overview to File Management I/O Hardware I/O Application Interface I/O Subsystem Issues Note: much material in this set of slides comes directly from Solomon&Russinovich, Inside

More information

Answer to exercises chap 13.2

Answer to exercises chap 13.2 Answer to exercises chap 13.2 The advantage of supporting memory-mapped I/O to device-control registers is that it eliminates the need for special I/O instructions from the instruction set and therefore

More information

C02: Interrupts and I/O

C02: Interrupts and I/O CISC 7310X C02: Interrupts and I/O Hui Chen Department of Computer & Information Science CUNY Brooklyn College 2/8/2018 CUNY Brooklyn College 1 Von Neumann Computers Process and memory connected by a bus

More information

I/O AND DEVICE HANDLING Operating Systems Design Euiseong Seo

I/O AND DEVICE HANDLING Operating Systems Design Euiseong Seo I/O AND DEVICE HANDLING 2016 Operating Systems Design Euiseong Seo (euiseong@skku.edu) I/O Hardware Incredible variety of I/O devices Common concepts Port Bus (daisy chain or shared direct access) Controller

More information

Chapter 13: I/O Systems

Chapter 13: I/O Systems Chapter 13: I/O Systems DM510-14 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations STREAMS Performance 13.2 Objectives

More information

CS162 Operating Systems and Systems Programming Lecture 16. Page Allocation and Replacement (con t) I/O Systems

CS162 Operating Systems and Systems Programming Lecture 16. Page Allocation and Replacement (con t) I/O Systems CS162 Operating Systems and Systems Programming Lecture 16 Page Allocation and Replacement (con t) I/O Systems October 24, 2007 Prof. John Kubiatowicz http://inst.eecs.berkeley.edu/~cs162 Review: Page

More information

Linux Operating System

Linux Operating System Linux Operating System Dept. of Computer Science & Engineering 1 History Linux is a modern, free operating system based on UNIX standards. First developed as a small but self-contained kernel in 1991 by

More information

- Knowledge of basic computer architecture and organization, ECE 445

- Knowledge of basic computer architecture and organization, ECE 445 ECE 446: Device Driver Development Fall 2014 Wednesdays 7:20-10 PM Office hours: Wednesdays 6:15-7:15 PM or by appointment, Adjunct office Engineering Building room 3707/3708 Last updated: 8/24/14 Instructor:

More information

Input Output (IO) Management

Input Output (IO) Management Input Output (IO) Management Prof. P.C.P. Bhatt P.C.P Bhatt OS/M5/V1/2004 1 Introduction Humans interact with machines by providing information through IO devices. Manyon-line services are availed through

More information

CSC Operating Systems Spring Lecture - XIX Storage and I/O - II. Tevfik Koşar. Louisiana State University.

CSC Operating Systems Spring Lecture - XIX Storage and I/O - II. Tevfik Koşar. Louisiana State University. CSC 4103 - Operating Systems Spring 2007 Lecture - XIX Storage and I/O - II Tevfik Koşar Louisiana State University April 10 th, 2007 1 RAID Structure As disks get cheaper, adding multiple disks to the

More information

RAID Structure. RAID Levels. RAID (cont) RAID (0 + 1) and (1 + 0) Tevfik Koşar. Hierarchical Storage Management (HSM)

RAID Structure. RAID Levels. RAID (cont) RAID (0 + 1) and (1 + 0) Tevfik Koşar. Hierarchical Storage Management (HSM) CSC 4103 - Operating Systems Spring 2007 Lecture - XIX Storage and I/O - II Tevfik Koşar RAID Structure As disks get cheaper, adding multiple disks to the same system provides increased storage space,

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

File systems: management 1

File systems: management 1 File systems: management 1 Disk quotas for users Quotas for keeping track of each user s disk use Soft limit and hard limit 2 Backup 3 File System Backup Replacing hardware is easy, but not the data Backups

More information

Eastern Mediterranean University School of Computing and Technology INPUT / OUTPUT

Eastern Mediterranean University School of Computing and Technology INPUT / OUTPUT Eastern Mediterranean University School of Computing and Technology ITEC255 Computer Organization & Architecture INPUT / OUTPUT Introduction Computer system s I/O architecture is its interface to outside

More information

Introduction. CS3026 Operating Systems Lecture 01

Introduction. CS3026 Operating Systems Lecture 01 Introduction CS3026 Operating Systems Lecture 01 One or more CPUs Device controllers (I/O modules) Memory Bus Operating system? Computer System What is an Operating System An Operating System is a program

More information

CSE 4/521 Introduction to Operating Systems. Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018

CSE 4/521 Introduction to Operating Systems. Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018 CSE 4/521 Introduction to Operating Systems Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018 Overview Objective: Explore the structure of an operating system

More information

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices Comp 204: Computer Systems and Their Implementation Lecture 18: Devices 1 Today Devices Introduction Handling I/O Device handling Buffering and caching 2 Operating System An Abstract View User Command

More information

CS 111. Operating Systems Peter Reiher

CS 111. Operating Systems Peter Reiher Operating System Principles: Devices, Device Drivers, and I/O Operating Systems Peter Reiher Page 1 Outline Devices and device drivers I/O performance issues Device driver abstractions Page 2 So You ve

More information

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs). UNIX: HISTORY: 1. 1969 UNIX developed (Ken Thompson). 2. 1972 UNIX rewritten using C (Dennis Ritchie). 3. 1976 UNIX (v6) released for commercial use. 4. 1978 UNIX (v7) released (ancestor of most UNIXs).

More information

I/O Systems and Storage Devices

I/O Systems and Storage Devices CSC 256/456: Operating Systems I/O Systems and Storage Devices John Criswell! University of Rochester 1 I/O Device Controllers I/O devices have both mechanical component & electronic component! The electronic

More information

CSC 553 Operating Systems

CSC 553 Operating Systems CSC 553 Operating Systems Lecture 1- Computer System Overview Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users Manages secondary memory

More information

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1 ITS 225: Operating Systems Operating Systems Lecture 1 Introduction & Overview Jan 15, 2004 Dr. Matthew Dailey Information Technology Program Sirindhorn International Institute of Technology Thammasat

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

Chapter 8: I/O functions & socket options

Chapter 8: I/O functions & socket options Chapter 8: I/O functions & socket options 8.1 Introduction I/O Models In general, there are normally two phases for an input operation: 1) Waiting for the data to arrive on the network. When the packet

More information

Operating Systems CMPSC 473. Input/Output April 22, Lecture 22 Instructor: Trent Jaeger

Operating Systems CMPSC 473. Input/Output April 22, Lecture 22 Instructor: Trent Jaeger Operating Systems CMPSC 473 Input/Output April 22, 2008 - Lecture 22 Instructor: Trent Jaeger Last class: File System Interface Today: I/O OS role in I/O Share the same device across different processes/users

More information