Re: how do I do "int86x" in VC 6.0?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Arash Salarian (arash)
Date: 08/02/04


Date: Mon, 2 Aug 2004 11:04:11 +0200

Hi,

Well, if you're writing a Win32 program, then I'm sorry to tell you you
can't use the BIOS interrupts like that. If you write a DOS program, Windows
will emulate most of BIOS and DOS interrupts and your program will run with
no problem but this emulation layer is not active when you execute a Windows
program. Specifically, you are calling a VESA BIOS interrupt but did it
accure to you that the modern video cards are not necessarily VGA at all? I
mean, some of them do not have the same VGA registers and modes and function
quite differently. For example some the Matrox video cards are not
compatible with VGA and you can't use them in plain DOS computer! This is
why there is a device driver for each video card that provides a standard
interface to the Windows so that it can communicate with it. Moreover, even
if you could call this interrupt, your program could not be that simple. In
a windows program, you don't have segment:offset (i.e. a physical address)
but selector:offset (i.e. virtual address) and there is no way you can use a
selector and pass it to a BIOS function and expect it to work. You need to
allocate a memory buffer below the 1MB address, obtain it's physical
segment:offset address, copy your data to it, call the interrupt, and read
back the data from that buffer.

regards
Arash

"lucy" <losemind@yahoo.com> wrote in message
news:uJbhfKFeEHA.3380@TK2MSFTNGP12.phx.gbl...
> Hi folks,
>
> Please help me. What I want is simply to port some DOS-era program to make
> them compatible on Windows XP. The int 10h I want to call is as follows,
the
> purpose is to get monitor information:
>
> rr.x.ax=0x4F15;
> rr.x.bx=0;
> int86(0x10,&rr,&rr);
> if (rr.x.ax!=0x004f) return 0; // not supported
> memset(&edr,0,sizeof(edr));
> rr.x.ax=0x4F15;
> rr.x.bx=1;
> rr.x.cx=0;
> rr.x.dx=0;
> rr.x.di=FP_OFF(&edr);
> srr.es=FP_SEG(&edr);
> int86x(0x10,&rr,&rr,&srr);
> if (rr.x.ax!=0x004f) return 0; // couldn't get info
>
> How to call interrupt on Windows XP without raise big hassle?
>
> Thank you very much,
>
> -Lucy
>
>
>



Relevant Pages

  • Re: Outsmarting DOS C compiler to print to USB printer -- use DOS interrupt?
    ... Every time I go into DOS ... > It occured to me that if I called an interrupt from my DOS program, ... I also assume that you have a Windows driver for the usb printer. ... That will set the dos lpt1: printer hook to the windows usb driver. ...
    (comp.lang.c)
  • Re: C/C++ equivalent of dos,crt Pascal units
    ... Below lists names of variables, functions, types & weird interrupt ... Rather, it's a DOS, ... writes directly to screen memory versus Windows issue. ... code work outside of DOS. ...
    (microsoft.public.vc.language)
  • Re: Gates on Win95 and DOOM
    ... says "Don't interrupt me.". ... As someone who installed games on DOS and then ... Windows 95, ... With DOS it could be a pain in the ass. ...
    (comp.sys.mac.advocacy)
  • Re: Startup ASM Windows PE Problem???
    ... > Windows doesn't give access to the DOS and BIOS interrupts. ... In fact, DOS ... > does not exist under Windows unless you build your app as 16-bit, ...
    (microsoft.public.win32.programmer.kernel)
  • looking for file access monitor tool (windows)
    ... Back in the DOS days I used to have a tool that hooked an interrupt ... vector and intercepted&logged all file access attempts. ... something like that exists for windows but I haven't been able to ...
    (alt.lang.asm)