[comp.sys.apple] virtual memory for the IIgs

nelson@dad.UUCP (Paul Nelson) (09/20/88)

I've been reading my IIGS hardware reference manual and am very intrigued by
the ABORT line running from the 65C816 cpu to the memory expansion slot.
This line could be used to implement virtual memory on the GS.

I am interested in the possibility of making a memory expansion board
for the IIGS that will provide for virtual memory.  My initial approach
is to take the top 256K of a 1 Meg board (256K X 1 X 4 rows ) and split
it into four 64K "pages".  The board would have to keep track of what
addresses map to each "page", and generate an abort to the cpu when a
page fault occurs.  The abort handler would do the paging to/from a hard disk.

Some design issues/considerations:
	1) The memory card should keep track of writes to the "pages" so that 
	   saving a page to disk unnecessarily could be avoided.

	2) How can you tell the memory manager about the "virtual" memory size?

	3) The user should be able to pick the amount of virtual memory - 
		up to 8 meg.
   
	4) I think 4 64K pages would be the minimum needed to avoid thrashing.
	   The design trade here is increased hardware complexity vs reduced
	   paging.

	5) It would seem that if the loader knew about where page boundaries
	   were, it could reduce excessive paging by loading whole segments
	   into one page.

	6) It would be really nice to be able to reserve a paging area on
	   the hard disk so that disk access for page retrieval would be
	   simpler and faster, instead of going through prodos files.
	   This could be done after the disk is 'prodos' formatted but before
	   any files are put on it by reserving a fixed set of sectors.
	
    7) Virtual memory would be an ideal place to stuff desk accessories -
	   they would be sucked in from disk on the initial page fault, stay
	   there as long as the real memory isn't needed for anything else.

	8) A custom IC design could implement alot more pages - 512 bytes per
	   page would give 512 pages in 256K of ram.   This would greatly 
	   improve efficiency.

It seems that at today's prices, 2Meg of ram costs significantly more than
a 60Mb hard disk.  I'm no expert on virtual memory (i'm not sure i am even
using the term correctly) but this seems like a reasonable thing to do (
except for the BIG 64K pages!).  If this is a really dumb idea please post
so i don't waste anymore time thinking about it.  Does anyone know of other
personal computers that have virtual memory?  Somehow, the idea of an apple
II with virtual seems quite absurd :-).

If anyone has any ideas on how good/bad the performance of this approach 
would be, please post these.  I would sure like to see a product like this
even if it is a little slow.  It would at least let me run some programs 
without having to boot with fewer desk accessories.  I also think that
it is a good trade between a system with alot of ram and no hard disk and
one with a little ram and a hard disk (what i mean to say is: if i have 
$1500 dollars to spend, i would get more for my money buying a hard disk,
a "virtual" type memory card and 512K-1M of ram than i would by
buying all ram).

								Paul Nelson
								...tikal!dad!nelson