delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/22/03:05:12

From: mohan AT stealth DOT net (Mohan Khurana)
Newsgroups: comp.os.msdos.djgpp
Subject: VESA Programming -- oh boy.
Date: Tue, 22 Oct 1996 02:14:00 GMT
Organization: Stealth Communications, NYC.
Lines: 49
Message-ID: <54h0j2$hu3@news.stealth.net>
NNTP-Posting-Host: mohan.nyc.stealth.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I have a structure, which is the VbeInfoBlock structure that contains
the VESA spec version, memory, etc.

I make a structure like this:

struct VbeInfoBlock vesastruct;

Then I go through the normal procedure for getting a pointer to the
structure, using dpmi functions.

If I print the version number, defined in the struct as: 

short   VbeVersion PACKED;

 I will get a successful and expected result of 200, here is the line
I used:

print("%x", vesastruct->VbeVersion);

Inside this structure there is a pointer called "OemStringPtr" defined
in the struct statement as:

char *OemStringPtr PACKED;

If I try to print this pointer to a null terminated string, using the
following line:

printf("%s", vesastruct->OemStringPtr);

I get the following error:

Exiting due to signal SIGSEGV
General Protection Fault at eip=00004a5a
eax=00000000 ebx=00000000 ecx=ffffffff edx=00000025 esi=c00074ac
edi=c00074ac
ebp=00047624 esp=0004626c cs=00a7 ds=00af es=00af fs=0087 gs=00c7
ss=00af
Call frame traceback EIPs:
  0x00004a5a
  0x00001fc1
  0x000015c1
  0x000015f5
  0x00001b33

The specs say that OemStringPtr is a real mode far pointer in
protected mode.  How do I access it?

Please help.  I have been trying to figure this out for a while now.

- Raw text -


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