CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012
    Posts
    5

    Question [Hook HW interrupts in flat memory mode with DOS32/A]

    Dear all,
    I have a question about how to hook HW interrupt in flat memory mode...

    @ about my application...
    - application is created by combining Watcom C and DOS32/A.
    - application is written for running on DOS mode( not on OS mode )
    - with DOS32/A now I can access >1M memory and allocate large memory to use...(running in flat memory mode !!!)

    @ current issue...
    - I want to write an ISR(interrupt service routine) for one PCI card. Thus I need to "hook" the HW interrupt.
    - Ex. the PCI card's interrupt line = 0xE in DOS. That means this device will issue interrupt via 8259's IRQ 14.
    But I did not how to achieve my goal to hook this interrupt in flat mode ?

    @ resource I found...
    - in watcom C's library, there is one sample using _dos_getvect, _dos_setvect, and _chain_intr to hook INT 0x1C...
    I tested this code and found OK. But when I apply it to my case: INT76 ( where IRQ 14 is "INT 0x76" <- (14-8) + 0x70 )
    then nothing happened...
    * I checked HW interrupt is generated but my own ISR did not invoked...

    Do I lose something ? or are there any functions I can use to achieve my goal ?

  2. #2
    Join Date
    Apr 2012
    Posts
    29

    Re: [Hook HW interrupts in flat memory mode with DOS32/A]

    Hi,laooo
    "hook" is an incorrect word to use, it's boastful, and misleading, you may just re-dispatch the interrupt signal at your own will

  3. #3
    Join Date
    Jul 2012
    Posts
    5

    Re: [Hook HW interrupts in flat memory mode with DOS32/A]

    here the hook means:
    - save the address corresponding to INT x
    - put a new address to that entry for INT x

    * new address points to the user-defined routine and within it
    check if belongs to mine
    if YES then process it then exit with IRET
    else pass control to ori routine

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured