Read/Write PRAM and xPRAM

I honestly can't remember where I pulled this document from, so I cannot give credit to the source. I think I may have edited it anyway. But this has been really helpful for me.

Also PRAM Doctor really is a great tool. Not only can you view ALL PRAM/xPRAM settings, but you can also directly edit them in there. So in this case, get your PRAM setup like you want, then go into PRAM Doctor and capture the settings.
 

Attachments

What I also found out: "Pram Doctor" is not suitable. Maybe it's way too old. Sometimes the saved PRAM data contains strings from system menus or even displayed text. So I ditched that app for comparison etc.
I have run into this issue with PRAM Doctor as well. Trying to remember the details, but it might have been on a PowerBook 540c perhaps? But generally for my other 030s and 040s it has worked pretty well.
 
Hello folks!

I recently bought a PowerBook Wallstreet/PDQ. Of course the PRAM battery is dead. That's nothing too bad but since I'm a software guy I thought that it should be possible to save the (x)PRAM to disk on shutdown and restore it after reboot if a PRAM reset is detected (e.g. year < 2024 or year >= 2039). So the last volume settings, display brightness, region (Date & Time) and so on are restored.

I know there are some solutions to achieve my needs but... Where's the fun part when just using them? 😄 I really want to understand things how they were done back in the days.

Btw: "PRAM-Reader" (https://macintoshgarden.org/apps/pram-reader) doesn't work at all. Restoring the saved state leads to a black screen and a complete hang.

What I've found out:
  • "Old" PRAM is 20bytes, "extended" PRAM is 236bytes (according to "Inside Macintosh, Parameter RAM Utilities", from 1994).
  • Getting the pointer for the PRAM is done by using "GetSysPPtr".
  • Changing values is done by changing them directly in memory.
  • Saving is done by using "WriteParam".
The documentation seems to work with the first 20 bytes (reading and writing works). But the extended PRAM doesn't seem to be directly after these 20 bytes. Reading 256 bytes and then writing them back causes crashes, hangs and so on.

And here comes the tricky part: I want to do everything in REALbasic! (That's the language I'm most familiar with on Mac.)

I hope someone out there has some advice for me. :)

Thank you all!
Mike
I'm having an issue where I can't boot Adelie on my PowerMac G4 because it can't read XPRAM to get the date and time I think
 
Back
Top