[TUHS] unix v4 tape found
Angelo Papenhoff via TUHS
tuhs at tuhs.org
Tue Dec 23 23:31:26 AEST 2025
Quick update:
Since that mail i spent almost all of my time inside the UNIX kernel
trying to get nsys to work correctly. Putting in pipes was the easy bit,
but i've been banging my head against the wall for days now. Something
is leaking IO blocks so eventually the system gets stuck waiting for
bfreelist. My test case is 'cc -c *.c' in /usr/sys/ken.
Replacing bawrite and bdwrite with just plain bwrite gets me somewhat
further in that process but eventually i hit a 'panic: trap',
although it seems to be a bit non-deterministic. I even gotten into an
endless panic loop. The good thing is that in this case there seem to be
no bfreelist leaks at all so far.
So definitely asynch IO is not working correctly, and i suspect this is
related to synchronization bugs in the nsys code in general.
I also started de-registerifying the v4 kernel to be aesthetically more
similar to nsys. Perhaps the two approaches will somehow meet in the
middle.
Lots of frustration unfortunately, but on the other hand i never
understood the unix kernel as deeply as i do now.
At some point you *are* expected to understand this :)
cheers,
aap
On 20/12/25, Angelo Papenhoff via TUHS wrote:
> nice observations. Just a quick glance at numbers revealed around 4.1k
> lines of diffs between matching ken/*.c and dmr/*.c files between nsys and v4,
> and 1.1k between v4 and v5. Most changes are about the register keyword
> however, and prefixing these variables with 'r'. De-registerifying the v4
> kernel would allow for a fairer comparison to nsys. It would also be a
> good step towards adding pipe support into the nsys kernel, which it is
> unfortunately lacking. That would make it an actually usable complete UNIX
> kernel i believe.
>
> aap
>
> On 20/12/25, segaloco wrote:
> > On Friday, December 19th, 2025 at 17:53, Angelo Papenhoff via TUHS <tuhs at tuhs.org> wrote:
> >
> > > I extracted it: http://squoze.net/UNIX/v4/
> > >
> > > aap
> >
> > Some observations:
> >
> > - In this init(1), /etc/getty is called as the only member of a single
> > member array "com". In the current V5, /etc/getty is instead provided
> > as the only execution target for dfork. The V5 manual adds that a
> > line in /etc/ttys indicates the specifiable program in this array.
> > The V6 manual removes again this idea of /etc/getty being one of many
> > possible targets in a table, making this a more V5-ish init(1) than
> > the current V5 copy. Additionally, the V4 manual indicates that
> > init(1) still pulls TTYs from an internal table. This init(1) is
> > using /etc/ttys. Finally, utmp is still in /tmp in this tape, whereas
> > V6 sees it moved to /etc, as is the case in the current V5.
> >
> > - The copy of wc(1) present matches the V5 manual page in that it
> > includes a number of options.
> >
> > - Stty(1) here also is more V5-ish in that it does not implement the hup
> > options nor erase, kill, or ek.
> >
> > Just a few, but some areas marking this as matching V5 well. Probably
> > tail end of calling it "V4" at all.
> >
> > - Matt G.
> >
> > V4->V5 /usr/man diff - https://gitlab.com/segaloco/mandiff/-/compare/v4...v5?from_project_id=44843539
> > V5->V6 /usr/man diff - https://gitlab.com/segaloco/mandiff/-/compare/v5...v6?from_project_id=44843539
More information about the TUHS
mailing list