From: David Given <dg@cowlark.com>
To: linux-8086@vger.kernel.org
Subject: Re: Some words of encouragement
Date: Sat, 25 Feb 2012 19:09:27 +0000 [thread overview]
Message-ID: <4F4931E7.8010205@cowlark.com> (raw)
In-Reply-To: <CAGc3vb1+8ERqL3-+2KxgyLG=r2eskh9SGgZnsxNK_-hYshuYhw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]
On 25/02/12 18:04, Brad Normand wrote:
[...]
> What I was thinking of, is pointers are stored as flat 32 bit (4GB)
> pointers, and when code uses a pointer, it can do its own arithmetic
> in 32 bits, or it can make the kernel translate the address into a
> DS:SI or ES:DI combination (behind the scenes, swapping in the 64KB
> this makes visible if needed).
When you say 4GB pointers, you mean physical addresses? It sounds
feasible, but I've never heard of anybody doing it.
This would give you fast pointer arithmetic at the expensive of much
slower indirection, due to having to frequently reload ds or es; I'd
imagine that there's more indirection than pointer arithmetic in the
average C program.
Hmm... the compiler would be able to optimise constant indirections
(a->b), but not non-constant indirections (a[i]). The first case would
turn into a ds:[si+$n] indirection, but the latter case would have to do
explicit pointer arithmetic on the physical address a and then reload ds.
As you say, compiler support is the biggest issue. (You know what would
be nice? 8086 support for LLVM.)
Aha. I see that Watcom allows you to *mix* large and huge mode. This
would let you use large mode for most of your data, i.e. anything that's
referring to objects that are smaller than 64kB, and huge pointers for
anything bigger. Of course, this does require you to annotate your
pointers, but it gives you the speed of large mode plus limited
flexibility when you need large data objects.
> tl;dr: I'd love me some nethack running on 8088.
Get the overlaid real-mode version from here:
http://www.nethack.org/v331/ports/download-msdos.html
PS. Please don't cc me if you're replying to the list!
--
┌─── 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-25 19:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 17:26 Some words of encouragement Brad Normand
2012-02-24 18:22 ` Jody Bruchon
2012-02-25 0:54 ` David Given
2012-02-25 6:27 ` Brad Normand
2012-02-25 12:53 ` David Given
2012-02-25 13:13 ` David Given
2012-02-25 18:04 ` Brad Normand
2012-02-25 19:09 ` David Given [this message]
2012-02-25 20:29 ` Brad Normand
2012-02-25 21:04 ` David Given
2012-02-25 23:05 ` Brad Normand
2012-02-26 1:10 ` zkry
2012-02-25 5:12 ` Brad Normand
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=4F4931E7.8010205@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