Page 1 of 1

Drivers for PIT and Other Common Devices

Posted: Mon Sep 17, 2007 2:17 am
by AJ
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

Posted: Mon Sep 17, 2007 3:14 am
by JamesM
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