delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/03/15/23:31:26

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT bitfoad DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP and FreeBASIC
Date: Fri, 16 Mar 2007 00:18:12 -0400
Organization: Aioe.org NNTP Server
Lines: 75
Message-ID: <etd5qo$dqa$1@aioe.org>
References: <wcadneOqhpNLD2nYnZ2dnUVZ_sWdnZ2d AT golden DOT net> <200703120024 DOT l2C0OAFp006542 AT envy DOT delorie DOT com> <op DOT to2eoqxhfbdswm AT arachne>
NNTP-Posting-Host: IVw7K97ih4IohxRqyKkqFw.user.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MSMail-Priority: Normal
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Florian Xaver" <wosrediinanatour AT aon DOT at> wrote in message
news:op DOT to2eoqxhfbdswm AT arachne...
> Hi,
>
> a question: Japheth (http://www.japheth.de) is author of HX-Extender. And
> he wrote at http://www.japheth.de/HX/djgpp.html "...DJGPP doesn't produce
> true-flat (or "zero-based") binaries.

True.

Daniel Borca also has an experimental ELF version of DJGPP which produces
true flat binaries:
http://www.geocities.com/dborca/djgpp/elf/djelf.html


DJGPP uses a segmented memory model.  OpenWatcom uses a "non-segmented" or
"true-flat" (base address 0, segment limit is 4Gb for all setup selectors:
code cs, data ds, ss & es same as ds, fs & gs not used).  For more in depth
information on DJGPP, you could read these posts of mine (I have a few
others posted but not listed here, perhaps found via Google Groups
search...):

http://groups.google.com/group/comp.lang.asm.x86/msg/5948fa743d99a240?hl=en
http://groups.google.com/group/comp.os.msdos.djgpp/msg/3b2927a76908742a?hl=en

Basically, the default OW selectors are like _dos_ds (i.e., gs) after the
segment limit is increased to 4Gb with
__dpmi_set_segment_limit(_dos_ds,0xFFFFFFFFU).  __djgpp_near_ptr_enable
increases the limit to 4Gb on the other selectors.  The other main
difference is that OW uses non-paging DPMI servers like PMODEDJ
(pmodetsr.exe) and unlike the paging servers by Charles Sandmann: CWSDPMI
and CWSDPR0.  If I recall, Sandmann had some code to "unroll" the paging
used in
CWSDPMI in order to disable it, in one of the examples here:
http://clio.rice.edu/djgpp/

If you're interested in comparing the OW selectors to DJGPP selectors in the
second link above, these are the selectors for two of the DPMI host/DOS
Extenders used by OW:

DOS4GW defaults
selector 0x0150 : select= cs, base=0x00000000, limit=0xffffffff,
flags=0xc09b
selector 0x0158 : select= ds, base=0x00000000, limit=0xffffffff,
flags=0xc093
selector 0x0158 : select= ss, base=0x00000000, limit=0xffffffff,
flags=0xc093
selector 0x0158 : select= es, base=0x00000000, limit=0xffffffff,
flags=0xc093
selector 0x0000 : select= fs, base=0x00000000, limit=0x00000000,
flags=0x0000
selector 0x0020 : select= gs, base=0x0000a860, limit=0x0000ffff,
flags=0x0093

PMODEW defaults
selector 0x0868 : select= cs, base=0x00000000, limit=0xffffffff,
flags=0xd09b
selector 0x0860 : select= ds, base=0x00000000, limit=0xffffffff,
flags=0xd093
selector 0x0860 : select= ss, base=0x00000000, limit=0xffffffff,
flags=0xd093
selector 0x0860 : select= es, base=0x00000000, limit=0xffffffff,
flags=0xd093
selector 0x0848 : select= fs, base=0x0001dc60, limit=0xffffffff,
flags=0xd093
selector 0x0850 : select= gs, base=0x0000e9d0, limit=0xffffffff,
flags=0xd093



Rod Pemberton



- Raw text -


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