Fun with BSD 2.9 on a PDP-11/45

(For those who remember when a BIG disk was 10 Megabytes :)
(This page was created on Sept 9, 2001)


Notes on the PDP-11/45:
 
Introduced in June 1972. The KB11 was a microcoded 18 bit CPU built with SSI/MSI (Small/Medium Scale Integration) components. The machine had two different buses: one was a UNIBUS with 18-bit addressing, the other was a fast CPU-memory interconnect. It also introduced split I/D (Instruction/Data) spaces (UNIX used this; the DEC operating systems did not), an MMU (Memory Management Unit) option, and a optional FPU (Floating Point Unit). The maximal ammount of memory was 128 Kwords.

The cycle time of the /45 with bipolar memory (max. 8 KW!) was 300 ns, MOS memories (max. 32 KW) were 450 ns, and core was 980 ns - but without memory management! The MMU added 90 ns to the cycle time. 



First, boot the system:

: rl(0,0)rlunix

Berkeley UNIX (Rev. 2.9.1) Sun Nov 20 14:55:50 PST 1983
mem = 135872

CONFIGURE SYSTEM:
xp 0 csr 176700 vector 254 attached
rk 0 csr 177400 vector 220 attached
hk ? csr 177440 vector 210 skipped:  No CSR
rl 0 csr 174400 vector 160 attached
rp ? csr 176700 vector 254 interrupt vector already in use
ht 0 csr 172440 vector 224 skipped:  No CSR
tm 0 csr 172520 vector 224 attached
ts 0 csr 172520 vector 224 interrupt vector already in use
dh ? csr 160020 vector 370 skipped:  No CSR
dm ? csr 170500 vector 360 skipped:  No autoconfig routines
dz ? csr 160110 vector 320 skipped:  No CSR
dz ? csr 160110 vector 320 skipped:  No CSR
dn 0 csr 175200 vector 300 skipped:  No autoconfig routines
vp ? csr 177500 vector 174 skipped:  No autoconfig routines
lp 0 csr 177514 vector 200 attached
Erase=^?, kill=^U, intr=^C
#

Now, check the system:

# dmesg

Sep 9 10:48

Berkeley UNIX (Rev. 2.9.1) Sun Nov 20 14:55:50 PST 1983
mem = 135872
#

Cool, we have 135K of RAM!
Now, check disk space:

# df
Filesystem  Mounted on  kbytes    used    free  % used
/dev/rl0    /             8158    1922    6236     24%

Cool, we have 8M to work with, this is one of those new 10M RL disk!
Note, the ENTIRE OS only takes up 1.9M!

Here is a complete listing of all programs:
# pwd
/
# ls -R
.cshrc        READ_ME       genallsys.sh  mnt           tmp
.login        bin           hkunix        rkunix        unix
.msgsrc       boot          lib           rlunix        usr
.profile      dev           lost+found    rpunix        xpunix
2.9stamp      etc           mdec          swap

./bin:
#        cmp      e        icheck   mt       pstat    strip    vi
[        cp       echo     iostat   mv       pwd      stty     view
adb      csh      ed       kill     ncheck   ranlib   su       wc
ar       date     edit     l        newgrp   restor   sync     who
as       dcheck   ex       ld       nice     rm       tail     write
cat      dd       expr     ln       nm       rmail    tar      yes
cc       df       false    login    od       rmdir    tee
chgrp    diff     fgrep    ls       oldcsh   sh       test
chmod    du       file     mail     passwd   size     time
chown    dump     find     make     pr       sleep    touch
clri     dumpdir  grep     mkdir    ps       sort     true

./dev:
MAKE     rhk0a    rm0b     rrl1     rxp0b    tty02    ttyh5    xp0a
console  rhk0b    rm0c     rrm0a    rxp0c    tty03    ttyh6    xp0b
hk0a     rhk0c    rm0d     rrm0b    rxp0d    tty04    ttyh7    xp0c
hk0b     rhk0d    rm0e     rrm0c    rxp0e    tty05    ttyh8    xp0d
hk0c     rhk0g    rp0a     rrm0d    rxp0f    tty06    ttyh9    xp0e
hk0d     rhk0h    rp0b     rrm0e    rxp0g    tty07    ttyha    xp0f
hk0g     rk0      rp0c     rrp0a    rxp0h    ttyh0    ttyhb    xp0g
hk0h     rk1      rp0h     rrp0b    swap     ttyh1    ttyhc    xp0h
kmem     rl0      rrk0     rrp0c    tty      ttyh2    ttyhd
mem      rl1      rrk1     rrp0h    tty00    ttyh3    ttyhe
null     rm0a     rrl0     rxp0a    tty01    ttyh4    ttyhf

./dev/swap:
tab

./etc:
accton         fstab          mkfs           psdatabase     umount
admclean       fstab.sample   mklost+found   rc             update
autoconfig     getty          mknod          reboot         utmp
cron           group          motd           savecore       vipw
ddate          hostname       mount          shutdown       wall
dmesg          ident          mtab           termcap
dtab           init           passwd         ttys
fsck           localhostname  proto          ttytype

./lib:
as2          c2           f77_strings  fcrt0.o      libfpsim.a
c0           cpp          f77pass1     fmcrt0.o     libnonfpc.a
c1           crt0.o       fc1          libc.a

./lost+found:

./mdec:
hkuboot  hpuboot  rkuboot  rluboot  rmuboot  rpuboot

./mnt:

./tmp:

./usr:
#

Lets check out who has accounts on this machine:
# cat /etc/passwd
root::0:2:The Man:/:/bin/csh
toor::0:2:The Man:/:
daemon:***:1:1:The devil himself:/:
sys:***:2:1::/:
bin:***:3:1::/:
uucp::4:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
notes:***:5:1:Notesfiles maintainer:/usr/spool/notes:
anon:***:6:1:Notesfiles anonymous user:/usr/spool/notes:
news:***:7:1:News maintainer:/usr/spool/news:
wnj:ZDjXDBwXle2gc:8:2:Bill Joy,457E,7780:/a/guest/wnj:/bin/csh
dmr:AiInt5qKdjmHs:9:2:Dennis Ritchie:/a/guest/dmr:
ken:sq5UDrPlKj1nA:10:2:& Thompson:/a/guest/ken:
mike:KnKNwMkyCt8ZI:11:2:mike karels:/a/guest/mike:/bin/csh
carl:S2KiTfS3pH3kg:12:2:& Smith,508-21E,6258:/a/guest/carl:/bin/csh
joshua::999:2:&:/usr/games:/usr/games/wargames

WOW, Ken, Dennis, and Bill all use this machine!

Want to see the source code for cp (copy)?  Here it is:

# cat cp.c
/*
 * cp oldfile newfile
 */

main(argc,argv)
char **argv;
{
        int buf[256];
        int fold, fnew, n, ct, tell;
        char *p1, *p2, *bp;
        int mode;

        tell = 0;
        if(argc == 4 && argv[1][0] == '-' && argv[1][1] == 't') {
                argc--;
                argv++;
                tell = 1;
        }
        if(argc != 3) {
                write(1, "Usage: cp oldfile newfile\n", 26);
                exit(1);
        }
        if((fold = open(argv[1], 0)) < 0) {
                write(1, "Cannot open old file.\n", 22);
                exit(1);
        }
        fstat(fold, buf);
        mode = buf[2];
        if((fnew = creat(argv[2], mode)) < 0){
                stat(argv[2],  buf);
                if((buf[2] & 060000) == 040000) {
                        p1 = argv[1];
                        p2 = argv[2];
                        bp = buf;
                        while(*bp++ = *p2++);
                        bp[-1] = '/';
                        p2 = bp;
                        while(*bp = *p1++)
                                if(*bp++ == '/')
                                        bp = p2;
                        if((fnew = creat(buf, mode)) < 0) {
                                write(1, "Cannot creat new file.\n", 23);
                                exit(1);
                        }
                } else {
                        write(1, "Cannot creat new file.\n", 23);
                        exit(1);
                }
        }
        while(n = read(fold,  buf,  512)) {
        if(n < 0) {
                write(1, "Read error\n", 11);
                exit(1);
        } else
                if(write(fnew, buf, n) != n){
                        write(1, "Write error.\n", 13);
                        exit(1);
                }
                ct++;
        }
        if(tell) {
                conf(ct, 6, buf);
                buf[3] = '\n';
                write(1, buf, 7);
        }
        exit(0);
}

conf(n,width,buf)
        char    *buf;
{
        auto    i,a;

        i = width;
        while(i--)      buf[i] = ' ';

        buf[(a = n/10)?conf(a,--width,buf):--width] = n%10 + '0';

        return(++width);
}

Humm, not very well commented...

Hope you enjoyed my PDP/BSD page!
 


Copyright © 1993-2001 by Robert Barnes

Return to Unixhub's home page