Galen C. Hunt Microsoft Research and the University of Rochester

Slides:



Advertisements
Similar presentations
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed System Architectures.
Advertisements

Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
Introduction to Kernel
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Octopus system1 Moshe Tocker Avihai Mejer. Octopus system2 The Octopus system Goal The system’s primary goal is to Measure performance parameters in real.
Chapter 4 Structure of Operating Systems Copyright © 2008.
Storage Networking Technologies and Virtualization Section 2 DAS and Introduction to SCSI1.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
E Virtual Machines Lecture 4 Device Virtualization
Windows Debugging Demystified
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Design and Implementation of a Linux SCSI Target for Storage Area Networks Ashish A. PalekarAnshul Chaddha, Trebia Networks Narendran Ganapathy, 33 Nagog.
CSE 451: Operating Systems Section 10 Project 3 wrap-up, final exam review.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Increasing Web Server Throughput with Network Interface Data Caching October 9, 2002 Hyong-youb Kim, Vijay S. Pai, and Scott Rixner Rice Computer Architecture.
Introduction to Microsoft Windows 2000 Integrated support for client/server and peer-to-peer networks Increased reliability, availability, and scalability.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
1 Windows NT A Distributed Architecture Windows NT A Distributed Architecture Professor: Mohamed Khalil CSE 8343 GROUP-A5 Dhaval Sanghvi Amit Sharma Ali.
July 14, KIMICS 2006 Kulveer Singh Graduate School of Design & IT Dongseo University Busan, South Korea Data Concurrency Issues in iSCSI Based-Data.
Improving the Reliability of Commodity Operating Systems Michael M. Swift, Brian N. Bershad, Henry M. Levy Presented by Ya-Yun Lo EECS 582 – W161.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 5.
Advisor: Hung Shi-Hao Presenter: Chen Yu-Jen
Network architecture model What is an “architecture model”? An architecture model offers a general frame of reference for the problems connected to the.
Tgt: Framework Target Drivers FUJITA Tomonori NTT Cyber Solutions Laboratories Mike Christie Red Hat, Inc Ottawa Linux.
Introduction to Operating Systems Concepts
Introduction to threads
Operating Systems {week 01.b}
Chapter 2: Operating-System Structures
Introduction to Kernel
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
CS 6560: Operating Systems Design
Chapter 2: Operating-System Structures
Using non-volatile memory (NVDIMM-N) as block storage in Windows Server 2016 Tobias Klima Program Manager.
Direct Attached Storage and Introduction to SCSI
EE-587 Spring FEB 08 William Mullins
Chapter 2: System Structures
Chapter 3: Windows7 Part 4.
Direct Attached Storage and Introduction to SCSI
Chapter 3: Windows7 Part 2.
CSCI 315 Operating Systems Design
Introduction to Operating Systems
Chapter 4: Threads.
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Quiz
Case Study 2: Windows History of windows 2000
Chapter 2: System Structures
I/O Systems I/O Hardware Application I/O Interface
Chapter 3: Windows7 Part 2.
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Chapter 2: The Linux System Part 5
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Outline Device Management Device Manager Design Buffering
Chapter 2: Operating-System Structures
Outline Operating System Organization Operating System Examples
Operating Systems Structure
NVMe.
Operating System Concepts
Operating System Concepts
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Creating User-Mode Drivers with a Proxy (or How to Look Smarter Than You Really Are) Galen C. Hunt Microsoft Research and the University of Rochester Department of Computer Science Writing NT drivers is intellectually challenging. My first experience in creating an NT driver was an attempt to make an HTTP file system driver. To the system, it made data on remote HTTP data appear as local files. Managing remote HTTP connections from kernel mode in a file system driver was more than I had the stomach for.

Problem NT Drivers Difficulties: Kernel-Mode Environment: Minimal (12K) Stack, Paged and Non-Paged Memory Pools, Crashes are Globally Fatal, Two (2) Machines for Debugging. Packet-Driven I/O Model: Fully re-entrant code, Take extreme care when blocking. Two factors make creating NT driver difficult: the environment and the model. NT drivers operate in the kernel environment. They have access to a limited stack (12K), They must carefully decide which resources belong in core and which may be paged. When a driver crashes in crashes the entire system and one typically needs two machines to debug a driver: one for the driver and one for the debugger. Another difficult is the fact that the NT I/O model is packet-event driven. Drivers must be fully re-entrant and must take extreme care when blocking. 15-May-19

Solution Write User-Mode Device Drivers. Use Proxy for a Kernel-Mode Presence. My solution to managing the challenge of create NT drivers is to move the driver into user-mode. Because drivers provide services to the NT kernel, they must have a kernel-mode presence. The primary contribution of this work is a proxy driver that provides a kernel-mode presence for user-mode drivers. 15-May-19

Outline NT Driver & Proxy Architecture Implementation Details Introduction Outline NT Driver & Proxy Architecture Implementation Details Performance Measurements Related Work Conclusions I’ve provided a motivation for this work. Next I will cover the NT driver architecture in general and the architecture of the proxy driver in particular. I will then describe the implementation of the proxy driver in more detail, present some performance results and describe related work as time permits.

NT Kernel-Mode I/O Architecture I/O Manager = I/O Request Packet Crypto - Filter Driver NTFS - File-System Driver Stripe (RAID) - Intermediate Driver The NT I/O architecture follows a packet-oriented, layered model. At the top is the I/O manager which converts API calls into I/O request packs: IRPs. SCSI - Port Driver Adaptec - Miniport (Adapter) Driver

Kernel-Mode Driver Architecture Application and Win32 Subsystem User Mode APIs NT Executive (I/O Manager) Kernel Mode IRPs Device Entry Device Driver

Proxy Driver Architecture App. & Win32 User-Mode Driver User Mode COM COM Service APIs APIs NT I/O Manager Kernel Mode IRPs Stub Entry Host Entry IRPs Proxy Driver

Proxy Details 1 App. & Win32 User-Mode Driver COM Service NT I/O Manager Stub Entry Host Entry 1. COM Service makes API Read call Proxy Driver

Proxy Details 2 App. & Win32 User-Mode Driver COM Service 1 NT I/O Manager 2 Stub Entry Host Entry 2. I/O Manager converts call to an IRP and post through the proxy device entry. Proxy Driver

Proxy Details 3 App. & Win32 User-Mode Driver COM Service 1 NT I/O Manager 2 Stub Entry Host Entry 3. Proxy driver places IRP in transport queue and marks as pending. Proxy Driver 3

Proxy Details App. & Win32 User-Mode Driver COM Service 4 1 NT I/O Manager 2 Stub Entry Host Entry 4. Application makes API call. Proxy Driver 3

Proxy Details 5 App. & Win32 User-Mode Driver COM Service 4 1 NT I/O Manager 5 2 Stub Entry Host Entry 5. I/O Manager converts call to an IRP and posts through the stub device entry. Proxy Driver 3

Proxy Details 6 App. & Win32 User-Mode Driver COM Service 4 1 NT I/O Manager 5 2 Stub Entry Host Entry 6. Proxy driver places IRP in request queue and marks as pending. Proxy Driver 6 3

Proxy Details 7 App. & Win32 User-Mode Driver COM Service 4 1 NT I/O Manager 7 5 2 Stub Entry Host Entry 7. Driver removes one request and one transport IRP from each queue, writes request into transport IRP’s buffer and completes transport IRP. Proxy Driver 6 3

Proxy Details 8 App. & Win32 User-Mode Driver COM Service 4 1 NT I/O Manager 7 5 2 Stub Entry Host Entry 8. COM Service calls user-mode driver through IDeviceFileSink Proxy Driver 6 3

Proxy Details 9 App. & Win32 User-Mode Driver 8 COM Service 4 1 NT I/O Manager 7 5 2 Stub Entry Host Entry 9. User-mode driver processes request and returns. Proxy Driver 6 3

Proxy Details 10 App. & Win32 User-Mode Driver 9 8 COM Service 4 1 NT I/O Manager 7 5 2 Stub Entry Host Entry 10. COM Service makes API Write call to return response. 10 Proxy Driver 6 3

Proxy Details 11 App. & Win32 User-Mode Driver 9 8 COM Service 4 1 NT I/O Manager 7 5 2 Stub Entry Host Entry 11. Proxy driver completes application request IRP. 10 Proxy Driver 6 3

Proxy Details Summary 9 8 1 4 11 5 2 7 10 6 3 App. & Win32 User-Mode Driver 9 COM Service 8 1 4 NT I/O Manager 11 5 Stub Entry Host Entry 2 7 1. COM Service makes API Read call 2. I/O Manager converts call to an IRP and post through the proxy device entry. 3. Proxy driver places IRP in transport queue and marks as pending. 4. Application makes API call. 5. I/O Manager converts call to an IRP and posts through the stub device entry. 6. Proxy driver places IRP in request queue and marks as pending. 7. Driver removes one request and one transport IRP from each queue, writes request into transport IRP’s buffer and completes transport IRP. 8. COM Service calls user-mode driver through IDeviceFileSink 9. User-mode driver processes request and returns. 10. COM Service makes API Write call to return response. 11. Proxy driver completes application request IRP. 10 Proxy Driver 6 3

Null (Raw) Device Latency = 14s

Raw Device Throughput

RamDisk Throughput

File-System Write Throughput

Related Work Watchdogs [Bershad & Pinkerton, 1988] Semantic File System [Gifford et al, 1991] HURD Translators [Bushnell, 1994] Frigate [Kim and Popek, 1997] Rialto [Draves and Cutshall, 1997]

Conclusion Drivers Create with Proxy include: HTTP/FTP File System Virtual Memory Disk Further Information: http://research.microsoft.com/~galenh/proxy

Appendix A: IDeviceFileSink interface IDeviceFileSink : IUnknown { HRESULT Create ([in] IDevIrp *pIrp, [in] IDevSecurityContext *pCtxt,... HRESULT Cleanup ([in] IDevIrp *pIrp); HRESULT Close ([in] IDevIrp *pIrp); HRESULT Shutdown ([in] IDevIrp *pIrp); HRESULT Read ([in] IDevIrp *pIrp, [in] LARGE_INTEGER ByteOffset,... HRESULT Write ([in] IDevIrp *pIrp, HRESULT DeviceControl ([in] IDevIrp *pIrp, [in] ULONG IoControlCode,... HRESULT QueryInformation([in] IDevIrp *pIrp, [in] ULONG Length,... HRESULT SetInformation ([in] IDevIrp *pIrp, HRESULT FlushBuffers ([in] IDevIrp *pIrp); };