What Makes Device Driver Development Hard Synthesizing Device Drivers Roumen Kaiabachev and Walid Taha Department of Computer Science, Rice University.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Lectures on File Management
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
OS Spring’03 Introduction Operating Systems Spring 2003.
Improving IPC by Kernel Design Jochen Liedtke Shane Matthews Portland State University.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Device Management.
Computer Organization and Architecture
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
1 I/O Management in Representative Operating Systems.
UQC113S2 Interrupt driven IO. We have already seen the hardware support required to facilitate interrupts We will now look at the higher levels of software.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Dr. Ken Hoganson, © August 2014 Programming in R STAT8030 Programming in R COURSE NOTES 1: Hoganson Programming Languages.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
Input and Output Computer Organization and Assembly Language: Module 9.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
2: Computer-System Structures
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Operating Systems Security
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 3 Operating Systems. © 2005 Pearson Addison-Wesley. All rights reserved 3-2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
I/O Software CS 537 – Introduction to Operating Systems.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Transmitter Interrupts Review of Receiver Interrupts How to Handle Transmitter Interrupts? Critical Regions Text: Tanenbaum
Operating systems depend on device drivers to communicate with attached hardware. A device driver is a collection of subroutines written in a low-level.
Chapter 9: Virtual Memory
Computer Architecture
Day 08 Processes.
Day 09 Processes.
Real-time Software Design
Chapter 9: Virtual-Memory Management
Computer-System Architecture
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
Architectural Support for OS
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Introduction to Operating Systems
Module 2: Computer-System Structures
Architectural Support for OS
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Presentation transcript:

What Makes Device Driver Development Hard Synthesizing Device Drivers Roumen Kaiabachev and Walid Taha Department of Computer Science, Rice University Problems of More Complex Driver For Continuous Data Acquisition Device drivers:  Are written in low-level languages with minimal support for modularity and code reuse  Execute in the operating system kernel. A driver code crash takes the whole system down The Windows 2000 Architecture Case Studies (Jointly With National Instruments and Schlumberger) Existing software high-level tools claim to help:  Cyclone – statically typed safe dialect of C  Devil – DSL, high-level definition of bit- mapped I/O  NDL – DSL, state-machine-based model of device resources and common device driver operations  BLAST – software model checking We wrote a tiny device driver in each of the tools to study how much and to what extent. While there were several useful techniques to consider, neither tool offers a systematic way of writing device drivers. Acknowledgements This work is supported by the National Science Foundation, a Texas ATP grant National Instruments, and Schlumberger How to Improve the Development Process We want to use high level declarative specifications to generate device drivers which model operating system processes and correctly communicate with the hardware. We are designing and implementing a domain-specific language (DSL) RIDL which will provide the formal theory and software engineering medium for development of device drivers. {3} Wait strategy. There a number of ways to wait when requested data is not yet available. {4} Page locking. Memory accessed from an interrupt-service routine (ISR) or as part of a direct memory access transfer must be "page-locked" to prevent pages from being swapped out. {5} Atomic device access. The device can be concurrently accessed from both the ISR and from a user process calling device code. The driver has to guarantee the ISR atomic access until it is done unless it is interrupted by a higher priority interrupt. {6} Buffer overflow. In the case of a buffer overflow, the driver has to indicate missed data to the user application. {7} Bad parameters. The driver should detect bad parameters passed to the device. {8} Handling device reset. The driver should support a reset function that stops any ongoing acquisition and returns the device to an initial state. How RIDL Will Solve These Problems  We will use a higher-level representation of the physical device state to tackle {1}, {2}, {3}, {4}, {6}, {8}  We will use types for safe locking and will explicitly model an interrupt scheduler (constraints will be applied from defined scheduling requirements). {5}  We will use Devil-like interface checking and a BLAST-like approach to guarantee that certain user-specified states cannot be reached. {7} Handling Other Driver Problems We will expand RIDL to handle other interesting device driver paradigms and make it a useful tool for driver writers. {1} Resource tracking. It is illegal to start an acquisition at the same time another one is already running. Similarly, it is invalid to read data or stop an acquisition if none is running. {2} Buffering. Data acquired continuously is transferred in the background from a small hardware buffer on the device to a larger buffer in computer memory. There are several ways to buffer data until an application can read it.