delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/04/30/15:46:58

Message-ID: <01c001c30f4e$cf450aa0$0600000a@broadpark.no>
From: "Gisle Vanem" <giva AT bgnett DOT no>
To: <djgpp AT delorie DOT com>
References: <3eafd245$1_8 AT corp DOT newsgroups DOT com>
Subject: Re: [Help] Application Crashes ... due to SIGSEGV ...
Date: Wed, 30 Apr 2003 21:29:25 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Reply-To: djgpp AT delorie DOT com

"Markus Meng" <meng DOT engineering AT bluewin DOT ch> said:

> However the application crashes as soon as some of the memory location
> 0x000D0000...0x000D0000 are being accessed.

You cannot access that mem-area directly as if it's part of you 
address space (it's not). That only works with DOS4GW types 
extenders where DOS-memory is mapped to application data
area.

But djgpp has near-ptr feature if you prefer to avoid using the
'far' functions. Enable it (read the docs on how), then access
the area like so:
  memcpy (dest, (const void*)(0x000D0000 + __djgpp_conventional_base), length)

But it pretty simple using the <sys/farptr.h> functions instead:
  dosmemget (0xD0000, dest, length);

The speed advantage of using near-ptr access (memcpy) is neglible
cause dosmemget() is pretty smart in moving those bytes. Even
faster than _dosmemgetl() even when src/dest are DWORD aligned.

--gv





- Raw text -


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