156 points · by pabs3 · 5y ago · 151 comments
On the other hand, MS-DOS, which internally uses a 1980 year-epoch with a byte-sized year counter (and does not use a seconds-based epoch unlike Unixes), will be fine up to 2107, and Windows NT's timekeeping has a range of approximately 30000 years. Despite the elegance of the 1970 seconds-epoch, it's interesting to see how other systems designed roughly around that time period, a little later but not by much, chose to do something else, and as a result became quite a bit more future-proof.
Back then, digital computers were only 25-28 years old. There was no such thing as legacy hardware back then, in our terms. Designing for a 68 year lifespan -- nearly three times the entire duration of the industry to that date -- probably seemed excessive!
32-bit Unix timestamps would have a broader range than MS-DOS timestamps if they made the same sacrifice in resolution and only had 2-second precision rather than single-second precision [1]. And if Unix timestamps additionally used 32-bit unsigned numbers to sacrifice the ability to represent timestamps before the beginning of the epoch, then the year 2038 problem would instead be more of a year 2242 problem.
[1] https://docs.microsoft.com/en-us/windows/win32/api/winbase/n...
On a 16-bit machine when memory cost close to a dollar a byte?
glibc time64 support is still work in progress, as I wrote in the article
Any system which needs to display the correct time needs to have a mechanism for updates.
The time_t wraparound is a bit deeper and more serious, granted.
The BSDs have no problem with breaking user space, Net/OpenBSD has been using 64bit time_t for a while. And starting with 6.8 OpenBSD's default file system uses 64bit timestamps.
With that said, I think Linux's "never break user space" is one of the main reasons Linux is so dominant. And that is making the time_t work harder to complete.
https://www.adelielinux.org/ is an example of a Linux distro built on musl-1.2, so you can use that beyond 2038 on 32-bit hardware.
> No, it will not fail. In the worst case, from the viewpoint of a programmer it will work as expected: it will be reseted to date 1901-12-13 20:45:52:
This said, I hope you don’t really plan to be still using that thing in 18 years’ time.
Why would they stop working? Very few apps care the exact time.
And if we want we can just reset the clock back for a system that does not care.
I wouldn't be surprised at all if there were some original embedded systems still running machinery and the like in a century from now, catastrophic events notwithstanding. The sort of low-power embedded systems likely to be running DOS don't really experience any wear. There's quite a bit of equipment in the "low-level" manufacturing industry which is around a century old, and has basically been in continuous operation since it was installed.
Clipper/xBase systems that do their job is one niche of MS-DOS apps that refuse to die. Another niche I know of, is gambling machines (one-armed bandits), for some reason people kept using DOS (at least they moved to FreeDOS by early 2000s).
Doing DB operations is relatively simple, formdata entry and validation is super easy, supports modules, OOP and even compiles to native code.
Yeah not good for networked operations, but in many mom and pop shops it isn't needed anyway.
Even VB/Delphi for all their RAD capabilities were already much more complex than Clipper, but they messed up their migration into the GUI world and CA Visual Objects was too complex for the Clipper crowd.
NASA still uses PC-DOS based IBM PCs to control things.
DOS doesn't crash like Windows.
GRR Martin uses Wordstar and MS-DOS to write his novels because he does not want to be distracted by pop up windows and system alerts and updates.
No, it crashes like DOS. I suppose if your application is well written and you have fully exercised the functionality that you use, it might be more stable, but "reliable" is not a word I would have associated with those systems.
Legacy systems exist in all walks of life, for all kinds of systems. They've solved the problem they were set up for, and so even maintaining them is often something management can be unwilling to set a budget for.
There's an oft shown, but rarely sourced, image suggesting that the US Navy food service management system was running on MS-DOS in 2011, and if that is accurate, I can't find any suggestion they have since changed that situation.
And it will make it available over PC/TCP, using a chain of adaptors and converters from 100BASE-TX.
Don't tell me it's such a small change that it does not matter. That's the attitude everywhere, and the results can be seen. Those living at the US west coast experienced the fires, not to mentio Australia. Myself I used to ski 3 months 20 years ago, maybe 1 month in a warm winter. Now I hardly get over 3 weeks, less than 1 week in a warm winter.
There is a sweet spot for low cost chips, I think its 40nm due to mask costs, manufacturing gets exponentially more expensive from that point on, which is the reason they haven't upgraded. Anyone knows if there are signs this cost is coming down over time?
I think the main point is to use 32bit on new nodes too. Using 32bit instead of 64bit is always more energy efficient unless perhaps you really need 64bit for your application, which most applications don't.
What I think will happen is that the huge amount of money that goes into developing mobile phone SoCs, which are clearly trending towards 64Bit while still requiring low power consumption, will cause that technology to trickle down and be used in ever lower cost markets as time passes and those initial costs have been recouped. The Apple M1, as a system, is clearly crazy power efficient, even at 5nm. And again, if you need an ultra-low power sleep mode, because you only wake up once a day to send some sensor data out, its probably not running Linux in the first place.
You can't make chips arbitrarily small, because you end up wasting more of your wafer for the area between the dies and for the wire bond pads. If the chip size stays the same but the CPU gets smaller, most of the chip is for off-core components and the CPU has less impact on the total cost and power consumption.
You could use more complex CPU cores, or simply more cores, for better performance, but then you also need a faster memory interface (wider buses, LD-DDR4+ instead of DDR3, ...) to make actually use of the performance. These lead to higher memory capacity as well, but then you can't actually use the available memory as you run into 32-bit addressing limits.
I wouldn't rule out shrinks of existing 32-bit SoC families to 22nm or below to lower cost once those processes get cheap enough and there is still demand for compatibility, but there is a good chance that 28nm SoCs is where 32-bit ends. (note that I'm not talking about the dozen or so additional ARC/Xtensa/RV32/Cortex-M/... microcontroller cores on high-end SoCs, as those are not the ones running Linux).
The sweet spot for power efficiency has apparently moved from 28nm to 22nm, which uses less energy than either 28nm HKMG or 14nm FinFET and is also closing in on 28nm on cost.
There no mainstream 32-bit cores on 22nm or below (yet), so there is a good chance that the coming generation of low-cost 64-bit SoCs on 22nm will beat all 32-bit chips on performance, power consumption and cost.
that's not entirely true. they consume less energy in run mode, but in deep sleep the leakage currents are higher than with larger nodes. this is relevant for ultra low power applications, but those don't run linux anyway.
I do only cross-country skiing.
Could also call it an irony that if mention a concept with 2 variants, the reader automatically assumes the more commercial, the more industrialized, the more polluting variant today.
Are you sure that running two production lines and supporting both of them long term is more sustainable than killing one of them?
> By law of physics they could be built using less resources during production and during their lifetime.
If you want to go that way, why not even more efficient arm cortex?
For all purposes actually in my case. The best notebook I've ever bought was/is the HP EliteBook 2530p; it runs 12 hours on battery, more than I need for my work day. I bought a new one in 2009 and a couple of used ones and parts since then. Most of my software and firmware development happens on this machine (Linux i386; I also have to support macOS though). It always works, never had downtime (I can replace parts within minutes if need be). Even Netflix works. And of course also all the embedded systems I produce are 32 bit, about half of them with Linux (the others are microcontrollers).
It's not. GNU pre-dates Linux by nearly 10 years. But even if you're talking strictly about kernels, 386BSD and Hurd were started before Linux.
> Just fork the repo and maintain 32 bit code yourself if you want to keep it.
I've often noticed -- and not just on here -- that when commenters prefix "just" to a sentence, the work involved is usually non-trivial.
Maybe 64 bit CPUs can get more resource efficient than older 32 bit models. But that's a misdirected use of resources if you use such technolgy to make 32 bit CPUs obsolete. With the same technology 32 bit will always use less resource-demanding than 64 bit. And the claim was that 32 bit has so many use cases (basically all phones and many PCs) that economics of scale are possible.
Of course the nonsense model that you don't pay for Internet services directly, but use Javascript and a lot of other bloat software to run advertisements on your phone to pay via a massive detour is not an energy-efficient approach.
> Linux was first written as a desktop system for IBM PC compatibles, ...
> The earliest i386, ... processors all got phased out over time, ...
> The table shows the 32-bit desktop platforms that proved popular enough to make it into mainline Linux and stay there, supported mainly by loyal hobbyists:
> ...
> Platform: IBM compatible PC
> Architectures: ia32
> Earliest supported machine: PS/2 model 70 486
Wha...? Where is i386 in the table?
"Nuke 386-SX/DX support" was submitted to 3.8 in Dec 2012 (http://lkml.iu.edu/hypermail/linux/kernel/1212.1/01152.html), but explicit support existed up to that point since Linux's inception in 1991. I mean, Linux was written for the 386! That was the chip you had to be using since Linux's memory manager was built on top of its MMU.
I accept I may be completely misreading/misunderstanding something here.
ia32 seems to be a a more relevant descrition
When the article says
> Linux was first written as a desktop system for IBM PC compatibles, and was eventually ported to almost every other desktop platform available in the 1990s, including a lot of the early Unix workstations across all architectures.
Because of the juxtaposition with the subsequent platform table, I think a lot of people might be misled into think that both 64-bit CPUs and 64-bit Linux was late to the game. But 64-bit Linux existed as a first-class environment before it supported any other 32-bit architectures like MIPS, PowerPC, or SPARC; before Linux gained any commercial attention (DEC notwithstanding); and AFAIU before there was any kind of serious commitment to syscall ABI stability.
GCC supported "long long" on 32-bit architectures since at least 1989, before Linux even existed.[1] I think some Unix environments supported 64-bit off_t on 32-bit architectures before Linux was ever ported to Alpha, and possibly before Linux existed. In any event, using long long for off_t was a done deal by January 1995 at the first Large File Summit (LFS) meeting. The first two slides at https://web.archive.org/web/20000903063117/http://ftp.sas.co... suggest using long long for off_t was assumed; the year-long summit was apparently concerned with all the other details. That suggests long long was a relatively well worn and mature type in Unix C environments.
Moreover, Linux didn't even get LFS support until several years after the LFS POSIX API was formally published in 1996.[2] It could have implemented a similar solution for time_t and time-related syscalls at the same time it did for off_t and file operations. LFS support has been the default for such a long time even on Linux that today nobody even questions whether 32-bit binaries support 64-bit file operations. Instead Linux apparently waited another 15+ years just to implement that exact solution.
In other words, the potential to recognize and address the representation of time_t--and 64-bit types on 32-bit architectures more generally--existed basically from the very beginning of Linux and only grew more pressing and easier to implement, at least in terms of toolchain support, with each subsequent year. That's noteworthy. Not because it proves the Linux developers were mistaken or had the wrong priorities, but because it shows they weren't blindsided by the issue. The history can provide guidance for people to navigate similar dilemmas today, regardless of whether one would have left the issue on the table until later in the day, like Linux did, or chosen to address it earlier on.
[1] In 1989 GCC supported long long by calling into a library, similar to what it does for some intrinsics when not natively supported. I'm not sure when GCC began open coding 64-bit operations (i.e. generating inline assembly for all operations on 64-bit types).
[2] Not until 2.4.0 judging by http://linuxmafia.com/faq/VALinux-kb/2gb-filesize-limit.html
For time_t, I remember it first getting discussed seriously among kernel developers around 2010 as it became clearer that we had misjudged how long 32-bit systems would be around for, how much work it would be to fix it, and how long before 2038 things would fall apart from bugs. Before then, the general thinking was we could either delay dealing with it until the 2030s or 32-bit Linux would just not be there any more.
I would consider the LFS transition a user space failure, as glibc never made that the default and Debian still builds some packages with 32-bit off_t to avoid breaking the interface between libraries. As late as 2018, glibc was still merging architecture ports (csky) that default to a 32-bit off_t, despite the kernel having 64-bit off_t since 1994 (linux-1.1.46) before any non-i386 ports were added, and all new architectures in the kernel only supporting 64-bit off_t since 2011.
The other kind of lame consequence of that is I have to use Chromium rather than Firefox, which irks me just a little.
Other than that, the RaspberryPi 400 is a really nicely put together little machine.
Probably by 2106 the machines will be responsible for coding, and it will then be their problem; or, civilization might collapse, so any people remaining will have bigger worries. Or (best case) both.
(And, FWIW: my expectation is that civilization will have collapsed because of the machines taking over, and the only thing that will save humanity is when they all keel over and die on February 7, 2106.)
You go through and subtract 50 years from all date values you have in storage, change the date display code to show everything based on 2020, and you've kicked the can on the problem down to 2088.
Treating a 32-bit timestamp field as unsigned seconds since the epoch at least keeps backwards compatibility with existing software up until 2038.
That's probably what you needed to do anyway, if you want the code to compile correctly on systems with 32 and 64-bit time_t.