Re: Device Driver that uploads it's own code?
- From: Jeroen Mostert <jmostert@xxxxxxxxx>
- Date: Tue, 03 Jun 2008 19:32:34 +0200
respect privacy wrote:
I'm a newbie to Device Driver development so this may be an off-the-wall question:Yes, but this is hardly trivial. Worse, such a design would be badly flawed since it would give user mode code full access to the kernel, which is exactly what the separation between user mode and kernel mode is supposed to prevent. If your user-mode components have a vulnerability, this can be exploited by a third party to get kernel-mode access, which is game over. Even a simple bug in your user-mode application can crash the whole system. In short: don't do that.
Is it possible to have only the outer skeleton of a device driver, where the inner code logic is uploaded at runtime from the users own application that uses the driver?
I'd like to give UserMode applications full control/configuration and runtime alteration of the driver's behavior. For example, if the driver must deal with complicated timing and sequencing issues on real-time in/out data streams, and those issues are not know until runtime or might even change during the application's runtime, how else can that be coped with?
By having the driver do its own timing and adjustment, just like many parts of the Windows kernel do? How would a user-mode application be of any help here? If a kernel-mode component couldn't handle "real-time in/out data streams", a user-mode component certainly couldn't.
You can have a user-mode component tune a driver, but the communication should be indirect: the user-mode component can, for example, set registry values that the kernel-mode component would read and act on. Obviously, the kernel-mode component has to verify any such parameters thoroughly and have sensible defaults to fall back on.
Seem impractical to have a library of 1,000's of slightly differentSoftware is highly nonlinear. A few branches can produce exponentially more reachable state. I highly doubt you've got a problem with flexibility. Even if you do, the separation between kernel-mode and user-mode curtails flexibility in trade for stability. Don't be too eager to trade it away.
device drivers and always be unloading reloading different drivers to
accommodate different functionality that changes on-the-fly. Or to have a
mega-driver with millions of different code branches to account for all
possible combinations.
Maybe this is what is meant by UserMode driver?
No. A user-mode driver is what the name implies: a driver that runs in user mode, and has no separate kernel component of its own. Instead it uses kernel services just like a user-mode application would.
I'm still not clear on difference between a KernalMode and UserModeKernel-mode driver: direct access to the hardware, direct access to system structures, more risk of making the system unstable or insecure, crashed driver will bring down the entire system.
driver, and under which situations I would use either one, and their
respective advantages disadvantages.
User-mode driver: no direct access to the hardware (must rely on already provided services), no access to system structures beyond what services provide and what all user-mode code has, less risk of making the system unstable or insecure, crashed driver cannot bring down the system.
Is there some kind of digital signature that's within all .SYS files, which is tested for validity before it's allowed to load or run?
Not exactly, but something like it. You're probably thinking of WHQL certification. Look it up.
If so, is there a "hack" workaround to get past such limitations?
Yes, but there are good reasons why those limitations are there.
--
J.
http://symbolsprose.blogspot.com
.
- References:
- Device Driver that uploads it's own code?
- From: respect privacy
- Device Driver that uploads it's own code?
- Prev by Date: Re: Device Driver that uploads it's own code?
- Next by Date: Re: Volume Serial No
- Previous by thread: Re: Device Driver that uploads it's own code?
- Next by thread: Get Handle Owner,...
- Index(es):
Relevant Pages
|