Re: Real mode int from protected mode and back



"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

.



Relevant Pages

  • Re: object creation and naming at runtime?
    ... >>replaced with memory references by the compiler. ... I don't know where the computer will allocate space in ... memory for my int so I'll use a name for the address and let ... In the source code the pointer object (which will ...
    (alt.comp.lang.learn.c-cpp)
  • Re: XFS kernel BUG at fs/buffer.c:470! with 2.6.28.4
    ... registers in your dump, no register really seems to contain sensible page ... flags so it could be some corruption of page pointer. ... It will dump us much more information... ... Such bit flips are usually caused by faulty memory or other HW (io ...
    (Linux-Kernel)
  • Re: 2-dimensional arrays and functions
    ... > int* foo ... >> that return memory addresses. ... >> You obviously don't know the difference between a pointer and a memory ... > address of the dynamically allocated memory is stored. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: XFS kernel BUG at fs/buffer.c:470! with 2.6.28.4
    ... registers in your dump, no register really seems to contain sensible page ... flags so it could be some corruption of page pointer. ... It will dump us much more information... ... Such bit flips are usually caused by faulty memory or other HW (io ...
    (Linux-Kernel)
  • Re: FIFO Problem
    ... text but a *pointer* to some text. ... pointing to the string in the clients memory. ... if you want to pass a string from one process to the other then ... int length; ...
    (comp.os.linux.development.apps)