Drivers for PIT and Other Common Devices
Posted: Mon Sep 17, 2007 2:17 am
Hello,
I am examining my driver interface (again) and now have something that works fairly well. I have an incomplete driver class for video devices and one for character-like devices.
I am now looking at some of the more common system devices like the PIT, PIC, APIC etc. Up until this point, I have pretty much let my interrupt module handle the PIC/APIC, my scheduler handles the PIT and so on. I would now like to try to use my device manager to handle all of this instead.
Only problem is, I can't quite see how to do it 'nicely'. Some of these devices don't seem to fit in with "character driver" methodology. I thought about making it 'property-based'. In other words, for the (A)PIC, I would have a property "int0", which would be set to the value of the int0 ISR pointer. I guess this could work for setting the interval of the PIT too (have an "interval" property). I should perhaps point out that I have a CDevice class which can expose the properties in a way where locks are dealt with at kernel level. My aim is also not to have a separate interface for every single driver (and therefore a huge switch statement).
How do you deal with these common system devices?
Cheers,
Adam
I am examining my driver interface (again) and now have something that works fairly well. I have an incomplete driver class for video devices and one for character-like devices.
I am now looking at some of the more common system devices like the PIT, PIC, APIC etc. Up until this point, I have pretty much let my interrupt module handle the PIC/APIC, my scheduler handles the PIT and so on. I would now like to try to use my device manager to handle all of this instead.
Only problem is, I can't quite see how to do it 'nicely'. Some of these devices don't seem to fit in with "character driver" methodology. I thought about making it 'property-based'. In other words, for the (A)PIC, I would have a property "int0", which would be set to the value of the int0 ISR pointer. I guess this could work for setting the interval of the PIT too (have an "interval" property). I should perhaps point out that I have a CDevice class which can expose the properties in a way where locks are dealt with at kernel level. My aim is also not to have a separate interface for every single driver (and therefore a huge switch statement).
How do you deal with these common system devices?
Cheers,
Adam