How to attach to physical memory

David F. Carlson dave at micropen
Thu Jul 28 22:07:37 AEST 1988


Why do smart mailers mess things up nearly 100% of the time?

> 
> How does one get access to a memory buffer that is hard wired to a
> physical memory location outside of the normal system memory?
> 
> Larry Williamson                      Focus Automation Systems
> UUCP: watmath!focsys!larry    608 Weber St. N, Waterloo, Ontario N2V 1K4
>                                           +1 519 746 4918
Larry,
First, there is no need for two devices.  vidbuf can contain both your
memory map and the ioctl interface to the registers.  Good coding practice
dicates an abstraction level from your physical registers to the actual
ioctl functions your define.

For 386 unix in the kernel:

char *sptalloc( int size /* in 4k pages */, int mode /* PG_P in immu.h */,
	int base /* physical address in 4k pages (ie << 12 ) */,
	int flag /* don't care for non-zero base */ )

void sptfree(vaddr, size, flag)  /* similarly to above */

alloc can be an init routine in the driver or on first open.  I have never
used free because I want the mapping to be for the lifetime of the kernel.

Good luck.


David F. Carlson, Micropen, Inc.
...!{ames|harvard|rutgers|topaz|...}!rochester!ur-valhalla!micropen!dave

"The faster I go, the behinder I get." --Lewis Carroll
-- 
David F. Carlson, Micropen, Inc.
...!{ames|harvard|rutgers|topaz|...}!rochester!ur-valhalla!micropen!dave

"The faster I go, the behinder I get." --Lewis Carroll



More information about the Comp.unix.microport mailing list