www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/09/22:02:10

Xref: news2.mv.net comp.os.msdos.djgpp:7017
From: C M Marka <matriu AT gim DOT ktu DOT lt>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Thanks everybody. :) (And another question)
Date: Wed, 7 Aug 1996 21:18:34 +0000
Organization: LITNET
Lines: 52
Message-ID: <Pine.HPP.3.91.960807205959.20048D-100000@santaka.sc-uni.ktu.lt>
References: <4u6gki$fas AT news DOT goodnet DOT com>
NNTP-Posting-Host: santaka.sc-uni.ktu.lt
Mime-Version: 1.0
In-Reply-To: <4u6gki$fas@news.goodnet.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 6 Aug 1996 snarfy AT goodnet DOT com wrote:

> 
> I just wanted to say thanks to everybody who has responded.  I now
> have my interrupt code working without using _go32 type wrappers. It
> seems as though I needed to 'movw ___djgpp_our_DS, %ds' to get it
> to work, and now everything works happily.
> 
Don't use ___djgpp_our_DS! Use ___djgpp_ds_alias. The one you use gets
invalidated when DJGPP runtime tries to rise an exception and your 
handler would break. Believe me, GPFs inside an interrupt handler are
not fun, at least for you disk.


Now here's the reflection stuff:

when you call __dpmi_set_protected_mode_interrupt_vector(), the DPMI
host updates the corresponding real mode vector to point to a routine
which switches to protected mode, calls your handler and switches back
to real mode afterwards. So if you want to set a real mode vector, do
it *after* you set the PM vector (I believe the FAQ says this). If you
want the interrupt just to be ignored in real mode (as I understood from
your posting), do the following:

allocate 16 bytes of DOS memory with __dpmi_allocate_dos_memory.
put an iret opcode there using farpoke, just make sure it's a 16 bit iret
set the real mode vector

pretty simple. Oh, I forgot. You must EOI. Anyway, compile this code with
djasm:

..type "bin"
..org 0

push ax
mov al,0x20
out al,0x20
pop ax
iret

..end

djasm x.asm x.bin

and then view the x.bin file with a hex viewer and put down its contents. 
This is what you will need to copy to dos mem instead of the single iret
opcode.

Hope this helps, though I think you knew that stuff before.

Martynas

- Raw text -


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