[comp.unix.wizards] Microport Sys V. r. 3 for 80386 machines

WADE%VTSDA.BITNET@CUNYVM.CU ( GIPSY Manager ) (12/21/87)

Does anybody out there know how to access particular *REAL* physical addresses
using the microport UNIX for the 80386 machines ?  A guy at Microport told it
that it wasnt possible, but I just can't believe they would do this.  Any
ideas anybody ?

Michael Wade, Spatial Data Analysis Lab.  Virginia Tech.   WADE@VTOPUS.CS.VT.EDU

bhj@bhjat.UUCP (Burt Janz) (12/25/87)

In article <10928@brl-adm.ARPA>, WADE%VTSDA.BITNET@CUNYVM.CU ( GIPSY Manager ) writes:
> Does anybody out there know how to access particular *REAL* physical addresses
> using the microport UNIX for the 80386 machines ?  A guy at Microport told it

Try creating a shared memory segment at the address indicated.  I've used this
method before to directly map the registers on my EGA card.

Burt Janz
..decvax!bhjat!bhj

dean@uport.UUCP (Dean Thomas) (12/30/87)

In article <10928@brl-adm.ARPA>, WADE%VTSDA.BITNET@CUNYVM.CU ( GIPSY Manager ) writes:
> Does anybody out there know how to access particular *REAL* physical addresses
> using the microport UNIX for the 80386 machines ?  A guy at Microport told it
> that it wasnt possible, but I just can't believe they would do this.  Any
> ideas anybody ?

Sure you can! At least from the KERNEL, NOT from a user space.
Microport System V/386 is based on the AT&T SVR3 for the 386 tape. This routine
will work with any UNIX similarly derived. Who told you this wasn't possible?
Support knows about this and I've made sure that they will spread the
right info. This note is now going out with the release notes, too.

Mapping physical addresses to kernel virtual addresses

The kernel functions sptalloc() and sptfree() map and unmap physical addresses
to kernel virtual addresses. This is often required to control devices that
use a memory mapped control or data space.

char *
sptalloc(size,mode,base,flag)
int size, mode, base, flag;

	Size is the size of the region to be mapped in, in units
	of 4096 bytes.

	Mode is the 386 hardware mode that the logical pages are
	to be assigned to. It should be PG_P, defined in the include
	file "sys/immu.h".

	Base is the address of the memory to be mapped, in
	units of 4096 bytes. This is the linear address devided
	by 4096. This should not be a segment offset address!
	If base is 0 the physical memory is allocated from
	the system memory map.

	Flag is used only when base is 0, and if set to
	NOSLEEP (defined in "sys/immu.h") will prevent the
	function from "sleep"ing to wait for memory to become
	free.

	sptalloc() returns the kernel logical address that has
	been mapped to the physical addresses. It returns NULL
	if it fails.

sptfree(vaddr, size, flag)
int size, flag;
char *vaddr;
	
	This unmaps the memory mapped by sptalloc().

	Vaddr is the address returned from sptalloc().

	Size is the size of the mapped unit, in units of
	4096 bytes, just as in sptalloc().

	Flag should be set to non-zero only if the memory
	is to be returned to the system memory map. This should
	be done only if sptalloc() was called with base being 0.



Hope this helps.
	Dean Thomas, Microport