A Port of “The Last True Unix” to x86

(nordier.com)

160 points | by Koshkin 1219 days ago

11 comments

  • dboreham 1219 days ago
    First real computer I used, and first exposure to open source was v7 on an 11-45 in 1981. The sysadmin caught me running a huge print job. Asked angrily what I was printing. I said the C compiler source. He says "Oh, ok, that's fine then".
    • walrus01 1219 days ago
      lp0 on fire
      • dboreham 1219 days ago
        Tally 9-pin 132-column dot matrix. Logic seeking. Green ruled fanfold. Installed backwards.
  • peter_d_sherman 1219 days ago
    v7x86-0.8a.tar - ~13 MB

    v7x86-0.8a.iso - ~14.6 MB

    Keep in mind, that also includes kernel, kernel source, C compiler, C compiler source, and utilities and utility source.

    For comparison, the source of most recent version of gcc, 10.2 -- gcc-releases-gcc-10.2.0.tar.gz -- weighs in at ~118.7 MB, and that's compressed...

    Or for comparison, one of the "standard" 600 MB+ (and sometimes much more!) Linux distributions...

    Also, v7 Unix occupies a unique place amoung Unices, that is, it's

    the simplest possible version of Unix that is actually still functional with the code being readable

    (earlier versions have much more assembler code and less C) -- so anyone interested in learning Unix or one of its derivatives from the ground up is well advised to study this source code!

    To the Author: You undertook a great job in getting this ancient code base to work on x86, and the community of Unix researchers, students and scholars, both now and in the future -- thank you for this laudable effort!

    • acqq 1219 days ago
      > C compiler source

      Not included in this distribution. Also not included: the source of boot and the source of compiler used to compile that.

      See my other post here for the references.

    • garretraziel 1219 days ago
      > the simplest possible version of Unix that is actually still functional with the code being readable

      I would argue that Unix v6 (when you consider excellent book Lion's Commentary on UNIX 6th edition) takes that trophy.

    • ink_13 1219 days ago
      In fairness to gcc, it's more than just a C compiler.
  • acqq 1219 days ago
    For those who are interested in which sources aren't included:

    https://www.nordier.com/v7x86/files/RELNOTES

    "The following limitations apply to the distribution:

    - The source to the C compiler is not part of the distribution. This is currently built separately as a component of a modified version of the Amsterdam Compiler Kit (ACK).

    - The source for boot (the second stage bootstrap) is not part of the distribution. This is currently built separately using a 16-bit version of pcc."

    The compilers mentioned:

    https://en.wikipedia.org/wiki/Amsterdam_Compiler_Kit

    https://en.wikipedia.org/wiki/Portable_C_Compiler

  • anonymousiam 1219 days ago
    • notaplumber 1219 days ago
      This project is certainly covered under the Ancient UNIX licences.

      "Later, in January 2002, Caldera International (now SCO Group) relicensed (but has not made available) several versions under the four-clause BSD license."

      https://en.wikipedia.org/wiki/Ancient_UNIX

      Nobody is going after a v7 Unix port, the sources for ancient Unix are widely distributed on TUHS (The Unix Heritage Society, tuhs.org) and such.

    • azalemeth 1219 days ago
      Genuine question: what was SCO good for? I'm young enough that literally the only reason I've ever heard of them is for their ill-guided, failed litigation attempts. I've heard a lot of (mostly good) things 'bout the BSDs, HP-UX / SunOS / NeXT / AIX etc, and even driven Irix and Solaris myself. But SCO is never mentioned and I've literally never met someone who used (uses?) it. Yet somehow...they live on, albeit in a lawyerly state of death. What's the story?
      • macdice 1219 days ago
        SCO and Xenix let you drive a large number of text terminals or POS systems from a cheap PC. I worked on a factory automation system that had a huge number of serial cables connecting sensors and terminals up to a machine that could barely have run a graphical word processor. It was fantastic, but doomed by open source; you had to pay thousands for extra modules like the C compiler and TCP stack etc, which started to seem a bit absurd by the early 90s. It's a shame their name was later dragged through the mud by people completely unrelated to the original project! There's some good info here: http://www.softpanorama.org/People/Torvalds/Finland_period/x...
        • neilv 1219 days ago
          Xenix support for multiple terminals played a part in a distributed specialized CRM system, for which I had some small gigs helping launch as a kid.

          IIUC, each of the many field locations could run the software locally on either (if the location needed only one simultaneous user) an 8088-based Sperry PC running MS-DOS, or (if multiple simultaneous users) an 80286-based Sperry PC, running Xenix, with terminals hanging off it.

          Yes, there was `hack` on these Xenix '286 systems. :)

          I think the official terminals might've been the popular Wyse WY-50, but there were also some unusual Tatung terminals kicking around the same organization.

          IIUC, the field location PCs had modems for infrequently sending data back to HQ (maybe sharing the main voice POTS line for some locations, after business hours).

          I imagine that the ability to use cheap PC hardware and dumb terminals made economic sense. Compared to a centralized minicomputer, and a bunch of dial-up dumb terminals and dedicated phone lines.

        • olgeni 1219 days ago
          > you had to pay thousands for extra modules like the C compiler

          You could build gcc by means of the "hidden" C compiler in SCO Open Desktop, which was used to rebuild spaces.c and then relink the kernel when changing the configuration \o/

        • tonyarkles 1219 days ago
          I’m laughing so hard at this. I had a single exposure to SCO, and it was in exactly that configuration: a clothing factory that had a ton of dumb terminals slung onto it with serial-to-Ethernet concentrators. The whole factory setup seemed a little janky, but the client was very very happy with it, and it seemed rock solid in daily use.
      • cmrdporcupine 1219 days ago
        It kind of had its heyday in the awkward era where PCs were _just_ powerful enough to finally run Unix decently but before Linux was considered mainstream or mature enough. And that was a very short period, maybe 92-95 or so?

        Its predecessor, Xenix, may have had more brand awareness?

        I remember a summer job I had, 1998. Contracting doing basic sysadmin stuff for a subsidiary of IBM. I wanted to install Linux on a PC to do some stuff, mostly account password stress testing, etc. Got sign off from most of the team, but one guy dug his foot in... "we should use a real Unix. This Linux thing could get us in trouble. We should be using SCO" He got some funny looks. The next year all of IBM was all-in on Linux, big corporate strategy.

        • hapless 1219 days ago
          SCO's peak was in the late 1980s, when 286 and 386 systems cost a lot less than a more "serious" UNIX box
          • cmrdporcupine 1218 days ago
            SCO wasn't released until 89. Before that it was Xenix.

            I remember my high school gf's father had a SCO Unix machine in his office. This was about 1991 I guess. At the time I was an Atari ST user, and just salivated at Unix machines (my luckier/older/wealthier Atari user friends had TT030s and got to play with Unix on them). Once she let me sneak into his office and play with it when he wasn't around, illicit unixing... was very exciting for me :-)

            A few months later I got a 486 for graduation present and installed Linux 0.97 on it.

          • chungus_khan 1219 days ago
            And if you didn't need the extra power you could get all the suffering of a Sun box for the cost of a common office PC.

            I think that's why I've seen very few workstations using it, but it's pretty common as a shared industrial system. If you need a single user system you'd just use DOS, if you need a powerful workhorse you'd get a fancier system, possibly some newfangled RISC machine, but if you need a multitasking system and don't need much power for any individual task it's ideal.

      • yjftsjthsd-h 1219 days ago
        IIRC, there were effectively 2 companies called SCO: The first one that made an actual useful unix, and the second that was all about lawsuits. I think it was that the second company bought the first? Been too long. Anyways, that would account for it.
        • chipotle_coyote 1219 days ago
          Yep, that's correct.

          The original SCO made SCO Xenix, later branded SCO Unix. Meanwhile, another company called Caldera Systems had been spun out of Novell to keep working on the Linux version that Novell had originally done, back when they had a grand plan to challenge Microsoft on all fronts from applications down to the OS level.

          As Linux really took off, though, SCO kind of saw the writing on the wall. They sold their Unix business to Caldera and renamed themselves Tarantella, after a... frankly, I don't remember what it was, anymore, but it was a program they made that had become the bulk of their business.

          I'm not sure when Caldera renamed themselves to SCO, but by the time the litigation started flying, Caldera Linux had failed in the market and most of its original staff had left the company. The people now in charge decided that their best asset was IP relating to "real Unix," and the rest is history. Strange, strange history.

          The sort of ironic footnote lost to history at this point is that the original Caldera Linux you could get back before they went all troll was, in my recollection, actually a pretty promising distribution. I played with it for a while and was pretty impressed.

          • lokedhs 1219 days ago
            I worked for a local distributor of SCO back in the 90's, and because of that was working quite closely with the company. They were pretty cool, and did some interesting stuff. It's sad that their legacy has been tainted by what happened with the other company called SCO.
          • jeffal 1219 days ago
            I remember Tarantella being a Citrix-like Remote Desktop type software.
      • Nursie 1219 days ago
        I worked on a SCO system briefly in about '02, there was a EMV related PoS system I was writing that needed to run on there for a customer.

        Selling points were that it ran on x86 and was Unix, basically. As a result you could have Unix on fairly cheap hardware. There was a Linux "kernel personality" you could install on SCO Unixware (IIRC), that would run linux binaries, if you cared for that.

        By that time it was on the way out though. You have to remember it was a transitional time - Linux was on the rise but in many people's view it hadn't yet proven itself. IBM, HP and Sun were still ruling the roost for servers, but their stuff was expensive. SCO gave people a way to make commodity x86 hardware into something server-like.

        Honestly it wasn't a terrible system, it just got superseded quickly and then went down in flames.

      • Roboprog 1219 days ago
        I think the order management system at Pizza Hut in the early 90s was on SCO.

        (Yeah, Snow Crash hit a little too close to home for me.)

        We had an SCO box (among other unices) at the job I worked in the early 90s making software to port RPG code off of IBM minis.

      • wazoox 1219 days ago
        I developed an interactive voice service in the early 90s running on SCO Unix. It was stable and efficient, and didn't require expensive hardware. Of course Linux wasn't really a workable option in 92/93 :)
      • jjav 1219 days ago
        Late 80s to early 90s before Linux existed there weren't many ways to run unix on x86 hardware of the time. I remember desperately searching for solutions so I could have unix at home and not always rely on the university SunOS/HP-UX/AIX machines.

        SCO was one player in this space. I can't remember the other one I was considering.. In the end they were all too expensive for poor-student-me so didn't use any of them and kept using the lab SunOS boxes via 2400bps dialup from home until Linux appeared on the scene.

        https://en.wikipedia.org/wiki/Santa_Cruz_Operation

        • GrumpyYoungMan 1219 days ago
          Perhaps Coherent was the other UNIX you were thinking of?

          https://en.wikipedia.org/wiki/Coherent_(operating_system)

          • icedchai 1219 days ago
            Coherent was my first exposure to PC "Unix", back when I was in high school. I had a 386SX laptop with 4 megs of RAM. It was amazing how lightweight Coherent was. The manual was also amazing, very comprehensive, including most of the POSIX APIs.
          • jjav 1219 days ago
            Yes! Coherent it was. Thanks.
      • nineteen999 1219 days ago
        Lots of comments here telling you what it was used for, but its probably also useful to know that SCO was an x86 port of AT&T System V UNIX.

        There were lots of these, including the AT&T SVR4 port, Solaris/x86, NCR MPRAS, Xenix, SCO OpenServer, UnixWare, DELL UNIX, NEC PC-UX/V, ISC PC/IX etc etc.

        Linux had (has?) the iBCS module since enabling some binaries from some of these platforms to run "natively" since around 1994:

        https://en.wikipedia.org/wiki/Intel_Binary_Compatibility_Sta...

        • Nursie 1219 days ago
          Solaris/x86 was an odd one. I played around with it a bit in 98/99 when I got it mailed out for free under a student license. Very restrictive on hardware support and IIRC it was available on and off, disappearing from view entirely at times.

          I knew of that, Xenix and the two SCO flavours, but the others are news to me!

          • nineteen999 1219 days ago
            Yeah the Solaris/x86 releases were really inconsistent, with Sun dropping support at various times and then reinstating it later.

            NCR MPRAS was the oddest duck I ever had to support - fairly vanilla SVR4, but there was bits of NetBSD code cut and pasted in (eg. some of arp cache code, or at least the header files). It was used for running a Teradata data warehousing solution for a poker machine/lottery corporation I worked for. I actually managed to get gcc 2.95.2+binutils running on it and managed to compile and package up a lot of GNU utilities etc for it.

        • tzs 1219 days ago
          I'd replace PC/IX with 386/ix. PC/IX was based on System III, not System V, and it was for the PC XT which did not have protected mode.

          386/ix was ISC's port of System VR3 to the 80836. Actually, it was the official port of System VR3 to that processor, done under a contract from AT&T (and maybe Intel...I don't remember for sure).

          There was also a port of System VR3 to the 80286 as part of that same contract.

          The source for both ports was System VR3 on the AT&T 3B2. The memory management on the 3B2 was close enough to that of the 386 that the people working on that part of the port had no problems.

          Not so for the 286 port, which I was working on. We tried treating segments as 64 KB pages, and it worked if you didn't push it hard.

          But if you ran a load test with 20 processes that where each large enough so that only a few could be resident simultaneously, and those processes were all compute bound it got into this pattern that was fair in the very long run, but very unfair in the short run.

          You'd have one process get something like 90% of the CPU, and a couple others getting about 4% each, and the remaining 2% would be split evenly among the other 17 processes.

          It would stay this way for something like a half hour, then you'd get a minute of heavy thrashing, and then that would clear up and you'd be back to the way it had been, except which process was getting the 90%, which two were getting 4% each, and which 17 were evenly sharing 2% would have changed.

          So if you took a long enough view, it was fair.

          Something in the 3B2 paging system algorithms apparently did not like very large page sizes, and the other programmer and I working on the 286 port were having no luck figuring it out.

          Fortunately, AT&T came to their senses and realized there wasn't much demand for a 286 port, dropped it, and I got moved to the 386/ix project, where I added a simple in-kernel debugger and a dynamic device driver loading system.

          AT&T hadn't asked for dynamic device driver loading, but the total size of the kernel including all the device drivers that needed to be included was getting bigger than the boot code we had could handle, and the people dealing with the boot code claimed it was obtuse and ugly assembly code that would be very hard to rewrite to handle large kernels, and so I somehow ended up being assigned making drivers dynamically loadable so we could ship smaller kernels.

          I got it working well, but then the boot bastards went ahead and rewrote the boot code, getting rid of size limits, and my dynamic device loading was no longer needed.

          I also didn't quite escape the 286. I was half the team that did the 286 Unix binary compatibility for 386/ix. That was essentially a Wine-like thing, /bin/i286emul, a 386 process that knew how to load a 286 process into its own address space, set up its memory space, and start it running, with i286emul handling the traps when the 286 code tries a system call and figuring out how to translate between the 286 system calls and the corresponding 386 Unix calls.

          ISC was a fun place to work.

          • nineteen999 1219 days ago
            Thank you for the correction and the wonderful story. I am too young to have done anything other than DOS programming on 16-bit x86, so I can only imagine how frustrating trying to get a multiprocessing UNIX system running with a limited number of a 64KB pages would be.
      • icedchai 1219 days ago
        SCO was reasonably popular in the late 80's, into the early 90's before Linux took off. Locally there were a few BBSes (waffle BBS program, I think) and public access Unix systems that ran SCO.
      • caspper69 1219 days ago
        Wasn't SCO the company that took over Xenix (MS' Unix(TM)) after the forced divestiture of Unix technologies in the antitrust settlement?
      • Sylamore 1219 days ago
        I did some side work for a friend who had a shop management system (inventory, labor, work orders, etc) that ran on top of SCO, literally the only time I've ever seen it in the wild. It had a couple of serial port cards with a few dumb terminals hanging off of it at various places in the shop.
        • Brian_K_White 1219 days ago
          My uncle's shop was exactly like that, and that Xenix box, and then osr5, was where I cut my teeth.

          He is on a linux box now of course, but that last osr5 install was actually migrated to new hardware twice before finally getting the app onto linux.

          There was much to like and dislike about SCO.

          Even back before the later lawsuit people took over, it was a bit ridiculous to ship a system where you had to pay extra (after already paying $1200 or so, in '92 dollars) just to get a compiler, and extra again for tcp. They tried to justify it that most installs didn't need that stuff so by splitting them off you could pay less for just that parts you need. But that kind of doesn't wash when the most basic subset was already ridiculous.

          But I liked it in most other ways. It was limited and annoying by todays standards, and definitely osr5 failed to advance and became terrible to use in comparison with everything else after a while, while still somehow demanding a big price tag.

          But earlier, it was as good or better than anything else at that same time. People did a lot with it. I did a lot with it.

          One thing that was wonderful from a small custom back end software seller point of view, practically zero support overhead. You install the box and your software, and forget about it. The customer calls when they want something new or when some hardware breaks. Proper administration was what they would call neglect today. One guy could have 150 customers out there and spend 1% of his time supporting past installs.

          And 10 years after doing your first install, your latest install used practically identical steps and knowledge. All those 150 systems that were installed spread over a 10 or 15 year period, they all worked the same way. They were all practically identical to each other even though version numbers and hardware drivers changed.

          That is a level of efficiency and low overhead that we'll never see again.

          Today you might be able to magic up 150 servers in a few seconds and a few lines of cloud orchestration config code, but tomorrow everything you learned to do that today will be different, and you better stay actively on top of monitoring them, none of this fire & forget like ye olden dayes.

      • hackbinary 1219 days ago
        The irony is that Caldera linux bought Sanra Cruz Operation, then Caldera changed its name to SCO.

        Then SCO got greedy and tried to charge for royalties from IBM and Novell. They both said no, we'll see you in court.

        I'm not sure if groklaw is still around, but that was a really good resource.

        • ansible 1219 days ago
          growlaw.net was online until very recently. There was no activity for a very long time. I used to visit that site regularly during the lawsuits, and waiting for SCO to go bankrupt.
      • Yetanfou 1219 days ago
        It was a way to run Unix (with a large U) on inexpensive hardware so it could be used for POS terminals and similar applications. This enabled it to capture markets where the workstation and server Unix manufacturers simply were too expensive.
        • azalemeth 1219 days ago
          Did it "do" anything special -- or was "cheap" its USP?
          • Yetanfou 1219 days ago
            No, nothing special, its thing was that it ran on off the shelf PC-hardware which made it cheap to deploy.
          • Angostura 1219 days ago
            It was also simple, comparatively nicely packaged Unix. You could pop it on a PC and it would run.
          • cmrdporcupine 1219 days ago
            It ran on x86 before anything else like that existed, which tbh was a pretty big deal.
      • bluedino 1219 days ago
        Chances your dentist’s office ram Dentrix on SCO at one point.

        They have (hopefully) all moved to Windows by now.

        • nix23 1219 days ago
          >They have (hopefully) all moved to Windows by now.

          Not sure why that's something to hope for, SCO (now Xinuos) is a big supporter of FreeBSD and OpenServer5+6 and Unixware7 are still supported and maintained.

      • wrp 1219 days ago
        I think I heard that SCO found a niche running POS systems in pharmacies.
      • xellisx 1219 days ago
        I remember that NEC used SCO for telephony stuff.
    • nsxwolf 1219 days ago
      Didn't they sell a "license" at some point, that made your Linux installation "legal"?
      • daotoad 1219 days ago
        • LeoPanthera 1219 days ago
          $699! Per processor! I want to know if anyone bought it.
          • Shared404 1219 days ago
            I would also like to know.

            Also, this! (snip added):

            > The license, called the SCO Intellectual Property License for Linux, lets Linux users run SCO's intellectual property in binary form only. "It gives you a license to run the software only. You can't view the source, and you can't contribute it to an open-source product for everyone's use, [...] This is a license that is designed to run in addition to the GPL," he said.

            What?! How on earth can you say this with a straight face!

          • nix23 1219 days ago
            >$699! Per processor!

            That's not much, it's in fact really cheap for a Unix.

  • ggm 1219 days ago
    9th and 10th edition are still Thompson and Ritchie. What is his beef with last true unix?
    • kps 1219 days ago
      V8+ were not publicly available, so the successors to V7 were 4BSD and System V. Hence repurposing Hoare, V7 “was not only an improvement on its predecessors, but also on nearly all its successors”.
    • spijdar 1219 days ago
      I guess it's a "purity" thing, research unix post 7th ed. were derived from 4BSD, inheriting most of its "bloat", if that sort of thing bothers you.

      On the other end of the scale, Plan9 could be seen as the successor to v10 research unix, at least in spirit.

      • ggm 1219 days ago
        I loved 7th edition, used it on a pdp11, I also liked 32V.

        Since this port includes vi, the whole 'no BSD' thing is a bit silly. If it has sockets, it has BSD.

  • fb03 1219 days ago
    could I like, compile and continuously update this until I'd be able to say, have a modern libc and, for example, compile a version of python on top of it?

    that sounds like a fun (nightmare, for giggles) to do

    • nineteen999 1219 days ago
      You'd hit big problems almost immediately, eg. your initial C compiler would be K&R, you'd eventually have to be able to bootstrap a C89 capable compiler.

      That's without having any TCP/IP support and extremely limited storage space for source code and compiled binaries by today's standards.

      I considered attempting this once starting from AT&T SVR4 - even though it had TCP/IP with the right addon package and a C compiler - gcc had dropped SVR4 support a long time ago.

      There's probably another couple of hundred obstacles along the way as well...

    • codezero 1219 days ago
      probably, but you'd probably get better mileage (and modern support out of a pretty active academic community) out of doing that with xv6: https://pdos.csail.mit.edu/6.828/2020/xv6.html
      • ngcc_hk 1219 days ago
        Why bother with v7 if this is active ?
        • codezero 1218 days ago
          I won’t give you a good reason :)

          Probably for nostalgia or a challenge or who knows what.

  • rootbear 1219 days ago
    This has been out for some years. I played with it a bit when it was first released and it was definitely a fun trip down memory lane. I'm sorry that the author hasn't continued to update it, it still had some rough edges, but I don't remember the details now.
  • phendrenad2 1219 days ago
    Interesting. I wonder what the license is (haven't downloaded the ISO yet and apparently it's on there).
    • kps 1219 days ago
      V7 is definitely covered by the Ancient UNIX License, and although there was for a while some doubt whether Caldera actually had the right to grant it, apparently¹ the current legal owner accepts its validity.

      ¹ https://www.betaarchive.com/forum/viewtopic.php?t=25745#p310...

    • TedDoesntTalk 1219 days ago
      He writes on the page, “Source code is available under a BSD-style license.”
  • rstuart4133 1218 days ago
    Given what we've seen of the M1, this may well be the last port of anything to x86.
  • 1MachineElf 1219 days ago
    Is the BCPL stuff on the bottom half of the page intended to work on his version of v7/x86?
    • Taniwha 1219 days ago
      I think it's unrelated - the BCPL tapes included the code you needed to port it and it was from around the same time - making it run on V7 is probably a couple of hundred lines of code for the VM interpreter used in porting
    • ta8645 1219 days ago
      It's really not clear why it appears without comment on the same page. My impression is that as a first step you would use BCPL to bring up a C compiler that targets a new machine, and then use it to port UNIX onto the new machine.
  • hedora 1219 days ago
    In case other case people are wondering about the license:

    https://www.nordier.com/v7x86/files/COPYRIGHT

    Tl;dr: all bsd-ish.