Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
mem(7D)				    Devices			       mem(7D)

NAME
       mem, kmem, allkmem - physical or	virtual	memory access

SYNOPSIS
       /dev/mem

       /dev/kmem

       /dev/allkmem

DESCRIPTION
       The  file /dev/mem is a special file that provides access to the	physi-
       cal memory of the computer.

       The file	/dev/kmem is a special file that provides access to  the  vir-
       tual  address  space  of	 the operating system kernel, excluding	memory
       that is associated with an I/O device.

       The file	/dev/allkmem is	a special file that  provides  access  to  the
       virtual	address	space of the operating system kernel, including	memory
       that is associated with an I/O device.  You can use any	of  these  de-
       vices to	examine	and modify the system.

       Byte  addresses	in  /dev/mem  are  interpreted	as physical memory ad-
       dresses.	Byte addresses in /dev/kmem and	/dev/allkmem  are  interpreted
       as  kernel virtual memory addresses.  A reference to a non-existent lo-
       cation returns an error.	See ERRORS for more information.

       The file	/dev/mem accesses physical memory; the size  of	 the  file  is
       equal  to the amount of physical	memory in the computer.	 This size may
       be larger than 4GB on a system running the  32-bit  operating  environ-
       ment.  In this case, you	can access memory beyond 4GB using a series of
       read(2) and write(2) calls, a pread64() or pwrite64() call, or a	combi-
       nation of llseek(2) and read(2) or write(2).

ERRORS
       EFAULT	       Occurs  when  trying  to	 write(2) a read-only location
		       (allkmem),  read(2) a write-only	location (allkmem), or
		       read(2) or write(2) a non-existent or unimplemented lo-
		       cation (mem, kmem, allkmem).

       EIO	       Occurs when trying to read(2) or	write(2) a memory  lo-
		       cation  that is associated with an I/O device using the
		       /dev/kmem special file.

       ENXIO	       Results from attempting to mmap(2) a non-existent phys-
		       ical (mem) or virtual (kmem, allkmem) memory address.

FILES
       /dev/mem	       Provides	access to the computer's physical memory.

       /dev/kmem       Provides	access to the virtual address space of the op-
		       erating system kernel, excluding	memory that is associ-
		       ated with an I/O	device.

       /dev/allkmem    Provides	access to the virtual address space of the op-
		       erating system kernel, including	memory that is associ-
		       ated with an I/O	device.

SEE ALSO
       llseek(2), mmap(2), read(2), write(2)

WARNINGS
       Using  these devices to modify (that is,	write to) the address space of
       a live running operating	system or to modify the	state of      a	 hard-
       ware  device is extremely dangerous and may result in a system panic if
       kernel data structures are damaged or if	device state is	changed.

SunOS 5.10			  18 Feb 2002			       mem(7D)

NAME | SYNOPSIS | DESCRIPTION | ERRORS | FILES | SEE ALSO | WARNINGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=mem&sektion=7d&manpath=SunOS+5.10>

home | help