diff --git a/build/Makefile b/build/Makefile index f39a5d5..9be34e9 100644 --- a/build/Makefile +++ b/build/Makefile @@ -22,16 +22,29 @@ BINARIES=../binaries/ all: cmd others a.rim image.fs copybinaries +# Make alternative everything: no dd but . and .. +alt: altcmd altothers alta.rim altimage.fs + # The run rule has no dependencies so that the system can be booted easily # and frequently with make run. However, you have to manually make all first! run: $(PDP7) unixv0.simh +# Alternative run, use the altimage.fs +altrun: + $(PDP7) altunixv0.simh + # Warm boot Unix kernel: boots into init and a login prompt a.rim: $(AS) -f rim -o a.rim $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s $(AS) -n -f list -o a.lst $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s +# Alternative kernel: no dd, but . and .. +alta.rim: + $(AS) -f rim -o alta.rim -DNO_DD $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s + $(AS) -n -f list -o alta.lst -DNO_DD $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s + + # Cold boot Unix kernel: attempts to build a minimal filesystem. # Don't use this one! coldboot: @@ -40,16 +53,22 @@ coldboot: # Filesystem image image.fs: cmd others - $(MKFS) --format simh proto + $(MKFS) proto $(FSCK) image.fs +# Alternate filesystem image: . and .. but no dd +altimage.fs: altcmd altothers + $(MKFS) -1 -2 -3 -o altimage.fs altproto + $(FSCK) -3 altimage.fs + + copybinaries: mkdir -p $(BINARIES) cp image.fs $(BINARIES) cp a.rim $(BINARIES) clean: - rm -f a.rim image.fs a.lst n.out + rm -f a.rim image.fs a.lst n.out altimage.fs alta.rim alta.lst rm -rf $(BINDIR) rm -rf $(TESTDIR) rm -rf $(BINARIES) @@ -62,6 +81,11 @@ cmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \ $(BINDIR)/chown $(BINDIR)/chrm $(BINDIR)/cp $(BINDIR)/ds $(BINDIR)/ed \ $(BINDIR)/init +# Alternate commands: no dd, but . and .. +altcmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \ + $(BINDIR)/chown $(BINDIR)/altchrm $(BINDIR)/cp $(BINDIR)/ds $(BINDIR)/ed \ + $(BINDIR)/altinit + $(BINDIR)/as: $(CMDSRC)/as.s $(AS) $(ASARGS) -o $(BINDIR)/as $(CMDSRC)/as.s @@ -80,6 +104,9 @@ $(BINDIR)/chown: $(CMDSRC)/chown.s $(BINDIR)/chrm: $(CMDSRC)/chrm.s $(AS) $(ASARGS) -o $(BINDIR)/chrm $(CMDSRC)/chrm.s +$(BINDIR)/altchrm: $(OTHERSRC)/wktchrm.s + $(AS) $(ASARGS) -o $(BINDIR)/altchrm -DNO_DD $(OTHERSRC)/wktchrm.s + $(BINDIR)/cp: $(CMDSRC)/cp.s $(AS) $(ASARGS) -o $(BINDIR)/cp $(CMDSRC)/cp.s @@ -92,10 +119,19 @@ $(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s $(BINDIR)/init: $(CMDSRC)/init.s $(AS) $(ASARGS) -o $(BINDIR)/init $(CMDSRC)/init.s +# Alternative init: no dd directory +$(BINDIR)/altinit: $(CMDSRC)/init.s + $(AS) $(ASARGS) -DNO_DD -o $(BINDIR)/altinit $(CMDSRC)/init.s + # The commands that did not come from the scans others: dirs $(BINDIR)/sh $(BINDIR)/wktcat $(BINDIR)/wktcp $(BINDIR)/date \ $(BINDIR)/ln $(BINDIR)/ls $(BINDIR)/mv $(BINDIR)/stat +# Alternative other commands: no dd, but . and .. +altothers: dirs $(BINDIR)/sh $(BINDIR)/wktcat $(BINDIR)/wktcp $(BINDIR)/date \ + $(BINDIR)/ln $(BINDIR)/altls $(BINDIR)/mv $(BINDIR)/stat + + $(BINDIR)/sh: $(OTHERSRC)/pbsh.s $(AS) $(ASARGS) -o $(BINDIR)/sh $(OTHERSRC)/pbsh.s @@ -114,6 +150,9 @@ $(BINDIR)/ln: $(OTHERSRC)/wktln.s $(BINDIR)/ls: $(OTHERSRC)/wktls.s $(AS) $(ASARGS) -o $(BINDIR)/ls $(OTHERSRC)/wktls.s +$(BINDIR)/altls: $(OTHERSRC)/wktls.s + $(AS) $(ASARGS) -o $(BINDIR)/altls -DNO_DD $(OTHERSRC)/wktls.s + $(BINDIR)/mv: $(OTHERSRC)/wktmv.s $(AS) $(ASARGS) -o $(BINDIR)/mv $(OTHERSRC)/wktmv.s diff --git a/build/altproto b/build/altproto new file mode 100644 index 0000000..38e8733 --- /dev/null +++ b/build/altproto @@ -0,0 +1,47 @@ +# Alternative prototype file for PDP-7 Unix filesystem layout +# +# This one has . and .. but no dd directory entries +# +# Entries are one of: +# filename f[r-][w-][r-][w-] uid local_file_to_insert +# dirname d[r-][w-][r-][w-] uid [inumber] +# device i[r-][w-][r-][w-] uid inumber +# link l---- inumber +# +# The top directory's name is ignored +# Numeric values are in decimal +# Contents of each directory ends with a $ on a line by itself +# Format was inspired by 6th Edition mkfs +# +/ drwr- -1 2 + system drwr- -1 3 + ttyin irwr- -1 6 + keyboard irwr- -1 7 + pptin irwr- -1 8 + 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/altchrm + cp frwr- -1 bin/cp + date frwr- -1 bin/date + ds frwr- -1 bin/ds + ed frwr- -1 bin/ed + init frwr- -1 bin/altinit + ln frwr- -1 bin/ln + ls frwr- -1 bin/altls + 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 fs/hello + $ + dmr drwr- 12 + system l---- 3 + $ diff --git a/build/altunixv0.simh b/build/altunixv0.simh new file mode 100644 index 0000000..1fc7457 --- /dev/null +++ b/build/altunixv0.simh @@ -0,0 +1,12 @@ +set cpu 8k +set cpu eae +set cpu history=100 +show cpu + +set tti unix +set rb ena +att rb altimage.fs +show dev + +load -S alta.rim +dep pc 0100 diff --git a/src/cmd/init.s b/src/cmd/init.s index ec92b3c..e5f3265 100644 --- a/src/cmd/init.s +++ b/src/cmd/init.s @@ -124,8 +124,12 @@ login: 2: lac nchar sys setuid " Set the user's user-id - sys chdir; dd " and change into the "dd" directory - sys chdir; dir +#ifdef NO_DD + sys chdir; dotdot " Change into the root directory (out of system) +#else + sys chdir; dd " Change into the "dd" directory +#endif + sys chdir; dir " and then the user's home directory lac d2 " Close file descriptor 2 sys close @@ -249,6 +253,8 @@ m3: m3s = .-m3 dd: