• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Help : making a startup extension for 68k macs

tjjq44

Well-known member
Hi, since battery leakage is a real problem in old macs I thought about an extension which could restore the PRAM (and xPRAM for macs that have it) at startup. Yes "Pram auto restore" already does that but you still have to reboot once manually in order to validate certains changes... (32 bits addressing for example).

I asked cheesestraws in this thread if he could modify his "Force32" init in order to make a real 32 bits addressing check before rebooting. But sometimes I use 24 bits addressing for compatibility with some applications. So it isn't the ideal tool for my usage...

I thought about a parameter that is not ideal by default, it's the menu blink. On cold boot (without pram battery) it is always set to 3 but I (and everybody I presume) never want that. I always set it to 0, maybe some people set it to 1 (or 2 at worst). So it's the perfect candidate to test if PRAM has already been restored or not.

Here is how it could work:
- [optional] display an icon on startup
- read pram value for menu blinking (it's located on the third and fourth less significant bits in the last Byte of regular PRAM)
- if the value is different from 3 (xxxx11xx) then do nothing and return to normal boot process
- else:
- read the contents of pram stored as xPRM ressource (like in "pram auto restore")
- store the 20 first bytes in the mac's PRAM
- check if the mac uses xPRAM
- if it is the case then store the last 256 bytes in the mac's xPRAM
- reboot the mac

Ideally I'd like this init to work with any 68k mac with system 6 and 7. In order to set the PRAM and xPRAM desired values, you'll just have to use "pram auto restore" once and copy via Resedit its xPRM ressource contents into the init before using it. Obviously you have to set the "menu blink" value to 0, 1 or 2 before storing pram, otherwise you will enter an endless loop... :ROFLMAO:

The only drawback is I have no knowledge in mac programming so gifted programmers, wou're welcome! ;)
 
Last edited:
Top