Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2526

Re: The different groups and segments of object files

Path csiph.com!tncsrv06.tnetconsulting.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From gah4@u.washington.edu
Newsgroups comp.compilers
Subject Re: The different groups and segments of object files
Date Fri, 19 Jun 2020 14:12:59 -0700 (PDT)
Organization Compilers Central
Lines 47
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <20-06-005@comp.compilers> (permalink)
References <20-06-004@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="97465"; mail-complaints-to="abuse@iecc.com"
Keywords architecture, history
Posted-Date 19 Jun 2020 17:21:41 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
In-Reply-To <20-06-004@comp.compilers>
Xref csiph.com comp.compilers:2526

Show key headers only | View raw


On Friday, June 19, 2020 at 8:33:34 AM UTC-7, Johann 'Myrkraverk' Oskarsson wrote:

> The short story is that I've been playing with the OpenWatcom code
> generator.  I can use it to make a custom object file.  The platform
> is 32bit x86, though I'm happy to know how things work in 16bit and
> 64bit modes as well.

> The code generator has options I do not fully understand, and I do
> not know where I can find information on this subject.  To further
> complicate matters I'm unsure what questions I should be asking.

(snip)

The Watcom (at least before OpenWatcom) compilers were the only ones
I knew to generate large model (more than one segment) 32 bit code.

It might be that OS/2 even knows how to load and run it.
(I am pretty sure that Windows and Unix don't.)

In that model, pointers are 48 bit, with a 16 bit segment selector
and 32 bit offset. This would have been another way to get
past the 32 bit barrier without going to 64 bit.

Well, there is a reason not to do it, which is that processors don't
have a segment descriptor cache.  Every load of a segment selector
requires a side load of the descriptor, so too much overhead.

In any case, code that you expected to be only in the 16 bit section,
related to segments, should be in there, also.  As I noted, it is
OS/2 where this could have been used, so it might only be in the OS/2
object program format.  I don't remember now how the OS/2 and Win32
formats differ.

In 16 bit modes, you can have huge data, which allows for a multiple
segment data object, with segment selectors spaced to allow for
appropriate calculation. I believe this is only for dynamically
allocated data, but it might also allow for static allocation
in the object program.  I tried to avoid that.

[On the 386, all of the segments in a process were mapped into a
single 32 bit paged linear address space, so the total size of all
segments in a program was limited to 4G unless you did pseudo-swapping
of segments in and out of the address space, which I don't think
anyone did.

So not only were they slow, they didn't help. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> - 2020-06-19 23:22 +0800
  Re: The different groups and segments of object files gah4@u.washington.edu - 2020-06-19 14:12 -0700
    Re: The different groups and segments of object files gah4@u.washington.edu - 2020-06-21 01:50 -0700
    Re: The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 22:41 +0800
    Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-25 22:40 +0200
      Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-26 00:09 +0200
        Re: The different groups and segments of object files gah4@u.washington.edu - 2020-07-02 00:36 -0700
  Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-20 16:01 +0200
    Re: The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 23:13 +0800
      Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-25 22:52 +0200

csiph-web