mem(4) — Linux manual page
mem(4) Kernel Interfaces Manual mem(4)
NAME
mem, kmem, port - system memory, kernel memory and system ports
DESCRIPTION
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine
(and even patch) the system.
Byte addresses in /dev/mem are interpreted as physical memory
addresses. References to nonexistent locations cause errors to
be returned.
Examining and patching is likely to lead to unexpected results
when read-only or write-only bits are present.
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file. For example: on x86,
RAM access is not allowed but accessing memory-mapped PCI regions
is.
It is typically created by:
mknod -m 660 /dev/mem c 1 1
chown root:kmem /dev/mem
The file /dev/kmem is the same as /dev/mem, except that the
kernel virtual memory rather than physical memory is accessed.
Since Linux 2.6.26, this file is available only if the
CONFIG_DEVKMEM kernel configuration option is enabled.
It is typically created by:
mknod -m 640 /dev/kmem c 1 2
chown root:kmem /dev/kmem
/dev/port is similar to /dev/mem, but the I/O ports are accessed.
It is typically created by:
mknod -m 660 /dev/port c 1 4
chown root:kmem /dev/port
FILES
/dev/mem
/dev/kmem
/dev/port
SEE ALSO
chown(1), mknod(1), ioperm(2)
COLOPHON
This page is part of the man-pages (Linux kernel and C library
user-space interface documentation) project. Information about
the project can be found at
⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report
for this manual page, see
⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩.
This page was obtained from the tarball man-pages-6.9.1.tar.gz
fetched from
⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on
2024-06-26. If you discover any rendering problems in this HTML
version of the page, or you believe there is a better or more up-
to-date source for the page, or you have corrections or
improvements to the information in this COLOPHON (which is not
part of the original manual page), send a mail to
man-pages@man7.org