delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/16/09:48:47

From: "Mark & Candice White" <mhewii AT home DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010916092730 DOT 7026I-100000 AT is>
Subject: Re: addressing question
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <uZ1p7.113099$K6.46338882@news2>
Date: Sun, 16 Sep 2001 13:40:42 GMT
NNTP-Posting-Host: 24.19.84.198
X-Complaints-To: abuse AT home DOT net
X-Trace: news2 1000647642 24.19.84.198 (Sun, 16 Sep 2001 06:40:42 PDT)
NNTP-Posting-Date: Sun, 16 Sep 2001 06:40:42 PDT
Organization: Excite AT Home - The Leader in Broadband http://home.com/faster
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in message
news:Pine DOT SUN DOT 3 DOT 91 DOT 1010916092730 DOT 7026I-100000 AT is...
>
> On Sun, 16 Sep 2001, Mark & Candice White wrote:
>
> > GCC and its dos port DJGPP are made for flat mem models
> > where ds,es,fs,gs,ss all point to the same mem, and cs is all so
> > the same phisical mem.
>
> This is not true: the DJGPP run-time environment is not flat, it's
> segmented.  However, the main (data/code) segment is very large and can
> grow as needed, to become as large as the underlying DPMI host allows.
>
> So as long as you stay with ``normal'' C code, you can make-believe that
> you are running in a flat address space.  But as soon as you try to
> access conventional memory or some memory-mapped device, you will
> discover the segmented nature of the DJGPP address space which will force
> you to use _farpeekb, dosmemput, movedata, and other similar functions
> that set either FS or GS to point to another segment.

dima 3141596 wrote:
>Ok, I have GDT with 3 valid entries: code segment, data segment and
>data segment pointed to video RAM (0x0b8000).
 >Than I switch to PM and  load CS <- entry 1,  DS <- entry 2,  ES <-
>entry 3.
Then dima wrote:
>OK, I switch to PM in the asm module which was loaded from the boot
>sector of HDD. After I can start module written on the C (DJGPP). And  I
>have not both dos services nor any accessible libs.

The code is not running in the normal DJGPP run-time environment.
That is made with the help of DOS and DPMI. Neither are there.
Just a simple flat mem model with 3 GDT entries: code, data, and video.

You are quite right about how djgpp is normaly used but dima made
it clear that DJGPP is being used more as a pure port of gcc hosted
in dos. My responce was in regards to the exact use it is being used for,
and as such is correct.

As an aside I do still belive that DJGPP is made for flat mem model.
It just gives you access to DPMI to access the mem below your codes
mem segment. This exposess the segmented 16bit OS (or emulated one
 in a dos box) that it runs on. DJGPP uses a flat mem model, it is just its
hosted OS that does not.
Do not worry about debating it, you will not change my mind and I
will not likely change yours, so just belive your right.




- Raw text -


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