Technical data

SunOS 5.5 Devices mem(7D)
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 evenpatch 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 unimplementedlocation.
ENXIO This error results from attempting to mmap(2) a non-existent physical
(mem) or virtual (kmem) memory address.
FILES /dev/mem File containingimage of physical memory of computer.
/dev/kmem File containingimage 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.
modified 18 Mar 1994 7D-207