Re: how do I do "int86x" in VC 6.0?
From: Arash Salarian (arash)
Date: 08/02/04
- Next message: David Lowndes: "Re: datepicker yields wrong date"
- Previous message: Seiringer Martin: "Re: Problem w/porting c++ Template code"
- In reply to: lucy: "how do I do "int86x" in VC 6.0?"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
- Next message: David Lowndes: "Re: datepicker yields wrong date"
- Previous message: Seiringer Martin: "Re: Problem w/porting c++ Template code"
- In reply to: lucy: "how do I do "int86x" in VC 6.0?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|