Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Orphan264 on March 12, 2019, 02:00:08 PM

Title: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 12, 2019, 02:00:08 PM
My Amiga 4000 (D) does not have a battery for the time/date circuit. Normally I use RoadShow (TCP/IP) and an NTP client to update the date and time when the computer boots. However I have not had success using NetShutDown to terminate RoadShow after booting so I am exploring an alternate boot process that skips RoadShow and NTP.

What FILE/FOLDER does OS 3.1.4 use to determine the date/time if there is no battery?

I thought it might be the "most recent file on the boot volume" but that is not the case. I tried.

I want to be able to update this File/Folder with the current actual time/date and then reboot and the clock will get VERY CLOSE to the real time from this file.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: guest11527 on March 12, 2019, 02:29:18 PM
What FILE/FOLDER does OS 3.1.4 use to determine the date/time if there is no battery?
The date and time is then taken from the "last modified" date of the root directory of the boot volume, if the boot volume is an FFS volume. Or rather, the FFS sets the date and time to this date. What other file systems do is up to the file system.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 12, 2019, 02:41:15 PM
Thanks for the answer - I AM using FFS.

I am guessing that the "last modified" date of the root directory of my boot volume is not something that can be updated without re-creating it.  I will work on another way.

I appreciate the help!
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: guest11527 on March 12, 2019, 03:04:42 PM
I am guessing that the "last modified" date of the root directory of my boot volume is not something that can be updated without re-creating it. 
Yes, of course. Just modify a file on the volume.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Thomas on March 12, 2019, 04:43:03 PM
The date and time is then taken from the "last modified" date of the root directory of the boot volume, if the boot volume is an FFS volume. Or rather, the FFS sets the date and time to this date. What other file systems do is up to the file system.

There are multiple time stamps in the root block of the FFS volume. Unfortunately the system time is taken from the "disk altered" field rather than the "dir altered" field. This means that changing files in the root directory does not have any effect on the system time on next boot. The only way to update the system time is to relabel the volume.

Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 12, 2019, 05:01:10 PM
The only way to update the system time is to relabel the volume.

It seems you are correct. I tried modifying a file in the root directory of the volume and it did not work. :(

Don't think I will be relabeling my System: volume just to solve this problem. Thanks.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: kolla on March 12, 2019, 05:15:09 PM
Yes, of course. Just modify a file on the volume.

I believe I have explained to you at least three times that this does not work.

I also keep recommending http://aminet.net/package/util/time/TimeKeeper
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 12, 2019, 06:12:14 PM
I also keep recommending http://aminet.net/package/util/time/TimeKeeper


Thanks for the recommendation, sounds like what I need.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: nbache on March 12, 2019, 10:01:47 PM
Just out of curiosity, why not just keep the network up and stay with the NTP syncing?

Best regards,

Niels
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: kolla on March 13, 2019, 07:07:45 AM
The only way to update the system time is to relabel the volume.

Nope, also not enough.

It would be really useful with a tool that can list out and alter these filesystem date stamps.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: paul1981 on March 13, 2019, 10:57:13 AM
Yes, of course. Just modify a file on the volume.

I believe I have explained to you at least three times that this does not work.

I also keep recommending http://aminet.net/package/util/time/TimeKeeper

I'm not sure that would be right as the OP's machine does have a clock presumably, but his battery is missing. If so, then it will remember the time between reboots anyway (if he sets it with setclock or time prefs first of course).
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 13, 2019, 01:25:30 PM
Just out of curiosity, why not just keep the network up and stay with the NTP syncing?

WHDLoad - Games don't work with the TCP/IP stack loaded. :(

I have tried using NetShutDown in the WHDLStartup script, but it never returns after being called - to me it seems the process gets locked.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 13, 2019, 01:27:50 PM
I'm not sure that would be right as the OP's machine does have a clock presumably, but his battery is missing. If so, then it will remember the time between reboots anyway (if he sets it with setclock or time prefs first of course).


Perhaps it is more correct to say - the clock circuit does not work after being ruined by a leaky battery many years ago. Setclock fails on my machine.
Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Thomas on March 13, 2019, 02:00:13 PM
I have tried using NetShutDown in the WHDLStartup script, but it never returns after being called - to me it seems the process gets locked.

NetShutdown requires that there are no active network connections. The network stack will automatically send Ctrl-C to all processes doing TCP/IP, but some might not respond to this signal. For example SMBFS does not quit if there are some files open on a network share.

Title: Re: Date/Time on Amiga 4000 (OS 3.1.4) without battery-backed clock
Post by: Orphan264 on March 13, 2019, 04:17:33 PM
NetShutdown requires that there are no active network connections.

Thanks, Thomas. I was already aware of this. However, even when I load no such TCP/IP processes, NetShutDown still does not work for me. :(