Mail Archives: djgpp/1999/07/28/03:48:02
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 -