Bell Labs had ported Unix V7 to the Interdata machine. This meant that Unix V7 was less bound to the PDP 11 architecture.
Unix V7 was delivered with the "Portable C Compiler" (pcc) . This compiler did use several passes and the codegeneration could be adapted for new architectures. The pcc compiler came with a code generator for the PDP 11 and with a rather limited documentation.
The first step was adapting the pcc compiler to generate MC68000 assembly code. In fact the very first step was writing an assembler for the MC68000. The assembler was written by D. Venken, de compiler by P. Verbaeten.
Testing assembler and compiler was a problem since in 1979 the MC68000 was not yet available. Only an evaluation board was avaliable:
The board had a prototype 68000, the XC68000. The XC68000 had all instructions of the MC68000 except for one,; an instruction to pass parameters between subroutines. Programs to be tested were downloaded over a serial line from the PDP. The output of the program under test came back over another serial line.
To easily manage the effect of compiler changes, a lot of test programs were written. Code generated for all these tests was compared using SCCS with the output from previous compiler runs.
Unix V7 assumed that the address of the "user structure" could be mapped to a fixed location by the "memory management unit" (mmu). Unfortunately the hardware of our target system (Exormacs) did not have a "memory management unit" in supervisor mode. Therefore it was decided to copy the user structure during process switches. This would make the process switch a more costly operation but this solution would make fewer changes to the Unix code necessary.
Since delivery of the Exormacs system was delayed, we decided to build a Unix system on the PDP 11/34 which did not use the MMU in supervisor mode (T. Vanderhaegen). This version did work end 1981.
The actual port was done by two last year students :
Since there was no device (e.g. no floppy) capable of exchanging information betweeen PDP and Exormacs a special disk driver was made on the Exormacs. This driver used a serial line to access a partition on the PDP disk. The difference between PDP and MC68000 byte addressing rpoved a major problem (UNIX ==> NUXI).
End 1982 we got the first shell prompt from Unix V7 on our Exormacs.
When receiving the first shell prompt, we had hoped that the major task was over, but a Unix system with only a shell is quite unusable. All programs from /bin/true and /bin/false up to the complete compilation system still had to be transported. This work was done by A. Ceulemans with occasional help from P. Verbaeten for compiler problems.
When building the compiler we had chosen to represent and int as a 16-bit value and a long as a 32-bit value. This choice made the size of an int different from the size of a pointer char *. While this was a logical choice for the MC68000 architecture, most Unix programs silently assumed sizeof(int) = seizeof(char *). A lot of our problems were caused by this assumption, but finally we had a system where these problems were solved.
Beside internal use on our Exormacs system, our Unix port was used to build a Unix with real-time extension. This was done in a IWONL project in cooperation with Macq Electronique and with the Unité d'Informatique van de Université Catholique de Louvain. Macq Electronique developped the hardware (this time with a suitable MMU), the department (J.Huens) did port Unix to this hardware (first Unix V7 later Unix System V) and the Unité d'Informatique took care of the real-time extensions.
This system was used by Macq Electronique to control the traffic tunnels in Brussels
|
Copyright ©1997, Katholieke Universiteit Leuven, Departement Computerwetenschappen Comments to: Curator URL of this page: http://www.cs.kuleuven.be/museum/mc68000/unix-ove-E.html |