• Stars
    star
    193
  • Rank 195,111 (Top 4 %)
  • Language
    C
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Restoration of 1st Edition UNIX kernel sources from Bell Laboratories

Restoration of 1st Edition UNIX from Bell Laboratories

Welcome to the 1st Edition UNIX repository. Here you will find the kernel source code and userland binaries which will allow you to run 1e UNIX on a PDP-11 simulator. It is a reconstructed UNIX as it was around 1972 instead of a true 1e UNIX image. There was a printout of the slightly post V1 kernel. And there was data recovered from DECtape from around V2 or V3.

The early versions of UNIX were epitomes of sophisticated concepts packaged into elegant systems. UNIX' influence has been so powerful that it reverberates down to affect us in the 21st century. The history of the development of UNIX has been well documented, and over the past decade or so, efforts have been made to find and conserve the software and documentation artifacts from the earliest period of UNIX history. The paper The Restoration of Early UNIX Artifacts written by Warren Toomey details the work that has been done to restore the artifacts from this time to working order and the lessons learned from this work.

Build Instructions

Unless otherwise noted, file and directory names refer to this repository.

Simply execute make. This will do several things. It will build tools/pdp11, tools/mkfs, tools/ml and tools/apout/apout. These tools are required to build the filesystems for 1e UNIX, and the kernel. It will create kernel sources with some necessary patches, assemble the kernel and build a bootable SIMH memory image which is installed into the images directory.

Finally, the make will build the rf0.dsk, rk0.dsk and tape images and install these in the images directory. You can also do a make clean to clean out the images/ and build/ directories. A make distclean will clean out the images/, build/ and tools/ directories accordingly.

Running 1st Edition UNIX

  1. Execute make run or ./simh.cfg, and you should see this:
PDP-11 simulator V4.0-0 Current        git commit id: fc5bda90
Disabling XQ
RF: buffering file in memory
TC0: 16b format, buffering file in memory
Listening on port 5555

You will receive a login: prompt:

  1. Type in root followed by RETURN key. You should receive a # prompt.

  2. Type in an ls -l command. You should see something like this:

total    6
 43 sdrwr-  2 root    620 Jan  1 00:00:00 bin
 42 sdrwr-  2 root    250 Jan  1 00:00:00 dev
104 sdrwr-  2 root    110 Jan  1 00:00:00 etc
114 sdrwr-  2 root     50 Jan  1 00:00:00 tmp
 41 sdrwr-  7 root     70 Jan  1 00:00:00 usr
  1. To change directories, use chdir, e.g. chdir /usr. The only editor installed is ed. You can check A Tutorial Introduction to the UNIX Text Editor for its usage.

  2. To log in multiple times, telnet to localhost port 5555. The system is configured to allow 8 remote logins.

  3. To shut the system down, press Ctrl-E to stop the simulator, and q to quit. You do not need to sync the system before shutdown.

Documentation

The manuals for 1st Edition UNIX are available here: https://www.bell-labs.com/usr/dmr/www/1stEdman.html, http://www.bitsavers.org/pdf/bellLabs/unix/UNIX_ProgrammersManual_Nov71.pdf, and http://man.cat-v.org/unix-1st/.

Some documentation of the internals of the 1st Edition UNIX are available here: http://www.bitsavers.org/pdf/bellLabs/unix/PreliminaryUnixImplementationDocument_Jun72.pdf

Details of the PDP-11/20 architecture and its peripherals can be found at: http://www.bitsavers.org/pdf/dec/pdp11/handbooks/PDP1120_Handbook_1972.pdf, and http://www.bitsavers.org/pdf/dec/pdp11/handbooks/PDP11_PeripheralsHbk_1972.pdf.

The C compiler from 2nd Edition UNIX is also installed and works, but the language is a very early dialect of C. The closest reference to the language at this point in time is this, but it is probably 2 years too late: https://www.bell-labs.com/usr/dmr/www/cman74.pdf

The userland binaries come from a period somewhere between the 1st and 2nd Edition of UNIX. You may find the 2e manuals useful too: http://www.bitsavers.org/pdf/bellLabs/unix/Unix_2nd_Edition_Manual_Jun72.pdf.

Repository Layout

  • pages/
  • patches/
    • patches to rebuilt/ files to get kernel to run
  • fs/
    • userland binaries and files, used to make rf0.dsk and rk0.dsk
  • src/
    • source code for userland: there is not much available
  • tools/
    • tools and scripts to build the kernel and filesystem
  • build/
    • build area: patched kernel files, patched filesystems
  • images/
    • final disk and tape images to be used by the SIMH simulator
  • notes/
    • notes on the work done to get 1e UNIX to run again

Related Projects

More Repositories

1

amacc

Small C Compiler generating ELF executable Arm architecture, supporting JIT execution
C
997
star
2

mini-arm-os

Build a minimal multi-tasking OS kernel for ARM from scratch
C
929
star
3

facebooc

Yet another Facebook clone written in C
C
553
star
4

MazuCC

A minimalist C compiler with x86_64 code generation
C
502
star
5

talks

schedule and materials about my presentations
338
star
6

nstack

Userspace TCP/IP stack for Linux
C
300
star
7

kernel-in-kernel

Develop your own OS kernel by reusing Linux infrastructure
C
171
star
8

min-dl

minimal dynamic linker implementation for ELF, supporting x86_64 and Arm/Aarch64
C
162
star
9

tetris

A text-mode tetris game
C
144
star
10

xv6-x86_64

re-implementation of UNIX v6 in ANSI C for x86_64 SMP
C
143
star
11

stm32f429-linux-builder

create a uClinux distribution for STM32f429 Discovery board
Makefile
133
star
12

full-stack-hello

minimal instruction set and assembler/compiler for "Hello World" execution
C
115
star
13

mazu-editor

a minimalist text editor with syntax highlight, copy/paste, and search
C
108
star
14

codezero

Codezero Microkernel
C
102
star
15

cregex

A small implementation of regular expression matching engine in C
C
80
star
16

tlsf-bsd

Two Level Segregated Fit (TLSF) memory allocator implementation, BSD License
C
74
star
17

simple-dvm

A simplified educational Dalvik virtual machine implementation
C
58
star
18

armv8-hello

Hello World for bare metal ARMv8 using QEMU
Makefile
51
star
19

lsd_slam

LSD-SLAM
C++
48
star
20

tinygl

TinyGL: a Small, Free and Fast Subset of OpenGL
C
44
star
21

ogc

A minimal mark-and-sweep garbage collector
C
43
star
22

x-compressor

A minimalist lossless data compressor
C
42
star
23

jit-construct

JIT compiler from scratch, derived from Nick Desaulniers' great work
Lua
37
star
24

svgirl

SVG Instant Rendering Library with focus on embedded systems
C
36
star
25

rv32jit

JIT-accelerated RISC-V instruction set simulator
C++
27
star
26

stm32f429-r3d

small software 3D rendering program on STM32F429-Discovery
C
26
star
27

ttt

An implementation of tic-tac-toe in C, featuring an AI powered by the negamax algorithm
C
25
star
28

kvm-user-x86

A simple userspace program to interact with Linux KVM
C
23
star
29

uThreads

A concurrent library based on cooperative scheduling of user-level threads(fibers) implemented in C++
C++
22
star
30

tvision

GCC/Linux port of Turbo Vision
C++
21
star
31

hungry-birds

classical example of concurrent producer/consumer problem
C
20
star
32

nalloc

structure aware memory allocator
C
19
star
33

stm32f429-lcd-demo

Simple STM32F429 Discovery LCD demo program using emWin library
C
18
star
34

jamvm

JamVM 2 + OpenJDK
C
18
star
35

littlefs-fuse

A FUSE wrapper that puts the littlefs in user-space
C
17
star
36

linsched

Restoration of The Linux Scheduler Simulator (LinSched)
C
16
star
37

stm32f429-demos

Collection of demo program for STM32F429 Discovery
Makefile
15
star
38

auto-tetris

Play Tetris game automatically!
C
15
star
39

skin-deep

Generate faces with smoother skin
C
14
star
40

matrix_oo

Object-oriented matrix implementation in C99
C
14
star
41

tic-tac-toe

An implementation of classical tic-tac-toe game for terminal I/O
C
12
star
42

dummy-driver

dummy Linux kernel module for education purpose
C
11
star
43

Taunix

Realtime operating system kernel for TI TMS320F24x DSP
C
11
star
44

MathEX

An embedded mathematical expression evaluator in C99
C
10
star
45

fizzbuzz

Implement Fizzbuzz without loop-internal conditionals, or arithmetic operators.
C
10
star
46

cjit

A tiny JIT compiler based on MIR
C++
9
star
47

anrmalloc

A new embedded-friendly memory allocator
C
9
star
48

arith_register

Use ELF linker set to construct lists of arithmetic implementations automatically
C
8
star
49

membroker

Memory Broker is a library that helps balance memory load between processes in user space using IPC
C
6
star
50

scalable-font-editor

A scalable font editor, which produces the fonts for embedded environments
C
5
star
51

bubble-sort-arm

Bubble sort in ARM assembly (incomplete)
Assembly
4
star
52

doxygen-oop-in-c

C
4
star
53

iota-whitepaper

IOTA whitepaper
TeX
4
star
54

git-hook-tests

Tests for Git Hooks
Shell
1
star
55

micronaut-from-scratch

Ahead-of-Time compilation with Micronaut and GraalVM
Java
1
star
56

ci-test-public

(TMP) A repository for testing CI pipeline
1
star