public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: David Given <dg@cowlark.com>
To: linux-8086@vger.kernel.org
Subject: Re: EDE - Personal Suggestions and Ideas
Date: Fri, 28 May 2004 13:14:49 +0100	[thread overview]
Message-ID: <200405281314.49031.dg@cowlark.com> (raw)
In-Reply-To: <40B72146.4080202@i.com.ua>

On Friday 28 May 2004 12:23, you wrote:
> David Given wrote:
> >But if you're not programming in C, you don't have this limitation. Unix
> >traditionally is programmed in C, so people don't think about this much,
> > but it would be really nice if the kernel would manage all the segment
> > registers and not just CS and DS. So that, if you like, you could load a
> > binary that allocated all four segments. This would allow nice features
> > such as a Basic interpreter that stored its byte-code in ES, its working
> > stack in SS, and used DS for workspace.
>
> You propose to maintain two or more pointers that points to same memory
> location but to different areas that may cross over.

No! Nonononono! Dear gods, that's horrible!

I'm assuming that segments *never* overlap. Ever. (Except for the special case 
where two segment registers refer to the same segment.)

Don't think about nasty, hacked up 8086 multisegment executables and far 
pointers. These are irrelevant. We do not want to support this, it's a pain.

Think instead of traditional Unix segments. The 8086 is a 16-bit processor, 
which means each process can address 64kB of memory. Full stop. We don't even 
want to *try* to make it address more, it's just too complicated. However... 
which 64kB is being accessed depends on what the processor is doing at the 
moment (accessing code, data, the stack, or 'other'). That's very easy to 
support and allows considerable flexibility later.

I'm not talking about binaries containing multiple code or data segments.

Currently, ELKS binaries (which are the same format as Minix binaries, 
although you can't run Minix binaries on ELKS) contain a header that 
contains, among other things, the size of the code segment and the size of 
the data segment. If we extend this with a couple of fields for the size of 
the stack segment and the size of the extended segment, with the proviso that 
0 means that they map onto the data segment, that's all we need.

So, if a process wants, it can allocate up to 256kB of memory. If it does, it 
needs to be specially written --- probably not in C --- but it can be done.

[...]
> I belive C programmer does not need to know about all this 8086's
> xxxx:xxxx memory structure at all.
> It is job of compiler to convert 32bit pointers to xxxx:xxxx addresses.

Except that in our case, pointers are always 16 bits. The compiler neither 
knows nor cares about segments. As far as it is concerned, it's using a flat, 
linear 16-bit address space with memory protection (even though on anything 
below a 286 there isn't any actual memory protection).

> So ideally there would be two types of executables: old
> (that we have now) and new with multi segments where compiler using
> kernel manages all segments allocation and converts
> 32bit pointers to apropriate locations.

I really don't want to support binaries containing multiple code and data 
segments. If needed, that can be implemented at a purely user level. But 
multisegment executables make life much, much harder.

-- 
+- David Given --McQ-+ 
|  dg@cowlark.com    | "I have a mind like a steel trap. It's rusty and
| (dg@tao-group.com) | full of dead mice." --- Anonymous, on rasfc
+- www.cowlark.com --+ 

  reply	other threads:[~2004-05-28 12:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-25 14:23 [Fwd: Re: EDE - Personal Suggestions and Ideas] Miguel Bolanos
2004-05-25 17:10 ` David Given
2004-05-26  6:20   ` AW: " Mario Premke
2004-05-26 10:09     ` David Given
2004-05-26 10:30       ` Gábor Lénárt
2004-05-26 11:43         ` AW: " Mario Premke
2004-05-26 11:57           ` Gábor Lénárt
2004-05-26 12:39             ` AW: " Mario Premke
2004-05-26 13:06               ` Gábor Lénárt
2004-05-26 14:17                 ` David Given
2004-05-26 15:10                   ` Gábor Lénárt
2004-05-26 16:00                     ` Andrey Romanenko
2004-05-26 16:49                     ` David Given
2004-05-26 17:19                       ` Eduardo Pereira Habkost
2004-05-27  9:09                         ` Gábor Lénárt
2004-05-26 17:42                       ` Andrey Romanenko
2004-05-26 23:19                         ` David Given
2004-05-27  6:07                           ` EDE - Personal Suggestions and Ideas sandeep
2004-05-27 15:51                             ` Eduardo Pereira Habkost
2004-05-28  8:09                               ` sandeep
2004-05-28  8:10                                 ` Gábor Lénárt
2004-05-28 10:11                                   ` David Given
2004-05-28 11:23                                     ` Andrey Romanenko
2004-05-28 12:14                                       ` David Given [this message]
2004-05-29  5:28                                         ` Dan Olson
2004-05-28 10:30                                   ` sandeep
2004-05-26 22:34                       ` AW: [Fwd: Re: EDE - Personal Suggestions and Ideas] Harry Kalogirou
2004-05-27  9:00                       ` Gábor Lénárt
2004-05-27  6:04         ` Dan Olson
2004-05-27  7:14           ` Andrey Romanenko
2004-05-27  9:32             ` David Given
2004-05-27 10:19               ` Gábor Lénárt
2004-05-27 21:07               ` Tommy McCabe
2004-05-28  7:39                 ` Gábor Lénárt
2004-06-01 13:46                 ` Gabucino
2004-06-02  9:03                   ` AW: [Fwd: Re: EDE - Personal Suggestions and Ideas][OT] Javier Sedano
2004-05-26 11:34       ` AW: AW: [Fwd: Re: EDE - Personal Suggestions and Ideas] Mario Premke
2004-05-26 12:09         ` Gábor Lénárt
2004-05-27  5:56     ` Dan Olson
2004-05-26 22:42   ` Harry Kalogirou
  -- strict thread matches above, loose matches on Subject: below --
2004-05-25 13:33 EDE - Personal Suggestions and Ideas Miguel Bolanos
2004-05-26 10:06 ` Gábor Lénárt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200405281314.49031.dg@cowlark.com \
    --to=dg@cowlark.com \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox