Dual Universes

The idea itself was fairly simple. Create a per-process “switch” in memory that would be set to either BSD or AT&T. The behavior of various system calls might depend on the value of the switch. Furthermore, certain special directories could be set up so that the directory you’d actually see would depend on the switch setting. Thus, you could have /usr/bin full of user programs, but it would really be two /usr/bin directories – one of BSD and one of AT&T!

Something – some subconscious drive – made me go an look-up this little bit of Unix history on Google; I’ve hacked/used a couple of BSD/SVr3 full or partial dual-universe platforms in my time, notably Pyramid, Sequent, and the Gould/Encore platforms in the late 80s / early 90s.

The marketing requirement for supporting two sets of tools lives on in even in modern Solaris, as the article continues:

For example, Solaris has two versions of the ls command, one in /usr/bin/ls, one in /usr/ucb/ls. It also has two versions of head, more, ln, ps, and many other commands. Thus, you need to check your search path carefully to know which version of a command you may be using.

You can read the whole article at [www.busan.edu] – it is an aspect of history that is worth remembering.

Deployed wisely and conscientiously, I believe that dual-universe solutions are actually a great idea, enabling quick porting of code and applications from another OS system to whichever is the best-fit target universe — but I believe that with the proviso I further believe your app (or user) should be exist clearly and definitively in one universe, or the other.

Never both.

Like in all good Sci-Fi, when the walls between universes are thin and/or permeable, bad sh*t starts to happen.

Comments

7 responses to “Dual Universes”

  1. mrod
    re: Dual Universes

    You mean like /usr/ucb/cc and the BSD “compatability” libraries on Solaris.. Now, try to use those and bad sh*t happens right away!

    Of course, Solaris has more than just the two “universes” as it has /usr/xpg4/* and that’s a another kettle of worms altogether. Then again, /usr/xpg4/bin/grep does have the -q options which is dead useful with find, unlike the other versions of the command.

  2. Dave Levy
    re: Dual Universes

    You are right to point out that one of the key drivers for doing this at that time was to address both BSD&SysV markets. I worked at Pyramid at the time of the Unix Wars and the coming of SVR4 which was the UNIX people’s answer to the balkanisation of the market. The SVR4 ABI was meant to solve the porting problems.

    Also having both universes meant that the full range of utilities was available.

  3. mrod
    re: Dual Universes

    Of course, the only fly in the ointment was that the BSD-ish ABI (and most of the utilities) were irretrievably broken. The BSD library for a start seems to have been implemented by a martian who has been given sketchy details about how the BSD stuff worked and then implemented how he thought it looked.

    It’s sort of akin to the relationship between the old Volkswagon and the new VW beetle. It sort of looks similar from half a mile away but actually bears no relation to the original at all. Except, the new Beetle actually works as a car and the BSD compatability stuff doesn’t work at all.

  4. Jander
    re: Dual Universes

    I used to like the unix on the HP Apollos. That used to have some twisted magic with symlinks whereby you could embed an environment variable into the link name. This way you could have voodoo like :-

    /usr/bin -> /usr/$SYS/bin

    That way you set $SYS and had different ls et al behaviour.

  5. bartb
    re: Dual Universes

    Having completely seperate namespaces (for things such as /usr/lib etc) sounds like a useful thing to have… as long as the seperation is well-enforced (to avoid interactions between the different libraries/commands).

    Something like multi-level directories (as in Trusted Solaris, cf docs.sun.com/db/doc/816-1042/6m7g4ma68?a=view ) with a simplified set of “labels” (to indicate context) sounds like a viable way of implementing such…

    (It adds complexity only for those that have a need to switch between universes (and for admins), but having the universe be dependant on a fixed attribute of every executable file or on the setting of the parent process (hence based on a preference set at login time) it would be invisible to Joe User)

  6. Chris Samuel
    re: Dual Universes

    Hmm, I’ve fallen through a timewarp into the early 90’s! 🙂

  7. David Magda
    re: Dual Universes

    You do realize that the page you pointed to is a copyrighted O’Reilly book? Is it supposed to be freely available on the web?

Leave a Reply

Your email address will not be published. Required fields are marked *