I am not aware of any work toward an equivalent to Linux' kernel-driven suspend-to-disk. It would be a huge job.
Indeed, as getting S3 suspend to RAM was back then, early 2000s. I got involved c. 2005 when I bought a used IBM T23 on the strength of it being the platform Nate Lawson used to make S3 really work on at least a range of laptops, with Xorg.
Before and after then I ran a solar powered bush server on a Compaq 1500c laptop that had working APM suspend and resume, for ~15 years.
Noone's made an APM system for at least 15 years, AFAIK.
In APM, BIOS had the resopnsibility for sleep/hibernate and where to hibernate (save to disk) purely depended on BIOS implementation.
Yes. It also could run defined events at different states of [dis]charge; mine played little speaker tunes as alerts
Some forced basic partition with specific type, some allowed extended partition, and some saves to first FAT16-formatted partition with specific file name.
The Compaq could do STD but I never needed it on permanent solar + house battery power, but occasionally used STR for maintenance.
In ACPI, if I recall correctly, the responsibility is passed to OS'es working on it.
Well yes, and the quality of FreeBSD's implementation of ACPI, not least from close collaboration with Intel, has been of very high standard. It's allied to that work that I think working S4 might come, not chasing Linux.
Back to hibernate-to-swap, I found
Linux-related document. It states "
About Arch Linux. States that Saves the machine's state into swap space and completely powers off the machine.
". See section 4 for details.
There's also a pointer there to some good basic definitions:
https://docs.kernel.org/admin-guide/pm/sleep-states.html
at least upto section "Basic sysfs Interfaces for System Suspend and Hibernation" which is more Linux-specific. Written by an Intel guy. Note there's no mention of using swap space, that seems more an Arch? Linux thing.
Arch doc also veers off into systemd, which we don't want to go anywhere near, IMO.
For FreeBSD-specific, I couldn't find directly mentioned about it, but found some related notes.
- Suspend/Resume on FreeBSD wiki.
- Post to freebsd-hackers ML linked from Suspend to disk (hibernation) entry on FreeBSD Foundation-supported projects: call for ideas, November 2021.
Yeah, hard to know if there's enough demand. Even with aging batteries my T430 and X200 run for many days in S3 state, so my own interest is just academic. I guess with 8 times the RAM it would help.
Both of them didn't mentioned abouto "to swap
", but if we, FreeBSD community follow the ArchLinux case, possibly use swap for this.
I really think swap's a dead end for FreeBSD S4 STD, which should not depend on hugely reconfiguring swap methods and requirements; I think that would complicate the job enormously and needlessly.
Otherwise it's basically an extension of the S3 STR process, with added saving of memory state(s) to disk, and reworking boot code to offer resume if there's an image to restart from - or more than one, like (re)boot environments?
I'm not trivialising the job, but let's not make it much harder.