[comp.os.vms] PFN Mapping

pstevens@pioneer.arpa (Paul Stevens RCE Sterling) (07/15/87)

	I have a question about mapping I/O space using $CRMPSC.  I am using
the SEC$M_PFNMAP qualifier to map the PFN's associated with some device
registers, and let me preface this by saying that I have gotten it to work.
One of the parameters that I pass to $CRMPSC seems to be sort of 'magic'
though.  I use the SEC$M_EXPREG to map the range into the first available
address in my process virtual address space and the system service manual 
says that in this case the array INADR will determine only if the mapping
will be to P0 or to P1 space, it does not say *how* it will determine this!
By looking at an example in SYS$EXAMPLES of a BLISS program which does PFN
mapping I learned that the magic number of 200 seems to do the trick.
My question is why? and how do you get it to map to P1 space, though I don't
see why you would ever want to do that.
	If you want to email to me I will post a final answer, however, I
am new to the net and can't really give a known path by which to reach me.
	Thanks for any info
		P. Stevens
	        (415)-694-4887

KVC@ENGVAX.SCG.HAC.COM (Kevin Carosso) (07/17/87)

> though.  I use the SEC$M_EXPREG to map the range into the first available
> address in my process virtual address space and the system service manual
> says that in this case the array INADR will determine only if the mapping
> will be to P0 or to P1 space, it does not say *how* it will determine this!
> By looking at an example in SYS$EXAMPLES of a BLISS program which does PFN
> mapping I learned that the magic number of 200 seems to do the trick.
> My question is why? and how do you get it to map to P1 space, though I don't
> see why you would ever want to do that.

It determines from the addresses you put in INADR whether to map into P0 or
P1.  200 is (by default) the first page of P0 (your lowest accessible
virtual address, page 0 which would have VA's 0 through 1FF is not mapped
to catch things like nil pointer references).  If you put any P0 address
into INADR it will map to P0 space.  If you put any P1 address into INADR it
will map to P1 space.  P1 space is virtual addresses 40000000 through
7FFFFFFF.  P0 is 00000000 through 3FFFFFFF.

        /Kevin Carosso                     kvc@engvax.scg.hac.com
         Hughes Aircraft Co.               kvc%engvax@oberon.usc.edu

"James_A._Gray.OsbuSouth"@XEROX.COM (07/19/87)

To get it to map to P1 space, you must pass it a P1 address, i.e.
between 40000000 and 7FFFFFFF.  For P0 space between 00000000 and
3FFFFFFF.

A thought just occured to me.  What happens if you pass it a system
space address (80000000 - BFFFFFFF) or the not really defined S1 space
of CFFFFFFF - FFFFFFFF?  Humm.  I guess I'll have to look into that one
unless someone else has already.

	Jim