[comp.sys.m6809] Login and Tsmon

durham_2@husc4.HARVARD.EDU (peter durham) (07/07/87)

>By the way, I created a shell on /t1 with the command "shell i=/t1 &" since
>we don't have a login program with "Personal OS-9."  Just out of curiosity
>I tried running the Level I tsmon and login programs.  I once disassembled
>login and discovered that it changes the user id number by writing to an
>address in low memory using absolute addressing!!!  Needless to say this
>totally violates the OS-9 philosophy and creates an incredible security hole.
>(Well, who ever said OS-9 was very secure in the first place).  Of course, on
>Level II this hack doesn't work since even absolute addresses don't
>necessarily reference the same physical memory locations.  I don't know
>what it IS changing, but I don't intend to find out the hard way by leaving
>myself open to random system crashes.  I'm not sure exactly what tsmon
>does and whether it could have adverse effects.

Walt,
	Tsmon works fine on level II (though you may want to make one
teensy patch: change the parameter length given to the F$Fork call that
starts login from 0 to 1; the length of zero seems to confuse C programs,
so when I wrote a C version of login this caused interesting but harmless
things to happen; anyway this patch is very optional).
	Login will not, as you said, work on Level II.  What login does
is sneak into the direct page and directly change the "user number" or
"owner" field in its own process descriptor!  You will want to patch the
code that does this (since you have disassembled it it shouldn't be too
hard to find), replacing this hack with a real Level II F$SUser system
call.  This doesn't require too much changing (I think it's only a very
few bytes); unfortunately I don't have the patch with me (it's on CIS,
Delphi, and in Kev Darling's book).
	Hope this helps!
		Pete Durham

UNIX: durham_2@husc4.harvard.edu	COMPUSERVE: 73177,1215
      seismo!harvard!husc4!durham_2	DELPHI:     PEDXING
          ______
         / / / /
  Tandy / / / / Color Computer 3 and Microware's OS-9 Level II
       /_/_/_/