From: David Given <dg@cowlark.com>
To: ELKS Mailing List <linux-8086@vger.kernel.org>
Subject: Re: Kernel size over 64K: what is needed, how to implement?
Date: Fri, 17 Feb 2012 22:51:39 +0000 [thread overview]
Message-ID: <4F3ED9FB.4010408@cowlark.com> (raw)
In-Reply-To: <4F3E9A88.7030105@jodybruchon.com>
[-- Attachment #1: Type: text/plain, Size: 2334 bytes --]
On 17/02/12 18:20, Jody Bruchon wrote:
[...]
> * Support must be added to bcc/ld86 need to be able to use far pointers.
> * A file format must be specified that includes relocation tables for
> far pointers.
> * A loader stub must be added to the kernel to relocate its own far
> pointers at boot.
> * After this is done, support should be added to load userland
> executables this way too.
Far pointers are big, expensive and slow, and incredibly fiddly to deal
with --- it's not a flat 32-bit address space; consider that 0x00010000
and 0x00000010 address the same byte of memory, and that 0x0000ffff + 1
is not 0x00010000. This means that pointer arithmetic becomes painfully
non-trivial.
Adding far pointer support to userland executables also completely
scuppers the ability to move executables around in memory, as each one
gets tied to a particular set of segments. Which means no swap!
Alternative options are:
(a) move chunks of stuff out of the kernel and put it into userland
daemons. This means that each kernel or daemon can remain a small mode
executable. This is what Minix on 8086 and 286 did, and it was very
successful. This is particularly attractive for big, standalone modules
like filesystems or the TCP/IP stack; but the downside is that it's
rather un-Linux-like, as it will require a certain amount of kernel
reengineering.
(b) compromise, and use *medium* mode for the kernel. Medium mode
executables use 32 bit code pointers and 16 bit data pointers. The
advantage of this is that nobody does pointer arithmetic on function
pointers, so all the weird pointer normalisation issues go away. But
even though you can use as much code as you want, you're still limited
to 64kB of combined stack/data space.
Regarding C compilers --- has anyone ever tried Open Watcom? It claims
to support all these weird 8086 segmentation modes, and there is a Linux
version. It's also supposed to produce pretty decent code, which may
well be more compact than bcc's and so save crucial kernel space. Never
touched it myself, though.
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "Never attribute to malice what can be adequately explained by
│ stupidity." --- Nick Diamos (Hanlon's Razor)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
next prev parent reply other threads:[~2012-02-17 22:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 18:20 Kernel size over 64K: what is needed, how to implement? Jody Bruchon
2012-02-17 22:51 ` David Given [this message]
2012-02-19 21:36 ` David Given
2012-02-19 23:01 ` Kirn Gill
2012-02-20 0:51 ` David Given
2012-02-20 13:13 ` Alan Carvalho de Assis
2012-02-21 18:24 ` Juan Perez-Sanchez
2012-02-22 0:31 ` David Given
[not found] ` <FC79A7424F669341A72EFA787A3C767541F8ECD7@exchdb1-vm-srv.infopulse.local>
2012-02-22 14:53 ` Andrey Romanenko
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=4F3ED9FB.4010408@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