+2:
+ mov (sp)+,r1 / restore 'x to r1
+ mov (r1)+,r0 / move it to r0
+ movb r0,ttyx+8 / get correct ttyx
+ movb r0,zero+8 / move identifier to output buffer
+ jsr pc,wtmprec / go to write accting into
+ jsr pc,dfork / fork
+ mov r0,(r1)+ / save id of child
+ br 1b / go to wait for next process end
+
+dfork:
+ mov r1,r2
+ sub $itab+2,r2 / left over
+ asl r2 / from previous
+ asl r2 / version of code
+ mov r2,offset
+ sys fork
+ br 1f / to new copy of init
+ bes dfork / try again
+ rts pc / return
+1 :
+ sys quit; 0 / new init turns off
+ sys intr; 0 / interrupts
+ sys chown; ttyx; 0 / change owner to super user
+ sys chmod; ttyx; 15 / changemode to read/write owner,
+ / write non-owner
+ sys open; ttyx; 0 / open this ttyx for reading
+ / and wait until someone calls
+ bes help1 / branch if trouble
+ sys open; ttyx; 1 / open this ttyx for writing after
+ / user call
+ bes help1 / branch if trouble
+ sys exec; getty; gettyp / getty types <login> and
+ / executes login which logs user
+ / in and executes sh-
+ sys exit / HELP!
+
+help1:
+ jmp help / trouble
+
+wtmprec:
+ sys time / get time
+ mov ac,zero+10. / more to output
+ mov mq,zero+12. / buffer
+ sys open; wtmp; 1 / open accounting file
+ bes 2f
+ mov r0,r2 / save file descriptor
+ sys seek; 0; 2 / move pointer to end of file
+ mov r2,r0 / not required
+ sys write; zero; 16. / write accting info
+ mov r2,r0 / restore file descriptor
+ sys close / close file
+2:
+ rts pc