Subj : Re: Operating Systems To : poindexter FORTRAN From : tenser Date : Mon Apr 08 2024 12:43:04 On 07 Apr 2024 at 08:42a, poindexter FORTRAN pondered and said... pF> I thought the 2038 problem was a unix time_t issue? Depends on the Unix and the definition of `time_t`; on any reasonably modern system that's an `int64_t`. It's really just old binaries or old versions of the OS. What DOS does with time is an interesting question. The earliest IBM PC didn't have a real-time clock, so the operating system asked the user for the date and time on each boot, but time on each request was obtained from the BIOS. It's not clear to me that DOS itself maintained an internal time; I rather suspect that it did not. Near as I can tell, the BIOS maintains two variables in its data area: a count of timer interrupts since the system booted, and a count of 24 hour intervals since system boot. The timer in question is the programmable interval timer, and it interrupts abut 18 times a second. It appears that the timer tick counter is a 32-bit integer and it is returned to DOS as a pair of 16-bit registers. According to some Microsoft site I found, DOS records dates and times for files as "packed 16-bit values". There's a 16-bit integer that encodes the date, and another that encodes time. The date representation uses 5 bits for the day of the month, 4 for the month, and the last 7 bits for the year, as an offset for 1980. This implies that MS-DOS can accurately track dates on files until the end of 2107, after which it will roll back around to 1980. The time representation is similar: 5 bits to represent a second divided by 2, 6 bits for the minute, and the last 5 bits for the hour (using a 24-hour clock). The seconds representation is a little weird; this implies that the resolution on time stamps is only to two seconds (note that 2^5=32 is not enough to hold the full range of 60 seconds). I don't know that there's a cleverer representation that can represent the full range and still be packed into a 16-bit integer. --- Mystic BBS v1.12 A48 (Linux/64) * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101) .