Page 1 of 1

Drivers

Posted: Sun Aug 31, 2008 3:53 pm
by brwarner
Hi, I was just wondering - what exactly is the implementation of a driver?

Like, I understand its just functions to control a specified device, but do I have to do anything special or just like write a class to put text on the screen, link it into the kernel and call it a driver? And if so, how does like dynamic driver loading work - where I can have different drivers for the same device depending on specific hardware?

Posted: Mon Sep 01, 2008 1:28 am
by Mike
There isn't anything "special" about drivers. Their primary purpose is to create an abstract interface for controlling a device or devices.
write a class to put text on the screen, link it into the kernel and call it a driver?
This is an example of a "minidriver", yes.
And if so, how does like dynamic driver loading work - where I can have different drivers for the same device depending on specific hardware?
You can use a single driver to control a hardware device at a time. To change drivers to use during runtime can either be an easy or hard task depending on how you manage hardware devices.

Normally the large OS manufactures develop driver kits (Like the Windows DDK) that provide specifications, requirements, and API for the driver to work with the OS.

Posted: Mon Sep 01, 2008 1:33 am
by brwarner
Ok, thanks - also, your tutorials said drivers are executed in a different ring as well though.

Posted: Mon Sep 01, 2008 5:34 am
by Mike
Not necessarily. Kernel mode drivers may execute at ring 0...It all depends on your systems design.