Re: Interrupt Handlers
- Posted by Jacques Deschenes <desja at GLOBETROTTER.QC.CA> Sep 11, 1997
- 752 views
At 15:04 11-09-97 -0500, you wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at >MIAMIU.ACS.MUOHIO.EDU> >Poster: Craig Gilbert <cgilbert at CENNET.MC.PEACHNET.EDU> >Subject: Interrupt Handlers >------------------------------------------------------------------------------- > > Greetings all: > > I have been working on an interrupt handler for INT 24, and it is slow >going. Pete Eberlein helped me a lot on the basics, but I am still running >into a problem, and it turns out that the problem is specific to the INT >24. I tested my code by hooking INT 1C, and it works fine. However, the >exact same code does NOT work when I hook it into INT 24. In that case, it >causes Causeway to terminate with a Causeway error 9:unrecoverable >exception( exception #0D, error code 0000). > > I determined that the problem only occurs when I attempt a memory >access(mov memmaddr,immedval, dec memaddr, etc.). Again, this action works >fine under INT 1C, but not under INT 24. In both cases I am loading the >current data segment and giving a saved offset(returned from allocate()) as >the memaddr operand for the mov instruction. > > After looking around on the net, I came across the statement in a TSR >reference that claimed critical errors (INT 24) are always invoked in REAL >mode, not PROTECTED mode. Does anyone know if maybe Causeway drops/shells >out to real mode for this interrupt (or something), thereby possibly >requiring me to change my memory addressing scheme within this particular >bit of code? If so, do you know how to convert a 16 bit segment(selector?) >and 32-bit offset(the allocate() return val) into whatever addressing >scheme is appropriate for this situation? If not, do you have any idea of >what peculiarities INT 24 might have that could cause this? > >Craig > Craig, You can hook int #24 in protected mode, I have done it in my filelist.e without any problem (see filelist.e and int24.e in my library) If you hook a vector don't terminate your routine with an IRET instruction but by a jmp instruction to the old vector. If you want to install a real mode interrupt handler you will have to use dos interrupt #21 function #25 (set interrupt vector) and #35 (get intterupt vector) instead of euphoria equivalent function because euphoria function install protected mode vector. As real mode only work in the first 1 MEG of memory you have to use allocate_low() instead of allocate() to reserve the space for your routine. Finaly your code must be assembled for real mode not protected mode. You can use debug to assemble it. Jacques Deschenes Baie-Comeau, Quebec Canada desja at globetrotter.qc.ca