delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/28/03:48:02

Date: Wed, 28 Jul 1999 10:45:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: conrad <conrad AT citeweb DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: 13h forerver (heyy)
In-Reply-To: <000b01bed8a1$9ac9c000$17b9fea9@rincevent>
Message-ID: <Pine.SUN.3.91.990728104504.15288W-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 28 Jul 1999, conrad wrote:

> info.size = 320*200;
> info.address = 0xa0000;
> __dpmi_physical_address_mapping (&info);
> my_ds = __dpmi_allocate_ldt_descriptors (1);
> __dpmi_set_segment_base_address (my_ds, info.address);
> __dpmi_set_segment_limit (my_ds, (320*200+5)|0xfff);

This is the wrong way of creating a selector for the video RAM.
__dpmi_physical_address_mapping is for mapping in addresses above 1MB
mark that by default aren't mapped by the DPMI server.  See section
18.4 of the DJGPP FAQ for a description and an example of working code
that sets up a selector for video RAM.

Also, your code doesn't even check for error returns from the DPMI
functions you call.  No offence, but IMHO such programs really deserve
to crash...

- Raw text -


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