Physical memory access under Xenix

Chuck McManis cem at intelca.UUCP
Thu May 1 01:42:30 AEST 1986


> 
> 	I have been asked (nay, told) to write a device driver for
> 	IBM Xenix version 1.x for a bitmapped graphics device of the
> 	Tecmar Graphics Master genre.   This requires that I be able
> 	to rapidly access physical memory in the range A000:0000 to
> 	A000:FFFF in my pc's memory.   Unfortunately, the device
> 	driver documentation does not describe how one goes about
> 	this, and I have visions of tracing Xenix with a logic
> 	analyzer to locate the Local Descriptor table so I can crock a
> 	descriptor for my display buffer into it.   Can anyone save me
> 	from this evil fate by describing the obvious and elegant
> 	method that IBM has provided for doing this, but accidentally
> 	forgot to document?   Thanx in advance!
> 
> 			       _MelloN_-- 
> Ted Lemon
> Project GNU of the Free Software Foundation
> 

Yup, there are two system calls dscralloc() which allocates a descriptor
for you and mmudescr() which points it at a physical address. If you
have far keywords enabled you can do something like 

char far * foo;
unsigned select = dscralloc();

mmudescr(select,0xA0000,0xffff,0x92);
foo = (far *)(select << 16);
foo[offset] = data ;
etc

This will make foo essentially a 64K character array located absolutely
at physical address 0xa0000. Note you will have to be in Kernel mode to
do this stuff. And that the declaration for select should be global and
not local as this code fragment may seem to imply.

--Chuck
-- 
                                            - - - D I S C L A I M E R - - - 
{ihnp4,fortune}!dual\                     All opinions expressed herein are my
        {qantel,idi}-> !intelca!cem       own and not those of my employer, my
 {ucbvax,hao}!hplabs/                     friends, or my avocado plant. :-}



More information about the Comp.unix mailing list