BSD is Berkeley Software Distribution; a family of Unix flavors.
A short digression:
In the way back time, Unix was issued in ‘Versions’ by Bell Labs. As THE Telephone company was not allowed to make money from computing, only from their telephone monopoly, many licenses were essentially given away to schools. Along the way, the Seventh Version was licensed to U. of California at Berkeley or UCB. They got a ‘special deal’ that let them re-license their changed version on a similar free basis. Thus began BSD based on Version 7. Over a few years, a huge number of these licenses spread over the entire world of Education, and eventually leaked out into the commercial world. The original Sun O/S for example, was “BSD Based”.
Then AT&T got broken up and was free to make money from computing. Try as they might to break the V7 license, they couldn’t. So they did the next best thing. They loaded a bunch of capricious changes into Unix, broke a lot of things in new and different ways, and began touting “System V – Consider it Standard”. Painting BSD and anything V7 based as out of date.
Well, that history didn’t end well of The Telco. Eventually Unix license and I.P. was sold to SCO and on to Novel and I think it is now part of Suse? But not many people really care. Along the way, the Government got P.O.ed at the changes and started the POSIX standard movement.
Linux came along (and despite The Telco and others all trying to sue them out of existence too) the river just flowed around the lawyers… Sue on some detail of some command, it mutated into a different command. Folks went into various bits of code rooting out anything tied to System V or Unix. Eventually the whole waste of time and effort ran down along with the value of the Unix I.P. (Intellectual Property), and thus the sales and re-sales of the ownership.
Through It All, BSD soldiered on. THEY had an indestructible position. They also had millions of university students globally polishing on the product on one side, and doing their damnedest to break it on the other. Makes for a very sturdy and secure product.
Now the Linux world has gotten most of the recent fame and glory. BSD being more staid and not liking to take on new stuff too fast ( like Gnome or KDE or …) lest some bright student find out he can get into the grades on line using some new hack. So it is harder to install. More things done “the old way” and longhand; much less GUI (Graphical User Interface) and hand-holding. So while I really really like BSD, most of my machines have been Linux the last few years as it is quick to install, easy to play with, and had lots of goodies. But I’ve always thought I ought to get back to my BSD roots someday.
“Someday” bringing up the issue of time…
I’ve been collecting some Temperature Data, including daily data, and I’ve been looking at things like TOBS Time Of Observation Bias. Temperatures need times to be valuable. I’ve been looking at model codes, and that maybe they need a time of day factor and sun rise / fall daily as they are run foward predicting the next couple of decades. And I’ve been looking at File Systems and archiving and coping with some of the particularly lousy things done with metadata, such as time stamps, in some file systems (FAT32 is horrid, NTFS only a little better). But sad to say, Linux and Unix “have a time issue on their hands”. Their file systems do keep time correctly; but not for long.
Back in the 1970s, when Unix was a new idea, the lab rats didn’t think much about 2038. Most likely would not be alive then themselves, and computers would be worlds different. Heck, they had no idea Unix would dominate servers, and Linux would sprout from it to own the entire embedded systems and cell phone markets (that also didn’t exist then). So they decided that a nice fat giant sized time number could be used to code for all time. That is why Unix uses the ‘start of time’ as the start of Unix. And time is just stored as a 32 bit integer. Negative numbers being ‘before Unix’ and positive numbers being after Unix. A whole lot easier than that whole Julian / Gregorian / daylight savings time etc. etc. junk. Just an INT. Increment and move on. Zero at the 0:00 on 1 January 1970. On all Unix, in all places, everywhere. OOoooohhhhommmmm……..
In 1970 an 8 bit machine was big enough, 16 bits was big, and 32 bits was a mainframe. There were a few with larger words, but not much. Just doing a 32 bit INT on many machines was more than one computer word. Using 64 bits for every scrap of time would just be nuts. Now not so much. Now even desktop machines are 64 bits.
Why Does This Matter?
Because it breaks on dates in 2038, or 23 years from now.
Such implementations cannot encode times after 03:14:07 UTC on 19 January 2038, a problem similar to but not entirely analogous to the “Y2K problem” (also known as the “Millennium Bug”), in which 2-digit values representing the number of years since 1900 could not encode the year 2000 or later. Most 32-bit Unix-like systems store and manipulate time in this “Unix time” format, so the year 2038 problem is sometimes referred to as the “Unix Millennium Bug” by association.
Why worry? Heck, my computer will likely be long gone to the binary graveyard well before 23 years…
Well, because maybe before then you will want to USE a date and time after then. Like, oh, if you were running a simulation and date stamping files and data for a few decades into the future as part of your process…
Some folks have already started to run into things, though only a few small cases so far. This WILL get worse as time goes by. For example, how about folks who want to restore and preserve “antique” cars in 2038? A car computer built today will not work right then if it uses dates. (Almost all embedded systems are like this and are NOT 64 bit systems…)
In May 2006, reports surfaced of an early manifestation of the Y2038 problem in the AOLserver software. The software was designed with a kludge to handle a database request that should “never” time out. Rather than specifically handling this special case, the initial design simply specified an arbitrary time-out date in the future. The default configuration for the server specified that the request should time out after one billion seconds. One billion seconds (approximately thirty-two years) after 9:27.28 pm on 12 May 2006 is beyond the 2038 cutoff date. Thus, after this time, the time-out calculation overflowed and returned a date that was actually in the past, causing the software to crash. When the problem was discovered, AOL server managers had to edit the configuration file and set the time-out to a lower value.
Players of games or apps which are programmed to impose waiting periods are running into this problem when they attempt to work around the waiting period on devices which harbor the coding, by manually setting their devices (such as the Nexus 7) to a date past 19 January 2038.
Embedded systems that use dates for either computation or diagnostic logging are most likely to be affected by the 2038 bug.
Many transportation systems from flight to automobiles use embedded systems extensively. In automotive systems, this may include anti-lock braking system (ABS), electronic stability control (ESC/ESP), traction control (TCS) and automatic four-wheel drive; aircraft may use inertial guidance systems and GPS receivers. However this does not imply that all these systems will suffer from the bug. Many such systems will not require access to dates. For those that do, those systems which only track the difference between times/dates and not absolute times/dates will, by the nature of the calculation, not experience a problem. This is the case for automotive diagnostics based on legislative standards such as CARB.
Another major use of embedded systems is in communications devices, including cell phones and Internet appliances (routers, wireless access points, etc.) which rely on storing an accurate time and date and are increasingly based on UNIX-like operating systems. For example, the bug makes some Android devices crash and not restart when the time is changed to that date.
As of 2012, most embedded systems use 8-bit or 16-bit microprocessors, even as desktop systems are transitioning to 64-bit systems.
Despite the modern 18–24-month generational update in computer systems technology, embedded systems are designed to last the lifetime of the machine in which they are a component. It is conceivable that some of these systems may still be in use in 2038. It may be impractical or, in some cases, impossible to upgrade the software running these systems, ultimately requiring replacement if 32-bit time_t limitations are to be corrected.
The use of 32-bit time_t has also been encoded into some file formats, which means it can live on well beyond the life of the machines on which such file formats were originally supported.
MySQL database’s inbuilt functions like UNIX_TIMESTAMP() will return 0 after 03:14:07 UTC on 19 January 2038.
It was that MySQL item that caught my attention as I was contemplating Temperature Database design and extending it into the future for model run outputs… Then that next to last bit about file formats has implications for data archival and restore operations.
BSD To The Rescue!
Just about when I was thinking forlornly that this was Not Good for me and my goals, once again, BSD is way ahead of all the rest. Note that in the following quote DVB is Digital Video Broadcasting and ATSC is your new Advanced Television standard… yeah, almost brand new and they didn’t think 20 years ahead…
But look just a little further down at BSD… (I’ve bolded it a bit) Also, honorable mention for Linux on 64 Bit hardware.
There is no universal solution for the Year 2038 . Any change to the definition of the time_t data type would result in code compatibility problems in any application in which date and time representations are dependent on the nature of the signed 32-bit time_t integer. For example, changing time_t to an unsigned 32-bit integer, which would extend the range to the year 2106, would adversely affect programs that store, retrieve, or manipulate dates prior to 1970, as such dates are represented by negative numbers. Increasing the size of the time_t type to 64-bit in an existing system would cause incompatible changes to the layout of structures and the binary interface of functions.
There is also no universal solution for the issue with DVB and ATSC real time transmitted dates due to issues with legacy receivers. Also the issue has yet to be acknowledged or resolved by either organization. The only work around would be to discontinue all time related metadata services such as programming guides and automatic date synchronization after the affected dates. One possible option would be to create new table types for the affected part of the specifications and use ISO 8601 date strings rather than fixed integers as is used in ISO 9660 and ISO 13346 filesystems.
Most operating systems designed to run on 64-bit hardware already use signed 64-bit time_t integers. Using a signed 64-bit value introduces a new wraparound date that is over twenty times greater than the estimated age of the universe: approximately 292 billion years from now, at 15:30:08 on Sunday, 4 December 292,277,026,596. The ability to make computations on dates is limited by the fact that tm_year uses a signed 32 bit int value starting at 1900 for the year. This limits the year to a maximum of 2,147,485,547 (2,147,483,647 + 1900).
Starting with NetBSD version 6.0 (released in October 2012), the NetBSD operating system uses a 64-bit time_t for both 32-bit and 64-bit architectures. Applications that were compiled for an older NetBSD release with 32-bit time_t are supported via a binary compatibility layer, but such older applications will still suffer from the Year 2038 problem.
OpenBSD since version 5.5, released in May 2014, also uses a 64-bit time_t for both 32-bit and 64-bit architectures. In contrast to NetBSD, there is no binary compatibility layer. Therefore, applications expecting a 32-bit time_t and applications using anything different from time_t to store time values may break.
The x32 ABI for Linux (which defines an environment for programs with 32-bit addresses but running the processor in 64-bit mode) also uses a 64-bit time_t. Since it was a new environment, there was no need for special compatibility precautions.
Alternative proposals have been made (some of which are in use), such as storing either milliseconds or microseconds since an epoch (typically either 1 January 1970 or 1 January 2000) in a signed 64-bit integer, providing a minimum range of 300,000 years. Other proposals for new time representations provide different precisions, ranges, and sizes (almost always wider than 32 bits), as well as solving other related problems, such as the handling of leap seconds. In particular, TAI64 is an implementation of the Temps Atomique International standard, the current international real-time standard for defining a second and frame of reference.
So now I can confidently proceed secure in knowing Linux on my 64 bit hardware will work for dates more than 20 years in the future, and that on my 32 bit boxes, worst case, I need to run a BSD release (that I already have stored in archives).
I’m also even more justified in my desire to avoid any car with a computer in it (successful so far and not planning to buy anything newer) and not have my home appliances know the time, nor talk to the internet. (“Smart Grid”? When it all breaks 20 ish years out?)
Yeah, yeah, I know, we’ll just buy everything all over again in 2020 to 2025…
But I like old things and I like to have them still work.
Besides, I’m looking at doing things using times measured in centuries…
So there you go. Reason to migrate toward 64 bit hardware for new boxes. Reason to use BSD for ‘Scientific’ things with deep time into the future. And comfort in knowing some folks actually look at such things.
But I’d start being very cautious about buying things that have embedded systems in them that are ‘date aware’ and that you expect to know about any times/dates after 2037 or so…
Though do remember that if it doesn’t have a clock in it or “do time” this is unlikely to matter. During the Y2k hysteria I’d ask folks: “Does the gas pump have a clock in it? Do you set the time?” and then explain to them that “IF it doesn’t know what time it is, it will continue to work Just Fine.”
Subscribe to feed