Re: Real mode int from protected mode and back
- From: "Jason Burgon" <spamtrap@xxxxxxxxxx>
- Date: Sun, 24 Feb 2008 01:57:21 GMT
"gerotica" <spamtrap@xxxxxxxxxx> wrote in message
news:a06b14de-92b9-4182-9b9d-9d455e04818e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I think my biggest problem here is not understand the whole concept of
DPMI. The first idea was just to make a int call to my ISR, a pure int
call using the registers as parameters... I think it would work ok if
i didnt need to make file manipulations inside my ISR, am i right?
All other things being ok, yes.
The file routines were not written to protected mode so wouldnt be
compatible...
Well, the workaround was to make the call using DPMI int, what im
doing now. But i dont understand the parameters needed for int 31h
300h... That pointer to a registers structure... Can it be null?
No. You must zero out any unused registers, and just set the ones you use.
Also, any pointers you pass in the registers structure must be 16:16
real-mode pointers that point at real-mode accessable memory (within the 1st
MB). So you'll need to allocate a buffer using 31h/100h - "Allocate DOS
memory block", and then for example, when you use 31h/0300h, set Regs.DS to
the segment that function returned, and Regs.SI to zero (since the DOS
memory will be segment-aligned).
AX = 0300h
BH = 0
BL = interrupt number
CX = stack copy word count - set it to zero.
ES:EDI = pointer to registers structure (that is a PM pointer, pointing to
PM memory).
Can I use the stack to pass the parameters to the ISR?
You can but it's more difficult to do.
--
Jay
Jason Burgon - author of Graphic Vision
http://homepage.ntlworld.com/gvision
.
- Follow-Ups:
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- References:
- Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Tim Roberts
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Tim Roberts
- Re: Real mode int from protected mode and back
- From: gerotica
- Real mode int from protected mode and back
- Prev by Date: Re: Real mode int from protected mode and back
- Next by Date: Switch from protected mode to real mode
- Previous by thread: Re: Real mode int from protected mode and back
- Next by thread: Re: Real mode int from protected mode and back
- Index(es):
Relevant Pages
|