Re: The different groups and segments of object files

gah4@u.washington.edu
Fri, 19 Jun 2020 14:12:59 -0700 (PDT)

          From comp.compilers

Related articles
The different groups and segments of object files johann@myrkraverk.com (Johann 'Myrkraverk' Oskarsson) (2020-06-19)
Re: The different groups and segments of object files gah4@u.washington.edu (2020-06-19)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-20)
Re: The different groups and segments of object files gah4@u.washington.edu (2020-06-21)
Re: The different groups and segments of object files johann@myrkraverk.invalid (Johann 'Myrkraverk' Oskarsson) (2020-06-25)
Re: The different groups and segments of object files johann@myrkraverk.invalid (Johann 'Myrkraverk' Oskarsson) (2020-06-25)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-25)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-25)
[2 later articles]
| List of all articles for this month |

From: gah4@u.washington.edu
Newsgroups: comp.compilers
Date: Fri, 19 Jun 2020 14:12:59 -0700 (PDT)
Organization: Compilers Central
References: 20-06-004
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
In-Reply-To: 20-06-004

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]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.