Subject: Compilation of nsys kernel

From: Warren Toomey <wkt>
Date: Mon, 11 Jan 1999 10:47:02 +1100 (EST)

Dennis,
	I've managed to compile the nsys kernel source code using a
5th Edition environment. Changes to the src were:

nsys/user.h: change of struct declaration for v5 c compiler
	() at lines 17,20 -> {}

nsys/tty.h: missing ; on line 5 at end of struct clist

nsys/dmr/tty.c: v5 cc complained, I modified code to look like v5 tty.c code

206c206,207
<       if ((c=&0177)==004 && (rtp->t_flags&RAW)==0)
---
>       c=c&0177;
>       if (c==004 && (rtp->t_flags&RAW)==0)

nsys/ken/sig.c: had to modify a bit as v5 cc complained of expression syntax

<               suword(u.u_ar0[R6]=-2, u.u_ar0[RPS]);
<               suword(u.u_ar0[R6]=-2, u.u_ar0[R7]);
---
>               u.u_ar0[R6] = u.u_ar0[R6] - 2;
>               suword(u.u_ar0[R6], u.u_ar0[RPS]);
>               u.u_ar0[R6] = u.u_ar0[R6] - 2;
>               suword(u.u_ar0[R6], u.u_ar0[R7]);

nsys/ken/45.s: I've borrowed rsave and rretrn from v5 kernel, because v5 c
	compiler puts in rsave calls, and so I had to include this, and v3
	rretrn wasn't going to be compatible with v5 rsave.

320,324c320,338
< .globl retrn
< retrn:
<       mov     r5,sp
<       mov     (sp)+,r5
<       rts     pc
---
> .globl  rsave
> rsave:
>       mov     r5,r0
>       mov     sp,r5
>       mov     r4,-(sp)
>       mov     r3,-(sp)
>       mov     r2,-(sp)
>       sub     (r0)+,sp
>       jmp     (r0)
> .globl rretrn
> rretrn:
>       sub     $6,r5
>       mov     r5,sp
>       mov     (sp)+,r2
>       mov     (sp)+,r3
>       mov     (sp)+,r4
>       mov     (sp)+,r5
>       rts     pc

With these changes, I then did:
	cc -c -O ken/*.c, and   as all ken/*.s
	cc -c -O dmr/*.c, and   as all dmrken/*.s
	cc -c -O tables.c and   as junk/ustr.s

Finally:
	ld -X tables.o dmr/*.o ken/*.o
        junk/ustr
        strip a.out
        mv a.out unix

This results in: 

-rw-r--r--  1 root    26240 Jan 10 18:34 u
-rwxrwxrwx  1 root    26256 Jan 10 18:34 unix

where u is the kernel originally from the nsys archive, and unix is the
one just compiled above. I'll try booting them sometime this week,
again using a v5 filesystem and environment on an 11/45.

Cheers,
	Warren

---

From: [email-masked]
Date: Tue, 12 Jan 1999 00:12:26 -0500

Keys said (when I mentioned your tries)

 > Ohhh, neato!  Let us keep fingers crossed, knock on wood 3 times,
 > cow-tow as appropriate, rub the rabbit's foot, throw salt before
 > the sumo ring, .... and anything else?.....(:+}}....

 > Glad Warren is getting it there.   If it runs, it should be a real
 > treasure.