[comp.os.minix] Minix virtual memory

roussos@cs.arizona.edu (George E. Roussos) (10/30/89)

Has anyone tried to write a device driver to support an EMS board under
Minix for the purpose of Virtual Memory ?  It does have the distinct
advantage that it can work even on an 8086 or 8088.  I do understand that
it would take some knowledge of the registers on an EMS board like a RAM
page or an Above Board, but that can't be all THAT hard to figure out the
software interface to.  The trick to this is that most of EMS is software
in DOS, the interfaces to map pages in, etc.  In a sense, this is good
because that will allow for flexibility to graft this in with the Minix
memory management scheme.  Face it - EMS is essentially virtual memory for
DOS.  I think that this might be a decent addition to Minix.

george

roussos@arizona.edu
{allegra | cmcl2 | uunet}!arizona!roussos

darcy@bbm.UUCP (D'Arcy Cain) (11/08/89)

In article <12@caslon.cs.arizona.edu> roussos@caslon.arizona.edu writes:
>Has anyone tried to write a device driver to support an EMS board under
>Minix for the purpose of Virtual Memory ?  It does have the distinct
>advantage that it can work even on an 8086 or 8088. ...
> ... Face it - EMS is essentially virtual memory for
>DOS.  I think that this might be a decent addition to Minix.
>
Don't forget that virtual memory looks like native memory to programs
that are running on the processor.  The 8088 and 8086 don't generate
an interupt when a process gets to the end of allocated memory so Minix
would never know that it was time to swap some memory.  As I
see it there  only one thing that Minix could do with EMS and that is
to create a larger ram disk allowing more programs to be "insta-loaded".

D'Arcy J.M. Cain
(darcy@{bbm,cain})

vandys@hpcupt1.HP.COM (Andrew Valencia(Seattle)) (11/10/89)

/ hpcupt1:comp.os.minix / jerry@altos86.Altos.COM (Jerry Gardner) /  9:53 am  Nov  8, 1989 /
> ... The 80286 does,
>however, support *segmented* virtual memory.  Each 80286 segment descriptor
>has a present bit and an accessed bit necessary to support virtual management
>of segments.  Granted, it doesn't have a 'dirty' bit to indicate that a segment
>has been written to, but neither does the VAX architecture, and it has gotten
>along fine without it.

	Quite a while ago somebody who had worked on a proprietary UNIX
for Daisy posted a description of the gotchas involved with the 286 when
trying to provide virtual memory.  In particular, I believe there were
significant problems in restarting memory writes after faulting on a segment.
Because of this, you couldn't provide dynamically growable stacks, and you
couldn't use the VAX trick of emulating the modified bit (set the segment
read-only, then flag it modified on a write fault and turn off the read-
only bit).  But with a large-model program I'm sure it could still be used
to provide much better memory utilization compared to a straight swap model.

						Andy
						...!hplabs!hpisoa1!vandys

norsk@sequent.UUCP (Doug Thompson) (11/10/89)

In article <3745@altos86.Altos.COM> jerry@altos86.UUCP (Jerry Gardner) writes:
>In article <670@crash.cts.com> jca@pnet01.cts.com (John C. Archambeau) writes:
>>I would love to hear how you're going to do it.  I've seen the memory
>>management scheme of the 80286 in protected mode.  It isn't pretty.  On a 386
>>though, it would be child's play.  If you're going to implement VM, you might
> (deleted)
>
>Wait a minute here!  It looks like it's time to clear up a big misunderstanding
>many people have with respect to virtual memory on the 80286.  We've all heard
>all the talk of the 80286 being brain damaged and not being able to support
>virtual memory, but this just isn't true.  What is true is that the 80286
>does not support *paged* virtual memory as the 80386 does.  The 80286 does,
>however, support *segmented* virtual memory.  Each 80286 segment descriptor
>has a present bit and an accessed bit necessary to support virtual management
>of segments.  Granted, it doesn't have a 'dirty' bit to indicate that a segment
>has been written to, but neither does the VAX architecture, and it has gotten
>along fine without it.
>
>Virtual memory on the 80286 is certainly possible (OS/2 does it :-); it may
>not be "child's play", but it certainly is possible.  BTW, I disagree with
>your assessment that implementing Minix VM on the 80386 would be child's play.
>

One of the problems with the 286 is that is CANNOT restart some of its 
instructions when it gets a segment fault. This is one of the reasons it
is called brain-damaged. When a page or segment fault occurs, its upto the
OS to bring in that page or segment and then restart the faulting instruction
as if no fault occurred. The 386 was fixed in this regard, and does restart
instructions after a fault. BTW upto 6 page faults can occur on one instruction
on a 386, given instruction streams and operand fields.

OS/2 (286) doesn't implement virtual memory, but rather swapping of threads.
I do agree that 386 VM is NOT child's play. But it is easier than trying to
get a 286 to go virtual when the Hardware doesn't support the theory.

-- 
Douglas Thompson		UUCP: ..{tektronix,ogcvax,uunet}!sequent!norsk
Sequent Computer Systems	Phone: (503) 526-5727
15450 SW Koll Parkway	!"The scientist builds to learn;the engineer learns in
Beaverton OR 97006	!order to build."  Fred Brooks

ORCUTT@cc.utah.edu (11/10/89)

I also would LOVE to see a MINIX with support for the
'386 VM.  The '286 is brain-damaged; look how long
uSoft and IBM have been fighting it with OS/2.
I have just acquired '386 XENIX; I can compile
programs with large arrays, large code, or whatever,
and they run FAST and without stupid segmenting.
My advice would be to let the '286 processor die
a quiet death and write new software for the '386.

jca@pnet01.cts.com (John C. Archambeau) (11/10/89)

jerry@altos86.Altos.COM (Jerry Gardner) writes:
>Wait a minute here!  It looks like it's time to clear up a big misunderstanding
>many people have with respect to virtual memory on the 80286.  We've all heard
>all the talk of the 80286 being brain damaged and not being able to support
>virtual memory, but this just isn't true.  What is true is that the 80286
>does not support *paged* virtual memory as the 80386 does.  The 80286 does,
>however, support *segmented* virtual memory.  Each 80286 segment descriptor
>has a present bit and an accessed bit necessary to support virtual management
>of segments.  Granted, it doesn't have a 'dirty' bit to indicate that a segment
>has been written to, but neither does the VAX architecture, and it has gotten
>along fine without it.
>
>Virtual memory on the 80286 is certainly possible (OS/2 does it :-); it may
>not be "child's play", but it certainly is possible.  BTW, I disagree with
>your assessment that implementing Minix VM on the 80386 would be child's play.

Corollary: It's child's play in comparison to implementing VM on an 80286.

As for OS/2, I give more respect to MS-DOS and that ain't much.

 /*--------------------------------------------------------------------------*
  * Flames: /dev/null (on my Minix partition)
  *--------------------------------------------------------------------------*
  * ARPA  : crash!pnet01!jca@nosc.mil
  * INET  : jca@pnet01.cts.com
  * UUCP  : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
  *--------------------------------------------------------------------------*
  * Note  : My opinions are that...mine.  My boss doesn't pay me enough to
  *         speak in the best interests of the company (yet).
  *--------------------------------------------------------------------------*/

feustel@well.UUCP (David Alan Feustel) (11/11/89)

You conceivably could get many more than six page faults on a single
instruction on a 386 running with paging enabled.  Two page faults
could occur during instruction fetch. Up to 16 page faults could occur
for the source operand and another 16 page faults for the destination
operand in the case of a string move instruction.
-- 
E-mail:	feustel@well.sf.ca.us		HOME 1-219-484-5705
{ucbvax,apple,hplabs,pacbell}!well!feustel	

chasm@attctc.Dallas.TX.US (Charles Marslett) (11/13/89)

Growable stacks have been usable with 286's for a long time (5 years, I would
guess), but because the "new" die with the fix in it was not as fast as the
older one, IBM and most of the "quality" clone vendors kept using the old part
until quite recently (for IBM I think the threshold was the release of the PS/2
boxes).  If I remember correctly, the fixed parts are step D and later.

Charles [disclaim the h**l outa it!] Marslett
===============================================================================
"Those who would sacrifice **  Charles Marslett
liberty for security,      **  STB Systems, Inc. <-- apply all std. disclaimers
deserve neither."          **  Wordmark Systems  <-- that's just me
  -- Benjamin Franklin     **  chasm\@attctc.dallas.tx.us
-------------------------------------------------------------------------------