[net.unix] Physical memory access under Xenix

cem@intelca.UUCP (Chuck McManis) (04/30/86)

> 
> 	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. :-}

mellon@mit-prep.ARPA (Ted Lemonmellon/.name) (05/07/86)

> 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 

First of all, thanks for responding.   I received some really good
suggestions, of which the above was the cleanest.   Unfortunately, the
IBM version of Xenix does not have a symbol _dscralloc(), while the
SCO version does.   Does anybody know if there is an equivalent
function in the IBM version of Xenix, or do I need to use John
Little's method of hacking a (hopefully) unused entry in the GDT?

When this is over and I have made a driver for IBM Xenix and SCO
Xenix, I will post a summary of how I did it...   For now, I am going
to hack the GDT...

			       _MelloN_-- 
Ted Lemon
Project GNU of the Free Software Foundation

UUCP:       {}!mit-eddie!mit-prep!mellon
INTERNET:   mellon@prep.ai.mit.edu
ORGANIZATION: Project GNU, Free Software Foundation,
   1000 Mass. Ave., Cambridge, MA  02138, USA +1 (617) 876-3296
HOME: 18 Kennedy Drive, North Chelmsford, Massachusetts