68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Getting rid of the 'Your clock is not set to the correct time' alert dialog after System 7 boots
Posted by: joshc on 2023-11-20 14:41:04
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.
Posted by: Phipli on 2023-11-20 14:46:28
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?
Posted by: LaPorta on 2023-11-20 15:32:50
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?
Posted by: Nixontheknight on 2023-11-20 17:29:52
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
Posted by: joshc on 2023-11-20 23:00:26
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.
Posted by: cheesestraws on 2023-11-21 01:35:11
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.
Posted by: uyjulian on 2023-11-21 04:44:18
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
Posted by: LaPorta on 2023-11-21 04:55:10
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.
Posted by: bigmessowires on 2023-11-21 07:40:52
You should be fine to just set the time in an INIT to, say, 1st Jan 2000.
That sounds like the answer. No need I can think of for anything fancier or to modify the date at shutdown.
Posted by: David Cook on 2023-11-21 07:44:47
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.
Posted by: joshc on 2023-11-21 07:46:49
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.
Posted by: David Cook on 2023-11-21 07:57:26
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.
Posted by: LaPorta on 2023-11-21 08:43:38
What was your solution?
Posted by: joshc on 2023-11-21 13:50:14
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.
Posted by: croissantking on 2023-11-21 17:01:41
That’s strange, I never get this error under system 7.x on any of my Macs, but I do on 9.x.
Posted by: LaPorta on 2023-11-21 17:09:36
7.5 does it...that's the earliest I can think of.
Posted by: joshc on 2023-11-21 21:22:09
7.1 also does it.
Posted by: croissantking on 2023-11-22 06:22:24
I literally never get that diaog box on any of my '030 or '040 Macs after taking out the PRAM battery.
Posted by: joshc on 2023-11-22 08:28:34
I literally never get that diaog box on any of my '030 or '040 Macs after taking out the PRAM battery.
Interesting. Is that even with a fresh install of 7.1 or 7.5?
Posted by: 3lectr1cPPC on 2023-11-22 08:45:36
I literally never get that diaog box on any of my '030 or '040 Macs after taking out the PRAM battery.
Me neither. I see it on OS 9, but nothing else. 7.0.1, 7.1, 7.5, 7.6, doesn't matter.
1 >