Date: Thu, 9 Jul 1998 11:33:35 +0300 (IDT) From: Eli Zaretskii To: Endlisnis cc: djgpp AT delorie DOT com Subject: Re: Problem using int 0x10 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.