[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    mem(7D) manual page Table of Contents

Name

mem, kmem - physical or virtual memory

Synopsis

/dev/mem
/dev/kmem

Description

The file /dev/mem is a special file that is an image of the physical memory of the computer. The file /dev/kmem is a special file that is an image of the kernel virtual memory of the computer. Either may be used, for example, to examine, and even patch the system.

Byte addresses in /dev/mem are interpreted as physical memory addresses. Byte addresses in /dev/kmem are interpreted as kernel virtual memory addresses. References to non-existent locations cause errors to be returned (see ERRORS below).

The file /dev/kmem accesses up to 4GB of kernel virtual memory. The file /dev/mem accesses physical memory; the size of the file is equal to the amount of physical memory in the computer. This can be larger than 4GB ; in which case, memory beyond 4GB can be accessed using a series of read(2) and write(2) commands or a combination of llseek(2) and read(2) and write(2) .

Errors

EFAULT
Bad address. This error can occur when trying to: write(2) a read-only location, read(2) a write-only location, or read(2) or write(2) a non-existent or unimplemented location.
ENXIO
This error results from attempting to mmap(2) a non-existent physical (mem) or virtual (kmem) memory address.

Files

/dev/mem
File containing image of physical memory of computer.
/dev/kmem
File containing image of kernel virtual memory of computer.

See Also

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

Notes

Some of /dev/kmem cannot be read because of write-only addresses or unequipped memory addresses.


Table of Contents