Mail Archives: djgpp/2011/10/14/09:45:24
"Vedat" <vozdemirler AT gmail DOT com> wrote in message
news:71ac715f-5198-465d-b685-a7901257ccd3 AT w23g2000vbx DOT googlegroups DOT com...
> I want to access 0xFFA80000 using DOS 6.22
>
> This is the previous code which worked for 0xD00000 ... How can I
> define the address so it won't crash.
>
You haven't stated where, or why it's crashing, nor which DPMI host you're
using.
Are you using CWSDPMI, PMODEDJ, CWSDPR0, Win98/SE? Which version?
Ok, DOS 6.22 means not Win98/SE ...
Some DPMI hosts are ring 3, some ring 0, some restrict segment size, some
allow large pages, and others set access rights. This means that
__djgpp_nearptr_enable() might not be giving you the access with your host
that it can with some other hosts. It's also possible you've mapped too
much memory with __dpmi_physical_address_mapping(), or that the DPMI host
is allocating memory via XMS and needs XMS provider that supports 4GB.
> if (!__djgpp_nearptr_enable()) {
> printf(" Error : Can't Enable Nearptr!!!\n");
> choice = 'X'; /* leave the loop */
> } else {
>
__djgpp_nearptr_enable() sets a 4GB limit (0xFFFFFFFF) for cs, ds, es, ss
and __djgpp_ds_alias. _my_cs(), _my_ds(), _my_ss() are cs, ds, ss
respectively. fs is used by farsetsel. gs or _dos_ds needs to call
__dpmi_set_segment_limit(_dos_ds,0xFFFFFFFF).
> tm = (void *) (__djgpp_conventional_base + 0xD0000);
> sa = (TM_TYPE_SERVICE_AREA *) (__djgpp_conventional_base +
> 0xD3C00);
> }
>
I think those should use ds ...
Depending on the DPMI host, you might not have full access after
__djgpp_nearptr_enable(). You should check. You can can call
__dpmi_get_segment_base_address() and __dpmi_get_segment_limit() using
_my_cs(), _my_ds(), _my_ss() and _dos_ds to see how they are set, and then
how they are changed by __djgpp_nearptr_enable(). You could also call
__dpmi_get_descriptor_access_rights() to see if you have sufficient
priviledge. You may need to adjust the privilege.
Rod Pemberton
- Raw text -