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
Drivers for PIT and Other Common Devices
Those devices are so inextricably linked with the kernel that I just use a dedicated class for each, only available to the kernel. I don't need anything more advanced, as I can see no reason why I would give user processes unfettered access to my ISR pointers.
I do however provide a mechanism for recieving IRQs - a user process can request to be signalled when an IRQ arrives - it provides a POSIX signal number.
JamesM
I do however provide a mechanism for recieving IRQs - a user process can request to be signalled when an IRQ arrives - it provides a POSIX signal number.
JamesM