Mail Archives: djgpp/1999/07/28/06:12:53
Eli Zaretskii wrote in message ...
>
>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...
I wrote (with an awful lot of help from Eli) a small bit of code which may
help here.
If you search for the thread 'Selector code' then for a message posted about
21 June, it should contain the code we produced.
Use it like this:
if (make_ds (my_ds, 0xa0000, 64000)) {
//error
}
As far as I know it is bug free and fully working.
- Raw text -