www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/26/01:26:10

Date: Mon, 26 Feb 1996 14:08:43 -0800 (GMT)
From: Orlando Andico <oandico AT eee DOT upd DOT edu DOT ph>
To: DJGPP Mailing List <djgpp AT delorie DOT com>
Message-ID: <Pine.SOL.3.91.960226140325.2257A-100000@gollum>
MIME-Version: 1.0

Hello everyone:

I have a problem calling a real-mode interrupt vector.
Here's the code I use:

    __dpmi_regs r;
    memset (&r, NULL, sizeof (__dpmi_regs));
    r.x.bx = 1;
    r.x.flags = 0x0202;
    __dpmi_simulate_real_mode_interrupt (vector, &r);

This call fails, not crashing the machine or anything, but the real-mode 
TSR indicates that it failed to do my bidding (gives some bogus reason 
from a set of predefined errors).

But this code works:

    char cvec[10];
    itoa (vector, cvec, 10);
    return (spawnlp (P_WAIT, "idrm", "idrm", cvec, NULL));

The command "idrm" shown above does the same thing as my previous code, 
except it's a real-mode program I compiled with Turbo-C. Apparently, the 
real-mode TSR has a problem being called this way from DPMI... (it's an 
initialize call). However, once the initialization gets through, all 
other calls work. Could this be a stack problem? the default DPMI 
realmode stack is 0x200 bytes.

Any ideas would be welcome.
Thanks.

                                             ------------------------
                                              Orlando A. Andico
                                              oandico AT eee DOT upd DOT edu DOT ph
                                             ------------------------

- Raw text -


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