Need help in accessing physical address in Unix

Lars Hammarstrand lasse at daab.UUCP
Thu Dec 5 00:39:03 AEST 1985


>
>System V R 2.  In order to have very fast access ......
>.......
>
>1) Can we access a physical address directly in UNIX without using a 
>   device driver?


Yepp, use the PHYS(2) system call (you have to be a "su" to do that).
It works like this:

	phys(key, virtual_address, size_to_map, physical_address)

where:
- key is a number from 0-3 where each key represents an address map in memory.
  (max 4 can be active at the same time).

- virtual_address is the address in your program that you want to map to a
  physical address.

- physical_address is the "true" address in memory that will be mapped to the
  virtual address in your program.

  ** IMPORTANT **, both addresses must be at an address multiple of the
  resolution of the MMU (i.e. 512,1024,2048,4096)

- size_to_map is the number of bytes to map. Also, this value is rounded up to
  the next MMU resolution. Size of zero means that system will unmap this key.


  Lars Hammarstrand



More information about the Comp.unix.wizards mailing list