Subject: RAM size checking
To: <>
From: Rick C. Petty <pett0019@gold.tc.umn.edu>
List: port-mac68k
Date: 12/19/1995 14:19:00
On Fri, 15 Dec 1995, Allen Briggs wrote:

> There's also no good, easy way to determine the amount of RAM in the
> system (that I've found).  You can't even try probing because the
> address map wraps around (i.e., in an 8MB Mac II, the memory address at
> 8MB should fault, right?--wrong.  It's a copy of the byte at address 0).

Well, you could try what my Apple IIgs does.  When it starts up, it puts 
a value at the start of each bank in RAM (based on the bank #) decreasing 
through all the banks of possible RAM, then it goes back up and checks to 
see if the bank # coincides with the stored bank #, and when it fails 
(address map wraps around), that's the end of RAM.  For instance, it 
starts out with bank $7F:
7F/0000: 7F 7F
7E/0000: 7E 7E
...etc...
03/0000: 03 03
02/0000: 02 02
(or something like this; it's been awhile since I hacked at the ROMs...)
and then parses back up.  When the first byte != bank#, it marks that as 
the end of RAM.  The same thing could be done w/ the Mac, and I would be 
willing to write some code to do this simple check...

--Rick C. Petty,  aka Snoopy
__________________________________________________________
 email: pett0019@gold.tc.umn.edu, pett0019@itlabs.umn.edu
   WWW:     http://www.itlabs.umn.edu/~pett0019/