I've just checked in my latest tools/mkfs.c into the svn repository. Could
a few people eyeball it and look for errors. Even better, if you can eyeball
the working rf0.dsk image and compare it to an image made by my mkfs.c.
At present, I can make an rk0.dsk image with mkfs. I can run up a warm kernel
and try to mount the rk0 image as /usr, with my /tmp/a.out. But when I try
to chdir /usr, I get a Bad directory message.
So something is screwy with the rk0.dsk that my mkfs.c is making.
Thanks,
Warren
P.S typescript of warm boot:
:login: root
root
# check # check indicates rk0.dsk is OK
RF:
119 files
6 large
6 indirect
255 used
399 free
336 missing
RK:
43 files
0 large
0 indirect
2 used
4784 free
0 missing
# /tmp/a.out # I try to mount it
/dev/rk0# chdir /usr # but the chdir fails
Bad directory
# du /usr # du /usr shows no results
# df /usr # and df shows it is empty
0
# df # but df shows the free space on RF/RK
399+4784
> Confusingly, the 1e manual for /dev/rk0 says its an RK03. I'll have to go
> read the DEC manuals, but I would guess that the RK11 drive and interface is
> the same, but the RK03 and RK05 removable disk packs were of different
> storage capacity.
The controller is an RK11.
The disk drives are RK02, RK03, RK05.
The RK02 is a 1.2MB drive (256B per sector).
The RK03 is a 2.4MB drive (512B per sector).
The RK05 is a 2.4MB drive (512B per sector).
The media for the RK03 and RK05 are compatible (IBM 2315). The drives
look different from each other, but I don't think the system can tell
the difference.
James Markevitch
I looked through init briefly and the version from s2.tar.gz is
slightly different than the one in the pdf printout. In the printout
/dev/rk0 is mounted on /usr at boot time. In the s2 version the
string "/usr" is still present, but the call to mount is gone
and so is the "/dev/rk0" string.
The init source is fairly short and shouldn't be too hard to type
in or get from ocr. Has anyone yet worked through the details of
using the V7 compiler to make 0405 binaries? Also has anyone
successfully used a populated /usr on rk0 yet?
Tim Newsham
http://www.thenewsh.com/~newsham/
I wrote this:
exit = 1.
mount = 21.
sys mount; rk0; usr
sys exit
rk0: </dev/rk0\0>
usr: </usr\0>
And tried to assemble it with /bin/as, but it's a 407 exec and it didn't
work (core dump, created odd files)
So, I built it with apout & as like this:
apout /backup/raid2/pdp11/v7/bin/as ./mount.s
# reconsruct v1 0405 a.out header
echo -e '\005' >mount
dd if=a.out of=mount bs=1 skip=1 seek=1 count=11
dd if=a.out of=mount bs=1 skip=16 seek=12
And it runs, but nothing happens. I have not debugged it much. Wish we
had a working v1 as.
-brad
On Sat, May 03, 2008 at 08:16:19AM -0400, Brad Parker wrote:
> The simh setup was wrong; you need to use
>
> set rk0 enabled
> attach rk0 rk3.dsk
>
> Once I did that I could check the image I made with your program. I have
> not mounted it yet, however. It checks fine.
>
> Tim - where did you get the files you used to make your tape image? Can
> you tar up that directory and check it in? I can't find init anywhere.
> I must be confused.
On the s2 tape in /etc/init.
Thanks Brad.
Warren
> >There is a bug in the svn sources on page e09-07, near the bottom.
> >The call to sleep should read:
> >
> > jsr r0,sleep; 0:..
> >
> >Note that there should be a colon, not a semi-colon after the 0.
> >Presumably, this code was never executed, else it would have
> >resulted in a halt.
>
> thanks!
>
> but what *does* that syntax do? 0:.. ?
The two-instruction sequence is:
movb tty+3(r1),0f / put clist id in sleep argument
jsr r0,sleep; 0:..
The "0:" on the second line is a label and it is referenced by the "0f"
in the first line. The first line is putting a value into the argument
being passed to the sleep subroutine. Self-modifying code.
The ".." assembles to a 0.
With the incorrect code, "0" assembled to a 0 and ".." assembled to
a 0, so there was one extra word of zeroes, and the return from the
sleep would have executed it (halt) instead of the "br 1b" on the
next line.
James Markevitch
I downloaded the stuff from the svn, got it to build, then did a cmp -l
on the load file from my assembler vs. the one built from the svn tree.
There is a bug in the svn sources on page e09-07, near the bottom.
The call to sleep should read:
jsr r0,sleep; 0:..
Note that there should be a colon, not a semi-colon after the 0.
Presumably, this code was never executed, else it would have
resulted in a halt.
After I made that fix, a build from the svn tree is identical to that
from my assembler.
James Markevitch
I thought I would quickly make a list of commands we have, commands that
are missing, and out-of-the-ordinary commands. Below, if a command has
no comment, it's a V1 command that we have. Notes follow. I have not tried
to list the missing /etc and /usr/... commands yet.
/bin
----
: V2 cmd, 0405 binary
ar
as V2 binary
b missing
bas
bcd missing
boot missing
cal
cat
cc V2 binary
chball ? no idea
check
chmod
chown
cmp
cp
date
db
dbppt missing
dc
df
ds V2 binary
dsw
dtf missing
du
echo V2 cmd, 0405 binary
ed
exit V2 cmd, 0405 binary
fc V2 binary
find V2 binary
form
goto V2 cmd, 0405 binary
hup missing
if V2 cmd, 0405 binary
lbppt missing
ld V2 binary
ln
login V2 cmd, 0405 binary
ls
mail
maki V2 binary
mesg
mkdir
mkfs
mount
mv
nm V2 binary
od
pr
rew
rkd missing
rkf missing
rkl missing
rm
rmdir
roff
sdate missing
sh
size V2 binary
skip ? no idea
sort
stat
strip V2 binary
stty V2 cmd, 0405 binary
su
sum
tap
tm
tty
type
un V2 binary
wc
who
write
/etc
----
as2 V2 binary
getty V2 cmd, 0405 binary
glob
init
msh
suftab
uids
I have a quote from dmr somewhere (I can't find it), but to paraphrase:
early UNIX was under a constant state of development. We would tidy up
now and then, write a new manual, then get back to development.
The 1st Edition UNIX manual is dated November 3, 1971.
The 2nd Edition UNIX manual is dated June 12, 1972.
1st Edition (1e) only used 0405 a.out files. 2nd Edition (2e) only used
0407 a.out files. I would guess that the executables that we have from
the s2 tape are from a snapshot halfway between 1e and 2e, and at that
point in time the kernel could execute both varieties. This would explain
why some V2 commands are 0405 style, and some are 0407 style.
Despite the dates on the PDF commentary where we got the kernel source,
the kernel has to be around 1e, not much later. The kernel only knows
about 0405 a.out files, and is missing all of the system calls new to 2e:
hog, kill, makdir (renamed from 1e mkdir), smdate and sync.
So: kernel is around 1e, Nov 1971 or close; executables are somewhere
between 1e and 2e, but before June 1972 as we have 0405 and 0407 ones.
Cheers,
Warren
The tape I made earlier didnt properly preserve the permissions so
booting failed to exec /etc/init (had no exec bit set). I fixed
my tape builder to get the permissions from the old Readme file
and regenerated a tape..
The good news: login prompt!
I just built rf0 in the usual way, then rebuilt a warm kernel and
booted it.
Tim Newsham
http://www.thenewsh.com/~newsham/
Here's the current status on how to use the files:
- svn to the latest version
- install v7 binaries somewhere (ie /tmp/v7)
- install apout somewhere (ie /tmp/apout2.3alpha2)
- update paths in tools/assemv7
- compile tools/ml.c into tools/ml
- build simh's pdp11 emulator using brad's patches at
http://www.unlambda.com/download/pdp11/unix-jun72/KE.diff
install into tools/pdp11
- run ./tools/assemv7 to make files in build/*
- run ./simh.cfg to run the emulator
- type "go" to start it
- type "go" at the first halt to continue writing over your rf0 disk
- after waiting for a while, type control-e and then "det rf" and
then "quit"
- you should now have some data written over your rf0.dsk image.
Next steps:
- continue debugging the cold boot process. This should eventually
let us install a full root disk image from the kernel and a
tape construct with 1972_stuff s2 /bin and /etc files.
- get a working mkfs and use it to build and populate the rk03 disk
with the 1972_stuff s2 /usr files.
- continue debugging the kernel to boot the rf0 disk and mount the
rk03 disk on /usr.
Tim Newsham
http://www.thenewsh.com/~newsham/