Mail Archives: djgpp/2017/06/23/21:00:14
On Fri, 23 Jun 2017 17:56:56 +0000 (UTC)
rridge AT csclub DOT uwaterloo DOT ca (Ross Ridge) wrote:
> JJ <jj4public AT vfemail DOT net> wrote:
(Added, comp.os.msdos.djgpp. in case someone wants to criticize.)
> >Does that mean that DJGPP's C/C++ compiler only have one large
> >memory model?
>
> DJGPP has only the 32-bit "flat" memory model. It's like the tiny
> memory model except the size of its one segment is 4 gigabytes instead
> of 64 kilobytes.
>
Actually, by default, DJGPP segments are limited to 640KB (0x0009FFFF)
in size for CS, DS, ES and SS, but not FS and GS. So, you must call
__djgpp_nearptr_enable() to enable 4GB segments. That will boost the
limit of those four segments to 0xFFFFFFFF. FS will still be limited
to 64KB and GS will still be limited to 1MB+64KB. The base for the
four main segments is 1MB, not zero. GS' base is zero. FS' base
varies, usually around 0x7C00. This is true for all 3 compatible DPMI
hosts: CWSDPMI, CWSDPR0, and PMODEDJ. You can change the base and
privileges of the selectors using other calls.
CS (code segment) is used by _my_cs() and _go32_my_cs(). DS (data
segment) is used by _my_ds() and _go32_my_ds(). SS (stack segment) is
used for _my_ss() and _go32_my_ss(). ES (extra segment) is used for
the PSP selector. GS is used for __djgpp_dos_sel, _dos_ds,
_go32_info_block.selector_for_linear_memory,
_go32_conventional_mem_selector(). GS is used by libc for the segment
1MB+64KB, e.g., for real-mode DOS or BIOS or VGA routines.
__djgpp_ds_alias mirrors DS' settings and is used for RMCB's. FS is
used for far pointers (farpeek, farpoke).
Rod Pemberton
--
The entire idea that the U.S. government obtained information from deep
sources in the Russian government that Putin ordered a cyber campaign
to disrupt our democracy is itself dezinformatsiya. Wake up sheeple.
- Raw text -