Author Topic: Request: OS 9 hibernation  (Read 6295 times)

Offline powermax

  • Enthusiast Member
  • ***
  • Posts: 80
  • Hobbyist programmer
Request: OS 9 hibernation
« on: August 20, 2018, 12:38:45 AM »
Hello crews,

while hacking around the Trampoline, I noticed that Mac OS 9 does support system hibernation like OS X does ("Safe Sleep"). It seems to work on laptops only - I wasn't able to activate it in my iMac G3 indigo.

This feature can be supposedly enabled in the Energie saver control panel. There should be a check box "Preserve memory contents on sleep" in the "Advanced settings" tab.

Can someone owning an iBook G4 or similar verify if the above mentioned option is present in the Energie saver CP?

Enabling that hibernation mode will cause Mac OS 9 to write the entire memory content into a giant file (3 -4 GB?) of the HFS type 'bear' (I love these Apple's creative names). The hibernation file could be stored in the System folder, although I don't know its precise location. It could be named "Memory content" or had a localized name. Mac OS Trampoline looks for a file with the type 'bear' ignoring the actual name.

It would be a huge help in my RE effort if I could get my hands on that hibernation file. For the moment being, its structure can only be guessed.

The task to be done is to enable the hibernation mode, to locate the hibernation file and to send it to me anyhow (preferably splitted in chunks and compressed).

Thank you in advance!
Cheers
Powermax

Offline macdude888

  • Newcomer
  • Posts: 4
  • New Member
Re: Request: OS 9 hibernation
« Reply #1 on: December 15, 2018, 10:11:20 PM »
I have a PB G3 Pismo. I have this option under Energy Saver; however it’s grayed out. When I activate balloon help, it says it’s bevause it isn’t supported on my machine.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #2 on: December 16, 2018, 11:34:43 AM »
iBook G3 600mhz, option is greyed out.

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Request: OS 9 hibernation
« Reply #3 on: December 17, 2018, 08:12:35 PM »
'bear' files have been created artificially a while ago, though it is still unclear if they can be enabled on any system at all under normal circumstances. 9.2.1 doesn't even have the option.

All the bears I have created myself have been named 'Memory Contents', resided in the System Folder, and were invisible. Something like ResEdit's "Get File/Folder Info" option (specifically, the feature that lets you turn invisibility off) is very helpful for interacting with them .

They are the size of virtual memory (vm must be turned on for them to be enabled). Using Open Firmware to limit the usable RAM is required if you want to do anything with the bear, as a file that takes up all of vm space is very very hard to open. Most programs try to load a file into memory all at once, which can't work unless the vm size the bear was created in is less than the current memory size.

Bears seem to compress pretty well, which is nice.

Offline kgllewellyn

  • Active Member
  • *
  • Posts: 8
  • CHRP I say, CHRP!
Re: Request: OS 9 hibernation
« Reply #4 on: April 28, 2019, 10:48:53 AM »
Apologies for bumping a somewhat old thread,

But as it wasn't covered. 'Preserve Memory Contents on Sleep' was disabled due to a bug in the feature that caused data loss. Apple temporarily disabled it using an extension and I believe later permanently disabled it in later software releases. As far as I'm aware, the bug was never resolved and the feature never made production ready. https://tidbits.com/2000/03/20/sleep-memory-extension-blocks-laptop-bug-2/

If you really want to force enable it, you might need to compare contents of system files between the original OS 9.0.x release and 9.1/9.2.x and modify 'em. But you'll likely run into the data loss bug, so use with caution. It should work on iBook G3 and PowerBook G3, and TiBooks I would imagine.

Cheers,

Kai


Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #5 on: February 19, 2021, 01:21:18 AM »
I wanted to bump this thread to see if we could get hibernate to disk to "work" on Mac's with the K2 chipset where the lack of documentation and drivers prevents other types of sleep.

Anyone ever successfully "wake" from a bear file?

I wonder if a bit in PRIM_INFO was what was needed to enable the checkbox in the Energy Saver control panel before Apple disabled/removed it?



Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #6 on: February 19, 2021, 01:34:56 AM »
Presumably, we need the Energy Saver Control Panel for OS 9.0.0 or 9.0.2 that shipped before March 2000 when Apple disabled the "feature".

Anyone have that, I searched all my OEM install discs and the oldest I have is 9.0.4 that shipped April 4 2000, after Apple disabled the "feature"?

Offline macarone

  • Veteran Member
  • ****
  • Posts: 108
  • New Member
Re: Request: OS 9 hibernation
« Reply #7 on: February 19, 2021, 02:57:08 AM »
>Energy Saver Control Panel for OS 9.0.0 or 9.0.2 that shipped before March 2000

I'm attaching Energy Control Panel that shows a "get info" date of Jan 2000.

Hope it helps.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #8 on: February 19, 2021, 03:16:30 AM »
>Energy Saver Control Panel for OS 9.0.0 or 9.0.2 that shipped before March 2000

I'm attaching Energy Control Panel that shows a "get info" date of Jan 2000.

Hope it helps.

Thanks, there might be an extension for that too, if you would be so kind.

Does anyone have an old iBook/Powerbook they can get the PRIM_INFO from the device-tree as well?

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Request: OS 9 hibernation
« Reply #9 on: February 19, 2021, 06:33:07 AM »
I don't remember the details, but you definitely have to patch NativePowerManagerLib (and maybe Energy Saver?) to get it to work.

There's some function in NativePowerManagerLib that checks to see if it can hibernate. That function always returns false. You have to patch it to return true instead.

You might need to do other stuff too. While I have managed to get it to save Memory Contents, I never figured out how to restore it.

Offline macarone

  • Veteran Member
  • ****
  • Posts: 108
  • New Member
Re: Request: OS 9 hibernation
« Reply #10 on: February 19, 2021, 01:43:59 PM »
>Thanks, there might be an extension for that too, if you would be so kind.

If you give me the exact name of the Extension you want, I will search for it.


>Does anyone have an old iBook/Powerbook they can get the PRIM_INFO from the device-tree as well?

I think you might find more people responding if you told them where to look. It's not quite as obvious as a Contral Panel or Extension.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #11 on: February 19, 2021, 07:15:45 PM »
The extension maybe the Apple CPU Plugin.

Code: [Select]
ioreg -l | grep prim-info

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Request: OS 9 hibernation
« Reply #12 on: February 20, 2021, 06:37:51 PM »
I don't remember the details, but you definitely have to patch NativePowerManagerLib (and maybe Energy Saver?) to get it to work.

There's some function in NativePowerManagerLib that checks to see if it can hibernate. That function always returns false. You have to patch it to return true instead.

You might need to do other stuff too. While I have managed to get it to save Memory Contents, I never figured out how to restore it.

NativePowerManagerLib in the Mac OS ROM or some other location?

This "feature" was only ever "supported" on  the Powerbook G3 Lombard and the Original/Clamshell G3 iBook, were those via-pmu Macs?

Offline macarone

  • Veteran Member
  • ****
  • Posts: 108
  • New Member
Re: Request: OS 9 hibernation
« Reply #13 on: February 21, 2021, 03:00:32 PM »
>The extension maybe the Apple CPU Plugin.
>Code: [Select]   ioreg -l | grep prim-info

I have no idea what I'm supposed to do with the code you posted.

I have "Spotlight" disabled. I use "Find Any File"

In all the  OS 7, 8 & 9 System Folders on my Legacy HD, I have not found a single instance of CPU Plugin.

I did find 8 different versions of the Energy Saver Control Panel. I put them all in a folder, zipped it, and it is attached. I hope you find it useful.