Classic Mac OS Software (Discussions on Applications) > Hacking the System, Mac OS 9.3, and Beyond !

Mac OS 9.2.2 Memory Limit of 1.5 GB... Some Answers

<< < (2/35) > >>

greatinterface:
lets get those 2 gigs working ,just picked up a lovely 23 inch apple display for $50 on craigs list ,bad news my scripts did not copy properly on the boot disc for my "drive cloning"  aka restore project ,will have to try unstuffing on different machine

nanopico:
Another fun update.
A. I'm still not sure how the hardware MMU plays into this whole thing.  Not sure if OS 9 initializes that differently than OS x or it has something odd to do with maybe it's using a signed int for memory address (that would be odd and not fun to break). I only mention this because hardware is also placed with in the address space accessed by the MMU and you should keep that in mind with the next part.

B.  I have a fun utility/crude app I wrote to do some memory test from with in the OS.
  I'm going to share it with anyone who want's to play with it, but first some disclaimers.
1.  It's a very crude, basic app with no error checking/handling.  Yes it's easy to crash it (and actually that's part of the intent for what I'm doing with it.
2.  The user has control of the memory it accesses. So if you put in an address that is mapped to firmware, video card, any other hardware, then it will write some data to it and it very well could break things.  Just so you know.

So this app doesn't directly cause harm unless the user enters and address that could corrupt things.

So here's what it does. 
When it loads it loads with a heap size between 512K and 1MB.
Once loaded it try's to allocated a chunk of memory that is 10 MB in size.  This is using built in system calls for memory.  Since the heap is way under 10 MB this allocation request fails which is exactly what it should do.
Next it asks the you for a memory address.  You must enter it in hexadecimal.  There is no error checking on that so if you enter a non-hex value it will probably crash on that. Since this is fairly useless of an app and more of a test I'm not going to fix that.
After you provide it an address it starts at that address and writes a 32bit integer to the address, moves to the next address writes an integer 1 larger than the previous, ...etc  until it has done this for 10 mb.
If the memory is addressed that test will pass and it will move on to read that data and compare it to what it put in.  If something doesn't match it will give you the address it didn't match.
That's it.  For memory with in the 1.5 gb range and that isn't allocated to anything this all passes as it should (being that the first one fails intentionaly. 
All this really does is determine if a specific memory address is accessible from an application without using the OS memory/process manager routines. 

So in using it I've found that with in the 1.5 GB limit or what the max ram of your machine is, all this works.   Trying to access ram above 1.5 gb fails.  Not sure why yet, but it flat out failed. So from within an application that extra 512 mb is not accessible, yet.

Also just a few other disclaimers.
Putting addresses below 60 mb or so will crash/lock up your system.  On some of my test it grey screened and locked up, some froze the display and then locked up.  In both cases it messed up macsbug enough that I couldn't even enter it.  So please use caution when using this.  I am absolutely not responsible if you brick your system using this. 

Have fun.

DieHard:
Gonna have to fire up a G4 this weekend and crash it a bunch of times, sounds like fun, thanks nanopico

nanopico:
One address I can say don't use is 0x10 (16 decimal) 
It didn't really screw anything up major, but it took a few reboots before my iBook would boot up.  Have fun with it.

nanopico:
One small correction.
I stated that the little utility I posted tried to write 10 MB of data to a place of your choosing.
That was wrong.  The first version I wrote used a 8 bit pointer so it did write 10 MB.  The version I posted uses a 32 bit pointer, so it writes 40 MB.
Just wanted to clarify that for any one trying it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version