• 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.

Getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots

joshc

Well-known member
Is there a way in software of getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots?

I know the obvious way is to install a battery; but I do not want to install a battery, I want to know if there's either an existing extension to remove the alert, or a ResEdit hack that could be done to remove the check.
 

Phipli

Well-known member
Is there a way in software of getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots?

I know the obvious way is to install a battery; but I do not want to install a battery, I want to know if there's either an existing extension to remove the alert, or a ResEdit hack that could be done to remove the check.
Make an extension that sets the time to some time in the 90s before the finder launches?
 

LaPorta

Well-known member
Is there a way in software of getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots?

I know the obvious way is to install a battery; but I do not want to install a battery, I want to know if there's either an existing extension to remove the alert, or a ResEdit hack that could be done to remove the check.
Yes, perhaps there is a way to disable the check. Or, it must check against some standard date stored (I’d assume) in the System. Could any of that be documented in one of the System 7 Inside Macintosh books?
 

Nixontheknight

Well-known member
Is there a way in software of getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots?

I know the obvious way is to install a battery; but I do not want to install a battery, I want to know if there's either an existing extension to remove the alert, or a ResEdit hack that could be done to remove the check.
there's a network time control panel you can get on macintosh repository that should use ntp to whatever server you want (I use time.nist.gov) to set the time on boot if it's inaccurate
 

joshc

Well-known member
there's a network time control panel you can get on macintosh repository that should use ntp to whatever server you want (I use time.nist.gov) to set the time on boot if it's inaccurate
I should've mentioned, I want to do this without networking as well. I'm well aware of the various options that exist for that.

Or, it must check against some standard date stored (I’d assume) in the System.
The time/date is stored in a global variable and the clock chip. That's why a PRAM battery is needed to keep the time between power cycles.

Make an extension that sets the time to some time in the 90s before the finder launches?
I thought this would exist already, but perhaps not. A few searches on Mac Garden didn't turn anything up yet. Most time/date utilties are for setting it from a remote time server.

The function setDateTime for setting the date/time in the system global variable Time and the clock chip are described in Inside Macintosh: Operating System Utilities.

I do wonder if there's something I'm not thinking of that will mean this won't work though. I have no idea how this stuff is handled by Mac OS, in terms of, how it handles no date/time, what actually makes it think there's no date/time, and which bits of software are reading/setting it, and at what points they are doing that throughout the boot/startup process.

I'll give a few things a go and see how far I get, assuming this is a good starting point.
 

cheesestraws

Well-known member
I think you might be overthinking this. I think it's just a check for "is the time before a certain point, perhaps the release date of the OS". You should be fine to just set the time in an INIT to, say, 1st Jan 2000.
 

uyjulian

Well-known member
Probably a more foolproof method would be to set the time to the last modified of the INIT, then modify the last modified of the INIT on shutdown
 

LaPorta

Well-known member
What I meant was not that it checks what the time is set to in PRAM, I meant it must check this variable AGAINST a parameter of some sort to tell it that the date and time is wrong. Something like “if the date is < date x, it is wrong and display the dialog box”. I’d you can find that and disable it, maybe it won’t display the box.
 

David Cook

Well-known member
Probably a more foolproof method would be to set the time to the last modified of the INIT, then modify the last modified of the INIT on shutdown

Is there a good method for received a call at shutdown? For System 7, you could put a little background app in the Shutdown folder, but that's kinda clunky.
 

joshc

Well-known member
I have gone with the simplest suggestion, and it works. I'm doing a bit of tidying up and need to do testing on real hardware to ensure it actually stops the alert dialog after boot but judging by the fact the date is being set to 01/01/2000 after boot in mini vMac suggests it's going to work just fine.
 

David Cook

Well-known member
Is there a good method for received a call at shutdown? For System 7, you could put a little background app in the Shutdown folder, but that's kinda clunky.
Just found ShutDwnInstall in Inside Macintosh V. It allows an init to get called before shutdown. In System 6 and 7, you could load a driver. The driver has the ability to be called on shutdown.
 

joshc

Well-known member
Spoke too soon... it doesn't actually work. It sets the new date, but that isn't stopping the alert dialog because the check must work differently to what we thought.

There are some clues in the ROM dump here: https://github.com/elliotnunn/sys7.1-doc-wip/blob/master/OS/SysUtil.a#L288

It seems a flag is set in there if pram contents are not valid, and that is what is checked I think? Rather than it checking the date itself set in PRAM.

The above are actually @zigzagjoe's findings on the matter.

I haven't tried to implement any changes to the code as of yet, ran out of energy/patience for it today. Playing Swoop on my 650 instead.
 
Top