public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@llwyncelyn.cymru>
To: David O'Shea <dcoshea@gmail.com>
Cc: linux-8086@vger.kernel.org
Subject: Re: Memory issues and USB support? (and OpenWatcom)
Date: Wed, 14 Jun 2017 02:23:05 +0100	[thread overview]
Message-ID: <20170614022305.615ec8ca@alans-desktop> (raw)
In-Reply-To: <CAN0DjM0Wj+UWETHfiUdQPrqN4TNPdj-=WpsaWAUgkUMoxJ=qLg@mail.gmail.com>

On Mon, 12 Jun 2017 13:35:49 +0930
"David O'Shea" <dcoshea@gmail.com> wrote:

> On Mon, Jun 12, 2017 at 12:24 AM, Alan Cox <alan@llwyncelyn.cymru> wrote:
> > Moving to large code isn't a problem, but large data means far pointers
> > and that means a huge slowdown in performance.  
> 
> Ah, that hadn't occurred to me, but it makes sense.  Thanks!
> 
> > For userspace large models also mean you can't do swapping until you have
> > 286 protected mode.  
> 
> I assume the issues are that you can't page segments in on demand
> because there's no MMU, so whenever you schedule the process you'd
> have to page all of it in, and the process now has physical memory
> addresses (rather than just addresses relative to some registers that
> the kernel can change), so you always have to page it to the same
> location in memory?

Mostly the latter. If you want the full glorious horror story take a look
at how windows16 does call stack frame fixup for 16bit apps.

(Short version - each stack frame pushes bp. Windows 16 inc's bp before
pushing and decs after if the function is far, thus allowing the windows
OS code to walk the stack frames and modify each far return according to
what is and isn't in memory and where it moved)

We could modify the compiler to do that, but it's up there with coding
while drunk on 'good idea' rating.

> I presume that this is why the MS/PC-DOS DOSSHELL (and no doubt there
> were various other tools that did the same) was a "task swapper" which
> swapped your entire process to/from disk when you switched processes?

That was more because a DOS program owns all of memory so you don't know
how much to give it.

> 
> To support larger programs, would it be worth sacrificing the ability
> to swap those particular programs?

No - those are the ones you need to swap the most.

> And regardless of moving away from tiny model, I gather that moving to
> OpenWatcom just for the optimisations and ANSI C would potentially be
> worthwhile?

16bit gcc is probably better.

Alan

  reply	other threads:[~2017-06-14  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-11 14:09 Memory issues and USB support? (and OpenWatcom) David O'Shea
2017-06-11 14:54 ` Alan Cox
2017-06-12  4:05   ` David O'Shea
2017-06-14  1:23     ` Alan Cox [this message]
2017-06-15 10:18       ` David O'Shea

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=20170614022305.615ec8ca@alans-desktop \
    --to=alan@llwyncelyn.cymru \
    --cc=dcoshea@gmail.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