public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: u-vpoa@aetey.se
Cc: linux-8086@vger.kernel.org
Subject: Re: We have a whole new ton of goodies to investigate...
Date: Mon, 27 Apr 2015 14:35:54 +0100	[thread overview]
Message-ID: <20150427143554.7adaee70@www.etchedpixels.co.uk> (raw)
In-Reply-To: <20150427123036.GX8197@example.net>

> > infrastructure is pretty complete. The Linux kernel has grown over ten
> > times bigger since 1.2 days but I don't think it's added that much useful
> > to the core code.
> 
> One extra thing I would appreciate in the kernel is of course the support
> for code segment switching, making several-times-64k code sizes practical.

If you are willing to accept violating the standard when comparing
function pointers, and you are willing to pull a couple of other stunts
then that is actually trivial. You generate far calls for all inter
function calls, and also tell the compiler to assume the arguments are 2
bytes further up the stack.

For function pointers (eg in arrays and structs) the code generates a
little stub function which saves the bank calls the function and returns,
so that a near call to the stub function goes to the correct far function
and back. Again on 8086 that's much easier to generate as it's basically

	func_stub:
		call far func
		retf

and all the calls to a function pointer then effectively end up as

	call far STUBSEG:ax

or similar depending how the compiler chooses to construct them.

Strictly speaking you can do maths on function pointers and cast them
about in odd ways so a function pointer ought to be 4 bytes, so a void *
needs to be 4 bytes and it all goes to hell, but in the real world the
above works even if it offends the more anal members of standards
committees.

I think the Coherent compiler can also do it "properly". It can for 286
anyway, I've not been through the 8086 version in enough detail to figure
it out.

> (Also there is always a desire for support of additional hardware,
> this can easily push the limits both for the code and the data, if not
> putting the drivers into different address spaces or strictly limiting
> the number of simultaneously usable drivers)

On a box with very little memory it makes little sense to include drivers
you don't need!

> This aside, do you say that the ELKS kernel is pretty much complete
> nowadays, and that it is only user space which needs fixing to make the
> system usable?

If you compare it with 4BSD or System 5 on the syscall level I'd say yes.
It may well need bug fixing and structural work for size but it's only
really lacking the relatively modern syscalls, most of which are
inappropriate and the others could I guess be added but none of the small
userspaces use them - openat etc.

The networking side lacks IPv6 and a lot of other bits, but that's
outside the core, and could probably be reworked to keep the current
kernel bits pretty much as is and adopt lwip for the stack.

Alan

  reply	other threads:[~2015-04-27 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26 21:22 We have a whole new ton of goodies to investigate u-vpoa
2015-04-26 23:31 ` Alan Cox
2015-04-27  7:06   ` u-vpoa
2015-04-27 10:53     ` Alan Cox
2015-04-27 12:30       ` u-vpoa
2015-04-27 13:35         ` Alan Cox [this message]
2015-04-27 14:44           ` u-vpoa
  -- strict thread matches above, loose matches on Subject: below --
2015-04-16 11:14 LM
2015-04-16 11:39 ` Alan Cox
2015-04-03 20:40 Alan Cox
2015-04-15 17:10 ` MFLD
2015-04-15 21:41   ` Alan Cox
2015-04-16  7:35     ` MFLD
2015-04-16 11:49       ` Alan Cox

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=20150427143554.7adaee70@www.etchedpixels.co.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-8086@vger.kernel.org \
    --cc=u-vpoa@aetey.se \
    /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