Drivers

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
brwarner
Posts:6
Joined:Tue Aug 26, 2008 1:21 am
Drivers

Post by brwarner » Sun Aug 31, 2008 3:53 pm

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?

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Mon Sep 01, 2008 1:28 am

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.

brwarner
Posts:6
Joined:Tue Aug 26, 2008 1:21 am

Post by brwarner » Mon Sep 01, 2008 1:33 am

Ok, thanks - also, your tutorials said drivers are executed in a different ring as well though.

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Mon Sep 01, 2008 5:34 am

Not necessarily. Kernel mode drivers may execute at ring 0...It all depends on your systems design.

Post Reply