<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 1/17/24 10:20, Warren Toomey via
      TUHS wrote:<span style="white-space: pre-wrap">
</span><span style="white-space: pre-wrap">
</span></div>
    <blockquote type="cite" cite="mid:ZacdORuf7c5N2lqe@minnie.tuhs.org">
      <pre class="moz-quote-pre" wrap="">Does anybody know any more about PCS Unix and, if so, where should
I place the code that Holger has donated into the Unix Archive?</pre>
    </blockquote>
    <p>I should have attached the README that Holger provided. It's
      below!</p>
    <p>Cheers, Warren</p>
    <p><br>
    </p>
    <p>This is part 1 of the reverse engineered sources of the PCS
      Cadmus MUNIX-1.2 kernel (32bit)<br>
      which can be found on the IS0371 tapes (check FTP server of
      Computermuseum Stuttgart, Germany,<br>
      contact Klemens Krause).<br>
      <br>
      PCS was a German systems vendor in the 80s, located in Munich,
      hence "MUNIX": Munich Unix. They came up with <br>
      an AT&T base Unix for a QBUS-based (!) 68010 machine (later an
      68020) machine. The interesting feature of this <br>
      Unix derivation was the inclusion of the so called Newcastle
      connection which is an early multicomputer network <br>
      (similar to the later NFS) which like later SUN workstations
      allowed disk based as well es diskless hosts. <br>
      Newcastle connection uses an own raw Ethernet protocol; it
      implemented basic layer 2 stuff (ARP, ICMP) but did <br>
      not use TCP/IP. It is AFAIK documented here for the first time.<br>
      <br>
      The package includes the 32 bit 1.2 kernel from Jan, 1988,
      including all kernel support libraries as well as some<br>
      standard libs (libc, libm, etc).<br>
      There are also the rebuilt sources of the MINITOR boot monitor.<br>
      <br>
      To guarantee correctness of the rebuilt sources, I used the
      following process:<br>
      - I ignore describing the unpacking and conversion of the
      distribution tape - many files are CPIO archives, possibly<br>
        with some uninteresting byte-sex issues.<br>
      - The distribution contains a set of libraries (under /usr/src)
      that allow regenerating a new kernel. They are<br>
        plain AR files, without the standard .a extension. These were
      unpacked into the .o files of the kernel. MUNIX uses <br>
        COFF in an obscure incarnation - it uses the VAX magic, but
      internally contains 68K code. This is why well-known<br>
        IDA disassembler cannot handle this without some patching, but
      even after fixing the magic it has severe issues with<br>
        calculating .data and .bss addresses. This is why I wrote an own
      disassembler (pcsdis) and only used IDA for code<br>
        containing 68881 FP instructions (was to lazy to put them in -
      they are only used in libm.a anyway).<br>
      - With the knowledge of the include headers, it was possible to
      transform the disassembly output back into C code.<br>
        Fortunately, the PCC-based C compiler produces rather regular
      code.<br>
        Looking up similar sources from elsehere, like Bitsavers and
      Tuhs, I could identify the original parts from AT&T code<br>
        und find the modifications that PCS made to it. The whole I/O
      devices library was non-AT&T code, some of it resembled<br>
        PDP11 QBUS device handlers, but most of it was hard work to
      compare the driver code with DEC documentation<br>
        e.g. from Bitsavers.<br>
      - After having the regenerated source code, it was necessary to
      verify its correctness. I wrote, based on the 68K Musashi<br>
        emulator code, a syscall emulator (pcsrun) that translated the
      most important MUNIX syscalls (COFF loader, open, close, read,
      write, <br>
        fork, etc.) into corresponding OS calls, so that an original
      MUNIX executable like CC itself basically worked with files<br>
        from the underlying OS (in my case Windows, or Linux, resp.). It
      contains only the syscalls that the compiler/linker etc.<br>
        used, however, so it won't allow to try out network code. This
      way, I could run my C code through the original compiler<br>
        from the MUNIX distribution, and compare its output with the
      original binaries. This way I found numerous anachronisms<br>
        that resulted from some rather obscure type casts (which messed
      up register usage), as well as unused variables an even<br>
        several bugs that appear to come from sloppy adaption of
      original AT&T code to the platform. When trying to get the LD
      linker<br>
        to run, it turned out that this will work only after relaxing
      seg fault handling on NULL pointers - some strcmp(xxx,(char*)0)<br>
        were found in the code.<br>
      <br>
      - For reference, pcsdis and pcsrun are also included, however the
      code is ugly - they were just work horse for the purpose of<br>
        getting stuff done.<br>
      <br>
      Beyond references to unmodified AT&T copyrighted sources from
      elsewhere which were included for documentation where the code<br>
      came from, all files may be freely used.<br>
      <br>
      Holger Veit <a class="moz-txt-link-abbreviated" href="mailto:hveit01@web.de">hveit01@web.de</a> 26.7.2022<br>
      <br>
      <br>
    </p>
  </body>
</html>