Tom Ramcigam (magicmarmot) wrote,
Tom Ramcigam

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.


  • (no subject)

    Woke up this morning, let the dog outside. There is snow. Crawling back into bed now.

  • (no subject)

    This is not Old Man Winter. This is Crazy Psycho Bitch Winter.

  • (no subject)

    My shoulder has been bugging me a lot, enough that I spent most of the day in bed soused up with NSAIDS. On top of that, some sicky-icky stuff that…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.