Stream micro-Drive Development Guide (I)

Source: Internet
Author: User

Stream microDriver Development Guide

-- Translation: codewarrior @ HS5 @ HS5

Note: This section describes the outdated stream. sys class drivers. With the official release of Microsoft Windows XP, Microsoft recommends that hardware manufacturers consider using the next-generation class model-avstream-to develop new, non-audio multimedia drivers. For details, see the avstream overview chapter. Microsoft currently only provides basic support for stream. sys. If you want to develop an audio Minidriver, see audio miniport drivers.

Many devices are supported by the operating system by providing stream Minidriver. Video capturing devices, such as digital cameras and DVD players, are supported by stream Minidriver, and external audio devices. For more information, see video capture Minidriver design guide and vendor-supplied DVD drivers.

Stream Minidriver supports kernel streams. Here I assume that the readers of this article are familiar with the basic concepts of kernel stream. If you do not understand, read "kernel streaming overview" first.

The purpose of stream class driver design is to simplify the development of stream device drivers by handling many details of interaction with the operating system.

Minidriver enables stream class driver to handle synchronization issues on its behalf. For example, stream class driver can serialize I/O requests for Minidriver at will. By letting the class driver handle synchronization issues for it, Minidriver can ensure the security of the multi-processor platform, but the Code cannot be reentrant. This is suitable for backend (low-end) to mid-end (medium-end) hardware.

The class driver automatically synchronizes file operations. For example, you can use mutex, semaphores, or event to enable the stream and device to be serialized correctly without the involvement of Minidriver.

The class driver abstracts the implementation details of the kernel stream from the Minidriver.

The class driver processes all interactions with the PnP Manager. For example:

Class driver represents the function device object created by Minidriver ).

Class driver manages resource settings (such as translation port address, translation and ing memory range, connection interruption)

The class driver processes the pnp irp packet. For example, irp_mn_start_device, or irp_mn_stop_device.

All low-level buffer management is also completed by the class driver.

Assign a DMA adapter object if necessary.

Map the buffer and create a scatter/gather list for the DMA instance.

Locking and flushing Buffer

The correctness of all Io control codes is also verified by the class driver.

The class driver uses the watchdog timer to timestamp all requests.

Minidriver does not create a device object. It can share the device object of class driver when necessary. In this way, system resources can be reduced.

Each adapter creates only one device object. The mulitiple subdevice (called Stream) supported by the adapter is described by WDM streaming pins.

I. Definition of class driver and Minidriver

 

The class driver is an intermediate driver (or media driver) provided by Microsoft. It is used to provide a simple interface between the Minidriver provided by the hardware vendor and the operating system. Minidriver is a hardware-related DLL. It uses the class driver provided by Microsoft to complete most of the operations through function calling. It only provides device-related control.

In the WDM model, Minidriver registers all the hardware adapters associated with the class driver (hardware adapter), and then the class driver creates a file object (file object) to describe each adapter registered with it. Minidriver uses the device object of the class driver to call the system. User-mode client code can access class driver through WDM streaming.

The interaction between class driver and Minidriver includes:

· Minidriver does not create its own device object, but shares the device object of class driver when necessary, which can save system resources.

· Each adapter can only create one device object. The mulitiple subdevice (called Stream) supported by the adapter is described by WDM streaming pins.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.