www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/21/15:00:04

From: Patrick / Albert Fong <ptfong AT flash DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Real mode access from protected mode problem (Nothing but problems these days...)
Date: Sat, 21 Dec 1996 13:14:34 -0600
Organization: Flashnet Communications
Lines: 36
Message-ID: <32BC371A.781D@flash.net>
Reply-To: ptfong AT flash DOT net
NNTP-Posting-Host: hsh8-215.flash.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Okay...I've got this problem in getting the VESA version information and
such.  Can anybody help?

This is the problem:

  I know I have to have a real mode buffer to store the VESA
information, and I am using go32's transfer buffer (__tb).  I call BIOS
and pass the segment and offset of __tb, and that returns almost what I
want...

	regs.x.ax = 0x4f00;
	regs.x.di = __tb & 0x0f;
	regs.x.es = (__tb >> 4) & 0xffff;
	dosmemput(vinfo,sizeof(VESAinfo),__tb);
	__dpmi_int(0x10,&regs);
	dosmemget(__tb,sizeof(VESAinfo),vinfo);

The dosmemget moves the right data until it gets to the VideoModesptr
and the OEM strings.  I figure that I'll have to get the strings into
protected mode memory, but to do that, I'll have to grab the data from
the real mode segment:offset.  That's where I'm stumped.  Is there a
procedure that returns a value pointed by a real mode segment:offset? 
All I have to do after that is step through the elements of the string
until I hit a '\0', copying those into a protected mode buffer.  Or even
better, why can't I just keep the VESA information in real mode space? 
(I'm just pondering while writing...) If I am to do that, then how would
I allocate DOS memory??? (__dpmi_allocate_dos_memory, I presume).

Maybe I should've put this statement at the top so you didn't have to
read all that :)

Basically, all I need is help on accessing real mode memory from
protected mode.  Help?!?!

 *** Also, if I am doing this completely wrong, what else can be done?
***

- Raw text -


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