Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!beta!unm-la!unmvax!hi!hc!ames!lll-lcc!lll-tis!ptsfa!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.sys.m68k Subject: Re: How does one implement VM in a 68000? Message-ID: <2351@hoptoad.uucp> Date: Thu, 2-Jul-87 00:23:38 EDT Article-I.D.: hoptoad.2351 Posted: Thu Jul 2 00:23:38 1987 Date-Received: Sat, 4-Jul-87 04:16:48 EDT References: <1029@bloom-beacon.MIT.EDU> Organization: Nebula Consultants in San Francisco Lines: 36 wpd@athena.mit.edu (William P Doyle) wrote: > ...because the 68000 could not restart > instructions, VM wasn't possible. His argument went something like, > "You know that you will never page fault while in the supervisor mode, > so you just insert probes in the user mode." Early 68000 Unix systems worked this way; they did not do virtual memory, though; they swapped, like V7 Unix and most System V's until recently. (The most serious constraint this gives is that you can't run programs bigger than your physical memory.) The "probe" method was used to dynamically allocate the stack. Each procedure prologue had a "tst sp@(-128)" instruction, or something similar. If the stack was close to its end, this would get a bus error. Enough was known about the behaviour of the 68000 that restarting that simple instruction was possible; e.g. we knew how far off the PC was from where it should be. If we didn't do the stack probe, some random instruction that referenced the stack might get a bus error, and not enough information would be there to restart it. On the Macintosh, I understand that Apple did something similar for procedure calls to non-resident libraries; they figured out what the chip would do with an instruction like "jsr a0@" to a bad address, and if it happens, they fix it up. Apollo used to do virtual memory using a pair of 68000's; when the first one took a bus error for a missing page, it would be frozen in mid-cycle, and the second 68000 would take over, fetch the page, and resume the first. This worked, but had the serious drawback that you can't run some other process while waiting for the disk to spin. 68010's are now so cheap that there is no excuse for using a 68000 for a system with an MMU. -- {dasys1,ncoast,well,sun,ihnp4}!hoptoad!gnu gnu@ingres.berkeley.edu Alt.all: the alternative radio of the Usenet. Contributions welcome - post 'em