delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/22/12:35:18

From: dmcneill AT pne DOT co DOT uk (Dave McNeill)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need help desesperately (VESA)
Date: Tue, 22 Apr 1997 12:50:07 GMT
Message-ID: <335c9ac9.8830331@news.demon.co.uk>
References: <5jhqbl$5nf AT maia DOT cc DOT upv DOT es>
NNTP-Posting-Host: firewall.futurenet.co.uk
Lines: 47
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 22 Apr 1997 07:45:57 GMT, convidat AT upvnet DOT upv DOT es (Usuario Invitado)
wrote:

>The problem is the following:
>I get the VESA structure and all the "numeric info" (memory, version, etc) but 
>I can't read/print the oem string nor the VESA signature... I've readed the 
>discussion about DOS memory in the FAQ and I've look the sources of GRX2, but 
>the code is too confusing... 
>

Try this: (it assumes that char buf[] is an allocated area of memory
big enough to hold the string and that VIB is a VbeInfoBlock
returned by VBE function 4F00h.


#include <go32.h>
#include <sys/farptr.h>

...

/* macro to convert a dos seg:off pointer into a
   linear dos mem pointer
*/
#define MKLINEAR(p) (char *)( ( ( (int)(p) & 0xFFFF0000 ) >> 12 ) \
			      + ( (int)(p) & 0xFFFF ) )

	int i;
	char *p;

	_farsetsel( _dos_ds );
	for ( i = (int)MKLINEAR( VIB.OemStringPtr), p = buf;
		'\0' != ( *p++ = _farnspeekb( i ) ); ++i );
	*p = '\0';

...


The procedure for getting other strings and the mode list is
similar.  The Signature is held as a dword in the infoblock,
so no dereferencing is needed.

I'm no sure how long these pointers remain valid (does the
transfer buffer move anybody?).  I copy them into program
ds as soon as possible.

dave

- Raw text -


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