delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/10/14/09:45:24

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT noavailemail DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to access higher memory location using djgpp
Date: Fri, 14 Oct 2011 09:39:42 -0400
Organization: Aioe.org NNTP Server
Lines: 52
Message-ID: <j79e25$our$1@speranza.aioe.org>
References: <71ac715f-5198-465d-b685-a7901257ccd3 AT w23g2000vbx DOT googlegroups DOT com>
NNTP-Posting-Host: qBjb0U1QTH77eiTXJSCpEw.user.speranza.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Microsoft Outlook Express 6.00.2800.2001
X-Priority: 3
X-MSMail-Priority: Normal
Bytes: 2867
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"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 -


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