Mail Archives: djgpp/1997/04/22/12:35:18
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 -