diff --git a/.gitignore b/.gitignore index 7a67ce5..fdd1ee7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ build/a.lst build/a.rim build/image.fs +build/bin +build/n.out diff --git a/Makefile b/Makefile index 0913396..96837ec 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,11 @@ -# Top level makefile to build the tests and everything else -AS=tools/as7 -ASARGS=--format=ptr -TESTDIR=tests -all: buildit testit +all: buildit buildit: - cd build && make + cd build && make all -runsh: all - cd bin && ../tools/a7out sh - -testit: - mkdir -p $(TESTDIR) - $(AS) $(ASARGS) -o $(TESTDIR)/decimal_out src/tests/decimal_out.s - $(AS) $(ASARGS) -o $(TESTDIR)/fork_test src/tests/fork_test.s - $(AS) $(ASARGS) -o $(TESTDIR)/octal_test src/tests/octal_test.s - $(AS) $(ASARGS) -o $(TESTDIR)/testmul src/tests/testmul.s - $(AS) $(ASARGS) -o $(TESTDIR)/write_test src/tests/write_test.s - -runtests: tests - cd tests && ../tools/a7out decimal_out - cd tests && ../tools/a7out fork_test - cd tests && ../tools/a7out octal_test -# cd tests && ../tools/a7out testmul -# cd tests && ../tools/a7out write_test +run: + cd build && make run clean: - rm -rf $(TESTDIR)/* cd build && make clean diff --git a/README.md b/README.md index ec81851..276464f 100644 --- a/README.md +++ b/README.md @@ -25,19 +25,92 @@ system fully up on a PDP-7 system, fix any bugs and document everything. We have a [real PDP-7](http://physics.uoregon.edu/outreach/movies/pdplives/) and [SimH](http://simh.trailing-edge.com/) as target platforms. +## Running pdp7-unix + +You will need [simh](http://simh.trailing-edge.com/) 4.0 to run pdp7-unix. You can get the source code [here](https://github.com/simh/simh). To compile it: + +`make pdp7` + +to run pdp-unix from the pdp7-unix source tree + +`make run` + +Press `ctl-e` to break out the simulator into simh + +A typical pdp7-unix on simh looks like: + +
+pdp7 unixv0.simh
+
+PDP-7 simulator V4.0-0 Beta        git commit id: e153b7f2
+CPU	idle disabled
+	8192W, EAE
+RB: buffering file in memory
+PDP-7 simulator configuration
+
+CPU	idle disabled
+CLK	60Hz, devno=00
+PTR	devno=01
+PTP	devno=02
+TTI	devno=03
+TTO	devno=04
+LPT	devno=65-66
+DRM	disabled
+RB	devno=71
+DT	devno=75-76, 8 units
+
+login: ken
+password: ken
+@ ln dd ken .
+@ ls
+dd      
+system  
+hello   
+.       
+@ ls system
+dd      
+ttyin   
+keyboard
+pptin   
+ttyout  
+display 
+pptout  
+as      
+cat     
+chmod   
+chown   
+chrm    
+cp      
+date    
+ds      
+ed      
+init    
+ln      
+ls      
+mv      
+password
+sh      
+stat    
+@ cat hello
+Hello, world
+@ 
+
+ + ## Source Tree The code in the original scans are (c) Novell who own the rights to the Unix source code. Everything that didn't come from the scanned files is GPLv3. +* /build is an area to build the kernel & filesystem and run them +* /man holds man pages +* /misc holds miscellaneous notes and information * /scans holds the unmodified OCR versions of the scanned files * /src/cmd holds the modified source code of the user-mode programs * /src/sys holds the modified source code of the kernel * /src/other holds PDP-7 source code which did not come from the scanned files * /tools holds the source for the tools written to assist the project -* /build is an area to build the kernel & filesystem and run them -* /misc holds miscellaneous notes and information -* /pdp7parse holds a Java parser for pdp7 source code + ## Travis Status diff --git a/build/Makefile b/build/Makefile index 0d31b31..2d2f8e8 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,19 +1,29 @@ # Build the kernel, the utilities, the filesystem and run SimH +# tools AS=../tools/as7 ASARGS=--format=ptr MKFS=../tools/mkfs7 +A7OUT=../tools/a7out +FSCK=../tools/fsck7 +PDP7=pdp7 +# source dirs SYSSRC=../src/sys CMDSRC=../src/cmd OTHERSRC=../src/other -BINDIR=../bin +TESTSRC=../src/tests -all: cmd others a.rim image.fs +# targets +BINDIR=bin +TESTDIR=tests +IMAGEFILE=image.fs + +all: cmd others a.rim image # Manually make all before make run -run: - pdp7 unixv0.simh +run: clean all + $(PDP7) unixv0.simh a.rim: $(AS) -f rim -o a.rim $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s @@ -23,11 +33,14 @@ coldboot: $(AS) -f rim -o a.rim $(SYSSRC)/sop.s $(SYSSRC)/s[1-9].s $(AS) -n -f list -o a.lst $(SYSSRC)/sop.s $(SYSSRC)/s[1-9].s -image.fs: +image: $(MKFS) --format simh proto + $(FSCK) $(IMAGEFILE) clean: - rm -f a.rim image.fs a.lst n.out $(BINDIR)/* + rm -f a.rim $(IMAGEFILE) a.lst n.out + rm -rf $(BINDIR) + rm -rf $(TESTDIR) dirs: mkdir -p $(BINDIR) @@ -55,6 +68,8 @@ cmd: dirs # $(AS) $(ASARGS) -o $(BINDIR)/dsw $(CMDSRC)/dsw.s $(AS) $(ASARGS) -o $(BINDIR)/ed $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s $(AS) $(ASARGS) -o $(BINDIR)/init $(CMDSRC)/init.s + $(AS) $(ASARGS) -o $(BINDIR)/maksys $(CMDSRC)/maksys.s + $(AS) $(ASARGS) -o $(BINDIR)/trysys $(CMDSRC)/trysys.s others: dirs $(AS) $(ASARGS) -o $(BINDIR)/sh $(OTHERSRC)/pbsh.s @@ -63,6 +78,22 @@ others: dirs $(AS) $(ASARGS) -o $(BINDIR)/wktcp $(OTHERSRC)/wktcp.s $(AS) $(ASARGS) -o $(BINDIR)/date $(OTHERSRC)/wktdate.s $(AS) $(ASARGS) -o $(BINDIR)/ln $(OTHERSRC)/wktln.s - $(AS) $(ASARGS) -o $(BINDIR)/ls $(OTHERSRC)/wktls.s $(AS) $(ASARGS) -o $(BINDIR)/mv $(OTHERSRC)/wktmv.s $(AS) $(ASARGS) -o $(BINDIR)/stat $(OTHERSRC)/wktstat.s + +tests: + mkdir -p $(TESTDIR) + $(AS) $(ASARGS) -o $(TESTDIR)/decimal_out $(TESTSRC)/decimal_out.s + $(AS) $(ASARGS) -o $(TESTDIR)/fork_test $(TESTSRC)/fork_test.s + $(AS) $(ASARGS) -o $(TESTDIR)/octal_test $(TESTSRC)/octal_test.s + $(AS) $(ASARGS) -o $(TESTDIR)/testmul $(TESTSRC)/testmul.s + $(AS) $(ASARGS) -o $(TESTDIR)/write_test $(TESTSRC)/write_test.s + +runtests: tests + $(A7OUT) $(TESTDIR)/decimal_out + $(A7OUT) $(TESTDIR)/fork_test + $(A7OUT) $(TESTDIR)/octal_test +# $(A7OUT) $(TESTDIR)/testmul +# $(A7OUT) $(TESTDIR)/write_test + + diff --git a/build/hello b/build/fs/hello similarity index 100% rename from build/hello rename to build/fs/hello diff --git a/build/password b/build/fs/password similarity index 100% rename from build/password rename to build/fs/password diff --git a/build/proto b/build/proto index a4f4bef..2d90dbc 100644 --- a/build/proto +++ b/build/proto @@ -19,26 +19,26 @@ dd drwr- -1 4 ttyout irwr- -1 11 display irwr- -1 12 pptout irwr- -1 13 - as frwr- -1 ../bin/as - cat frwr- -1 ../bin/cat - chmod frwr- -1 ../bin/chmod - chown frwr- -1 ../bin/chown - chrm frwr- -1 ../bin/chrm - cp frwr- -1 ../bin/cp - date frwr- -1 ../bin/date - ds frwr- -1 ../bin/ds - ed frwr- -1 ../bin/ed - init frwr- -1 ../bin/init - ln frwr- -1 ../bin/ln - ls frwr- -1 ../bin/ls - mv frwr- -1 ../bin/mv - password frw-- -1 password - sh frwr- -1 ../bin/sh - stat frwr- -1 ../bin/stat + as frwr- -1 bin/as + cat frwr- -1 bin/cat + chmod frwr- -1 bin/chmod + chown frwr- -1 bin/chown + chrm frwr- -1 bin/chrm + cp frwr- -1 bin/cp + date frwr- -1 bin/date + ds frwr- -1 bin/ds + ed frwr- -1 bin/ed + init frwr- -1 bin/init + ln frwr- -1 bin/ln + ls frwr- -1 bin/ls + mv frwr- -1 bin/mv + password frw-- -1 fs/password + sh frwr- -1 bin/sh + stat frwr- -1 bin/stat $ ken drwr- 10 system l---- 3 - hello frwr- 10 hello + hello frwr- 10 fs/hello $ dmr drwr- 12 system l---- 3