bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plan to work on user-level device drivers


From: Da Zheng
Subject: Re: plan to work on user-level device drivers
Date: Tue, 07 Jul 2009 13:33:17 +0800
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Hi,

The paper "An I/O System for Mach 3.0" gives very short description of the user-level device management: Devices can be managed from user-level by vectoring all device interrupts out to an application's thread. The kernel maps to user space the device's registers, a shared page containing some control information, and some memory for handling DMA to/from the device. When an interrupt comes, a small interrupt routine saves any volatile register state in the shared page for later use by the user code, and then dismisses the interrupt, typically by disabling the interrupt enable bit in the device, or by reading an "interrupt-acknowledge" register. When the user thread runs it just invokes the driver's interrupt routine as if it were handling the interrupt in kernel-mode. After all necessary processing, the thread then re-enables interrupts in the device.

I have several questions:
* I suppose we can map to the user space the device's registers, etc, by using device_map, but I don't know how to do it in practice.
* Does the small interrupt routine in the kernel already exists?
* What is the programming interface provided by the kernel to the user-level device driver? Is it still the same set of functions: device_* in device.defs?

Zheng Da




reply via email to

[Prev in Thread] Current Thread [Next in Thread]