• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Introducing ForceY2K, a system extension to manipulate system datetime during boot

joshc

68LC040
This is a very small and basic system extension for System 7 that I created a couple of years ago. When the INIT code is run at boot, it sets the datetime in the clock chip to 1st Jan 2000. It is intended for users who 1) don't use a PRAM battery in their old Macs and 2) may not be able to set the time over a network.

Solutions already previously existed for this problem, so I mainly did this as an exercise to learn what's involved in writing a system extension for Mac OS, and to better understand how to manipulate the datetime in Mac OS via code.

As the system thinks a valid datetime is set, it therefore won't display the "Your clock is not set to a correct date" warning alert dialog after system boot. One more annoyance gone!

Many thanks to @Phipli and @cheesestraws for suggesting the solution and @treellama for suggesting an appropriate name for it. Extra thanks to cheesestraws because the majority of the code in this system extension has been borrowed from his Force32 extension.

This has only been tested using System 7.1 in mini vMac on macOS 12.7 'Monterey' and on real hardware, a Macintosh Colour Classic running System 7.1. I don't know that it will work on other systems, but feel free to try.

The source code is also provided; it can be built with CodeWarrior Pro 4.
 

Attachments

Just wanted to report that this works perfectly on System 6 after changing the file type from scri to INIT. Thank you for making this!
 
Just wanted to report that this works perfectly on System 6 after changing the file type from scri to INIT. Thank you for making this!

Yeah, 'scri's aren't supported under 6 AFAIK. The only difference will be that things at really early boot will see the ... even more wrong date, which doesn't make a huge amount of odds. I suspect this is a 'scri' because Force32 is a 'scri' because I really did want that to run early in boot.
 
Thanks for all the warm words of support for this, I honestly didn't think many people would find it useful but it seems I was wrong! It all started because I found the "Your clock is not set to a correct date" warning alert dialog on System 7.1 on my Colour Classic annoying and I didn't want to put a PRAM battery in it.

And yes, I would've just used the same file type as Force32, but it's great to hear it works OK on System 6 too. Thanks for testing it on System 6 @ry755
 
Glad this got bumped, I missed it initially. Will be adding this to my systems to zap that prompt. Thank you for putting this together and sharing the source!
 
This is great! The warning dialog is a little thing but will be so glad to put this on my machines without PRAM batteries. :)

Anyone know if there is something like his that can disable General Controls menu blinking and set the Mouse speed on boot? along with Force32 those would likely cross off the things that I always end up setting manually.
 
Back
Top