Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!oberon!cit-vax!elroy!ames!ucbcad!ucbvax!YALE.ARPA!LEICHTER-JERRY
From: LEICHTER-JERRY@YALE.ARPA
Newsgroups: comp.os.vms
Subject: Re: Help with a Kernal mode macro program
Message-ID: <8707110215.AA28319@ucbvax.Berkeley.EDU>
Date: Fri, 10-Jul-87 22:15:24 EDT
Article-I.D.: ucbvax.8707110215.AA28319
Posted: Fri Jul 10 22:15:24 1987
Date-Received: Sun, 12-Jul-87 14:10:53 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: 
Distribution: world
Organization: The ARPA Internet
Lines: 34


    
     Greetings,
            I am trying to modify FINGER to go out and get the Server and Port
     name from the UCB blocks for the LAT device, we are using LAT-Plus.  I
     have below the code that I use, the problem I am having is that the MOVC3
     statement in the Kernal Mode code, crashes the system every time I run
     it....

            .entry  latinfkrn,^M
	...
            movc3   port_len, srv_info_port(r8), (r6)

movc3 modifies registers r0-r5.  r0-r1 are not a problem unless your code
uses them (I didn't look at it that closely), but you MUST save r2-r5 in
your entry mask (or save/restore them yourself, if that's preferable for
some reason).

BTW, it's not clear to me that locking the pages involved in the working set
is sufficient for your purposes; you have to be sure they are in memory before
they are accessed.  I don't know for certain, but I suspect $LKWSET will
simply start the paging going - I don't think it will necessarily wait for
it to complete.

The usual technique, if all the code fits in no more than two pages, is to
place the IPL you are setting in memory at the end of the code.  The instruc-
tion that sets the IPL is then itself guaranteed to be in memory, and it
is certain to fault in the page containing the IPL.  While at elevated IPL,
neither page will fault out.  (This can, of course, fail horribly if the
SETIPL and the IPL itself get more than 2 pages apart, as there can then be
a "hole" between the two.)  If you do this, the $LKWSET is redundant.

							-- Jerry
-------