delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/09/12:11:24

Date: Thu, 9 Jul 1998 11:33:35 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Endlisnis <s257m AT unb DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: Problem using int 0x10
In-Reply-To: <Pine.SOL.3.96.980707191519.1851D-100000@sol.sun.csd.unb.ca>
Message-ID: <Pine.SUN.3.91.980709113303.13185U-100000@is>
MIME-Version: 1.0

On Tue, 7 Jul 1998, Endlisnis wrote:

> I tried to write some code to query an svga graphics card.  I've done this
> in Borland C++ v3.1 (DOS) and it worked fine.  This just calls interrupt
> 0x10 with AX=0x4F00 and ES:DI pointing to a 256 byte buffer to hold the
> data.  I used __tb for this, only nothing happens during the interrupt.  I
> ran it through the debugger, and none of the values at __tb changed.  Am I
> doing something wrong?

A number of things is *very* wrong in your code.

First, you can't use memcpy to move data between your program and the
transfer buffer, because the transfer buffer is outside the address
space of your variables.  You need to use special functions such as
_farpeekb and dosmemget.  Please see section 18.4 of the DJGPP FAQ
list, and the library reference for these functions, for more
details.

Second, you will not be able to use the members of the VGAInfoBlock
structure which are pointers as if they were pointers to some buffer
in your program, since they are real-mode pointers.  You will need to
move the data they point to using the same functions mentioned above.

Last, but not least, you are well-advised to decalre ALL of the
members of VGAInfoBlock with the packed attribute, instead of relying
on your understanding of how the compiler pads the members.

- Raw text -


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