How to Write an ATAport Miniport

Slides:



Advertisements
Similar presentations
Device Virtualization Architecture
Advertisements

1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Computer Systems/Operating Systems - Class 8
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
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.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
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)
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 2: Managing Hardware Devices.
Lesson 9: Creating and Configuring Virtual Networks
Storage Networking Technologies and Virtualization Section 2 DAS and Introduction to SCSI1.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Bob Griswold Program Manager WDEG Storage Microsoft Corporation
Mahesh Wagh Intel Corporation Member, PCIe Protocol Workgroup.
iSCSI Management and Tuning Shiv Rajpal Senior Development Lead Device and Storage Technologies
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
Toolbox for Dimensioning Windows Storage Systems Jalil Boukhobza, Claude Timsit 12/09/2006 Versailles Saint Quentin University.
AHCI: ATAport Miniport Example. Outline AHCI Features Goals Basics AHCI ATA Miniport Design Philosophy Memory Structures and Resources Enumeration IO.
Storage Testing in DTM Eric St.John Software Design Engineer in Test Storageマイクロソフトディベロップメント株式会社部署名名前.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 2: Managing Hardware Devices.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Chapter 5 Section 2 : Storage Networking Technologies and Virtualization.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
ATA Miniport Nuts and Bolts
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
IO Memory Management Hardware Goes Mainstream
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
An I/O Simulator for Windows Systems Jalil Boukhobza, Claude Timsit 27/10/2004 Versailles Saint Quentin University laboratory.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
Device Drivers CPU I/O Interface Device Driver DEVICECONTROL OPERATIONSDATA TRANSFER OPERATIONS Disk Seek to Sector, Track, Cyl. Seek Home Position.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
WHDC PowerPoint Template Notes & Handouts
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
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.
STORAGE ARCHITECTURE/ MASTER): Disk Storage: What Are Your Options? Randy Kerns Senior Partner The Evaluator Group.
Bob “GRIZZY” Griswold Senior Program Manager, WHEG Microsoft Corporation.
Computer Studies (AL) I/O Management. Reference Silberschatz, Galvin, Gagne “Operating System Concepts 6 th edition”, 2003, Wiley Stallings, “Operating.
Device Driver Concepts Digital UNIX Internals II Device Driver Concepts Chapter 13.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
UDI Technology Benefits Slide 1 Uniform Driver Interface UDI Technology Benefits.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
UDI Architecture In-Depth Robert Lipe UDI Development Team Lead
CITA 171 Section 1 DOS/Windows Introduction. DOS Disk operating system (DOS) –Term most often associated with MS-DOS –Single-tasking operating system.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1 load [2], [9] Transfer contents of memory location 9 to memory location 2. Illegal instruction.
Plug and Play (PnP) By: James Jacobs Jonathan Joyce.
Introduction to Operating Systems Concepts
Introduction to Kernel
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
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.
WHDC PowerPoint Template Notes & Handouts
Direct Attached Storage and Introduction to SCSI
Direct Attached Storage and Introduction to SCSI
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Selecting a Disk-Scheduling Algorithm
CS703 - Advanced Operating Systems
Chapter 2: Operating-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
NVMe.
Chapter 2: Operating-System Structures
Chapter 13: I/O Systems.
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:

How to Write an ATAport Miniport

Outline Current ATA Environment ATAport Solution ATAport Features ATAport Model Best Known Practices

Industry Activities Many Vendor ATA drivers are Scsiport miniports Creating an inconsistent behavior around ATA command handling Emphasis on consumer RAID The introduction of SATA interconnect Requires new feature support Has a richer host controller interface Still uses ATA, which is a duplicate of a significant portion of the ATA driver infrastructure

ATAport Goals Extensibility Compatibility Flexibility Diagnosability Support innovations in the ATA industry Compatibility Accommodates existing and new hardware Flexibility Enables Vendor value add Diagnosability

ATAport Features ATA/ATAPI 7 support SATA support Command Queuing Forced Unit Access Advanced Power Management SATA support Support for greater than 2 channels/controller Support for greater than 2 devices/channel Command Queuing Channel-based queuing Device-based queuing

ATAport Features Support for Message Signal Interrupts Hotplug Provides greater flexibility and stability in interrupts Hotplug More granular Power Management control ATAport provides a flexible miniport interface for vendor value add

ATAport Model: Port Services Translation of upper OS storage requests into ATA protocol Automatic Generation of Sense Data for ATA devices Push model as opposed to a Pull model Improved IDE Request Block that more accurately maps to the underlying hardware model

ATAport Model: Port Services Asynchronous device reset management Hierarchical reset (device and channel) Asynchronous device power management Per-channel granularity Power, resets, queuing, interrupts I/O is concurrent

ATAport Model: Miniport Capabilities Negotiation of Device parameters Transfer mode Bytes/Sector Sectors/block LBA sectors/disk Removable media Decide on channel- or device-based command queuing Control the timeout on a per-request basis Request the mapping of data buffers on a per request basis Miniport can participate in the queuing policy Selection of depth, freezing,retry

ATAport Interface Illustration Default Miniport ATAport Channel 0 Channel 1 Disk Channel Interface Disk Controller Interface Port IO Pciidex Vendor Miniport Hardware CS BAR

Controller Interface ATAport Miniport Driver Entry AtaPortInitializeEx Start Controller AdapterControl w/ IdeStart AtaControllerIntitialize Enumerate Channels ControllerChannelEnabled AtaControllerChannelEnabled ChannelInitialize

Channel Interface ATAport Miniport Initialize Channel ChannelInitialize ChannelInitialize Start Channel HwControl w/ IdeStart AtaChannelControl Configure Devices AtaHwIntitialize HwIntitialize I/O HwBuildIO AtaHwBuildIO HwStartIO AtaHwStartIO HwInterrupt AtaHwInterrupt

Keep track of extensions in global variables Trick: Extensions Keep track of extensions in global variables Finding Channel Extensions !devstack 0x8245dbf8 !DevObj !DrvObj !DevExt ObjectName 8246a030 \Driver\disk 8246a0e8 disk 8245c478 \Driver\ACPI 8245ac80 0000008a 8245dbf8 \Driver\msahci 8245dcb0 ataport Channel extension is DevExt +0x84 Finding the Controller Extension 8246a030 \Driver\msahci 8246a0e8 PciIde2 8245dbf8 \Driver\pci 8245dcb0 NTPNP_PCI0012 Controller Extension is DevExt +0x88 No device objects during crashdump

Best Known Practices: CrashDump/Hybernate Creates an unused copy of the miniport at boot time Has no driver stack, runs single threaded, processes 1 IO at a time Can be identified by ChannelConfiguration.ChannelMode Cannot touch PCI config space Cannot use more than 30KB of uncached extension per channel

AtaPortStallExecution Trick: Stalling AtaPortStallExecution Spinlocks the CPU for x microseconds Should not be used for greater than 1 millisecond delays AtaPortRequestTimer Causes the port driver to trigger a callback routine after x microseconds Should be used for greater than 1 millisecond delays Best when used with multiphase functions Remember crashdump is single-threaded

Best Known Practices: Memory Allocation Uncached Extension allocation can only be done during Start Channel AtaPortGetPhysicalAddress retrieves physical address for: IRB's data buffer IRB's IrbExtension Miniport's uncached extension SGList Entries and Page Breaks

Best Known Practices: Queuing Per Channel Use IDE_UNTAGGED for TargetID on QueueTag function calls Per Device Use TargetID on QueueTag function calls Always, Always pause the queue with AtaPortDeviceBusy when failing an IRB with IRB_STATUS_BUSY

Best Known Practices: Bus Configuration Changes ChannelEnable is optional and only used to validate the channel Critical hardware operations should not be done in ChannelEnable ChannelEnable will only be called during QueryDeviceRelations Use AtaPortBusChangeDetected to reenumerate a channel Use AtaPortDeviceArrived and AtaPortDeviceRemoved for device hotplug

Best Known Practices: IO Error Reporting STATUS_BUSY Host is busy Make sure to pause the queues with AtaPortDeviceBusy SELECTION_TIMEOUT Device busy Not necessarily retried IRB AtaStatus and Error fields Only valid on Selection_Timeout, and Error

Summary ATAport is an improved port-miniport interface for ATA-based controllers ATAport supports the latest ATA and architecture features

Additional Resources ATA Miniport Interface List of Specifications Documented in the WDK List of Specifications ATA - http://www.t13.org SATA - http://www.serialata.org SCSI - http://www.t10.org AHCI - http://developer.intel.com/technology/serialata/ahci.htm

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.