?

Log in

No account? Create an account

Previous Entry | Next Entry

code geeking


The way this sting is structured, I have to pass a parameter in to an interrupt routine.

Because the OS handles all the interrupts at the kernel level, you have to "register" your interrupt handler based on the interrupt level. So you have to register two different interrupt handlers for level 3 and level 4 interrupts, even though it's the same handler... but this one handler has to handle interrupts from COM1, COM2, COM3, and COM4.
To do this, I have to pass a pointer to the serial parameter block in to the interrupt handler. Except that there are only two handler registries, and four parameter blocks.
SO when I initialize a com port, I'm initializing it by the parameter block. For example, COM1 and COM3 both share interrupt level 3. When I initialize the block for COM1, I register the interrupt handler for interrupt level 3 to point to the interrupt handler and the parameter block for COM1. However, when I get to COM3, I can't register a new interrupt handler, as one is already allocated.

Ideally I'd not pass in a parameter at all, and force the interrupt routine to poll the status of each port. Unfortunately at this level, I only know the base address of the UART associated with that port. I could cheat, but that would break the purpose of the hardware abstraction layer.

Aargh.

Latest Month

April 2012
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Tags

Powered by LiveJournal.com
Designed by Tiffany Chow