delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/07/18:54:51

From: "steven mann" <steve DOT mann AT gecm DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: How do I get INT 11 (vector 73h) to work in protected mode
Date: Tue, 7 Mar 2000 14:04:03 -0000
Lines: 109
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: basit47307946.basldn.gecm.com
Message-ID: <38c50cce$1@pull.gecm.com>
X-Trace: 7 Mar 2000 14:06:06 GMT, basit47307946.basldn.gecm.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have written a program that must run in PROTECTED mode to enable
interfacing functions to work with a PCI card that I have designed.

I have looked at all the FAQ's for DJGPP edition 2.11 for DJGPP 2.01. This
has not helped as I appear to be doing everything neccesary.

I am using CWSDPMI as the DPMI host and my program is only 40k in size. The
interrupt handler is
called "int_trans " of which I have captured the location in memory to place
in the vector table 73h for interrupt 11. The interrupt handler does not get
called when  I run the program despite all, my efforts. I can see interrupts
being generated by the hardware and thats it.

All data and functions used during interrupt handling have been locked to
prevent paging out.

I hope someone can point out what I may have done wrong, as I have got to
the stage were I have read so much documentation on what people think I
should do, I have become totally confused.

If anyone can help I would be very grateful many thanks -  steve.

An extract of the code for interrupt installing is below.

dword irq_number=11;               //Interrupt number that interrupt
function is hooked into
dword int_11_vector=0x73;          //Vector number for interrupt 11



if (_go32_dpmi_lock_data(&last_packet,sizeof(last_packet))!=0)
   {
    printf("\nFailed to lock global in memory");
    exit(0);
   }

 if (_go32_dpmi_lock_data(&main_pkt_list,sizeof(main_pkt_list))!=0)
   {
    printf("\nFailed to lock global in memory");
    exit(0);
   }


 if (_go32_dpmi_lock_data(&control,sizeof(control))!=0)
   {
    printf("\nFailed to lock global in memory");
    exit(0);
   }

        if (_go32_dpmi_lock_data(&Selector,sizeof(Selector))!=0)
   {
    printf("\nFailed to lock global in memory");
    exit(0);
   }

 if (_go32_dpmi_lock_data(&LinearAddress,sizeof(LinearAddress)) != 0)
   {
    printf("\nFailed to lock global in memory");
    exit(0);
   }


/*--------------------------------------------------------------------------
----------

   Lock PCI Interrupt handler code
   interrupt 11    vector 73h
----------------------------------------------------------------------------
---------*/

 if (_go32_dpmi_lock_code(int_trans, (long)end_int_trans -
(long)int_trans)!=0)
          {
    printf("\nFailed to lock Panavia PCI Card interrupt handler code in
memory");
    exit(0);
   }


 if (_go32_dpmi_get_protected_mode_interrupt_vector(int_11_vector,
&pci_vector)!=0)
   {
    printf("\nFailed to get clock interrupt vector");
    exit(0);
   }

 int_trans_vector.pm_offset = (int)int_trans;
 int_trans_vector.pm_selector = _my_cs();

        /*The wrapper function creates a small assembler function that
handles
   the overhead of servicing an interrupt.  */

 if (_go32_dpmi_allocate_iret_wrapper(&int_trans_vector)!=0)
   {
    printf("\nFailed to allocate Panavia PCi card interrupt wrapper");
    exit(0);
   }


 if (_go32_dpmi_set_protected_mode_interrupt_vector(int_11_vector,
&int_trans_vector)!=0)
   {
    printf("\nFailed to set interrupt Panavia PCi card vector");
    exit(0);
   }



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019