From: jay-tuhs9915
Are there any notes you can share on how to get to the
point you're at?
Well, there are three areas where the /03 version needs work, over the /05:
- No LTC clock register
- No switch register
- PS access only via MFPS/MTPS instructions
For the first two, the needed changes are identical to the ones detailed here:
http://gunkies.org/wiki/Running_UNIX_V6_on_an_-11/23
These have all been tested on the /23. Rather than anyone make the exact same
changes independently, I can put up the modified versions of the MiniUnix
files for them (low.s, main.c and param.h).
For the third, I have an mch.s with a conditional assembly flag that _should_
do it all; like I said, there are also really minor edits to bio.c, clock.c,
slp.c, and tty.c. Again, I can upload the mch.s which is already done.
I haven't been able to _confirm_ that these work, but it should be mostly good;
the changes are pretty straight-foward.
The code is doing a string comparison between the name
in the current
directory entry (u_dent) and the current pathname component (in
u_dbuf). The expression in brackets is the relative distance between the
two name fields within the u struct.
Yeah, I'd worked that out (the immediately preceding comment in the code -
"String compare the directory entry and the current component" - indicates
what it's doing, and as my "the term inside the []'s seems to be an offset
.. into the copy of the current directory entry" indicates, I'd worked out how
it did that. I was still puzzled by some othet aspects of the code, I just
included that to give a flavour of the code.
In what way does it fail? Is it simply that namei()
doesn't find the
file its looking for?
Right. It's looking for 'etc' in the root directory (only one block), and
it looks at the following entries:
9 146 '05mx'
8 130 'usr'
7 114 'tmp'
6 98 'mnt'
5 82 'lib'
(I put a printf() in the loop; I've added prf.c to the load so I can do
that. The numbers are the index, u.u_count - although it's already been
descremented at that point, so it will be '0' when doing the last entry - and
location of that entry in the directory, given next to it. For some reason, I
can't get the entry to print from u.u_dent.u_name, so I'm printing it straight
from the block buffer, bp->b_addr[]. I can print the _inode number_,
u.u_dent.u_ino as a string, but not the dir entry. Wierd.)
Anyway, after printing the entry for 5, it goes to 'done', with u_error
containing '2'. I can't see how it could do that.
I'm using printf() because I'm too lazy to figure out how to build a kernel
with a debugger like DDT included. (We never did that when we were working
on V6 at MIT BITD; ISR we mostly just used printf() back then, too.)
Noel