Blame man4/mem.4

Packit 7cfc04
.\" Copyright (c) 1993 Michael Haardt (michael@moria.de),
Packit 7cfc04
.\"     Fri Apr  2 11:32:09 MET DST 1993
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
Packit 7cfc04
.\" This is free documentation; you can redistribute it and/or
Packit 7cfc04
.\" modify it under the terms of the GNU General Public License as
Packit 7cfc04
.\" published by the Free Software Foundation; either version 2 of
Packit 7cfc04
.\" the License, or (at your option) any later version.
Packit 7cfc04
.\"
Packit 7cfc04
.\" The GNU General Public License's references to "object code"
Packit 7cfc04
.\" and "executables" are to be interpreted as the output of any
Packit 7cfc04
.\" document formatting or typesetting system, including
Packit 7cfc04
.\" intermediate and printed output.
Packit 7cfc04
.\"
Packit 7cfc04
.\" This manual is distributed in the hope that it will be useful,
Packit 7cfc04
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7cfc04
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 7cfc04
.\" GNU General Public License for more details.
Packit 7cfc04
.\"
Packit 7cfc04
.\" You should have received a copy of the GNU General Public
Packit 7cfc04
.\" License along with this manual; if not, see
Packit 7cfc04
.\" <http://www.gnu.org/licenses/>.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" Modified Sat Jul 24 16:59:10 1993 by Rik Faith (faith@cs.unc.edu)
Packit 7cfc04
.TH MEM 4 2015-01-02 "Linux" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
mem, kmem, port \- system memory, kernel memory and system ports
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
.IR /dev/mem
Packit 7cfc04
is a character device file
Packit 7cfc04
that is an image of the main memory of the computer.
Packit 7cfc04
It may be used, for example, to examine (and even patch) the system.
Packit 7cfc04
.PP
Packit 7cfc04
Byte addresses in
Packit 7cfc04
.IR /dev/mem
Packit 7cfc04
are interpreted as physical memory addresses.
Packit 7cfc04
References to nonexistent locations cause errors to be returned.
Packit 7cfc04
.PP
Packit 7cfc04
Examining and patching is likely to lead to unexpected results
Packit 7cfc04
when read-only or write-only bits are present.
Packit 7cfc04
.PP
Packit 7cfc04
Since Linux 2.6.26, and depending on the architecture, the
Packit 7cfc04
.B CONFIG_STRICT_DEVMEM
Packit 7cfc04
kernel configuration option limits the areas
Packit 7cfc04
which can be accessed through this file.
Packit 7cfc04
For example: on x86, RAM access is not allowed but accessing
Packit 7cfc04
memory-mapped PCI regions is.
Packit 7cfc04
.PP
Packit 7cfc04
It is typically created by:
Packit 7cfc04
.PP
Packit 7cfc04
.in +4n
Packit 7cfc04
.EX
Packit 7cfc04
mknod \-m 660 /dev/mem c 1 1
Packit 7cfc04
chown root:kmem /dev/mem
Packit 7cfc04
.EE
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
The file
Packit 7cfc04
.IR /dev/kmem
Packit 7cfc04
is the same as
Packit 7cfc04
.IR /dev/mem ,
Packit 7cfc04
except that the kernel virtual memory
Packit 7cfc04
rather than physical memory is accessed.
Packit 7cfc04
Since Linux 2.6.26, this file is available only if the
Packit 7cfc04
.B CONFIG_DEVKMEM
Packit 7cfc04
kernel configuration option is enabled.
Packit 7cfc04
.PP
Packit 7cfc04
It is typically created by:
Packit 7cfc04
.PP
Packit 7cfc04
.in +4n
Packit 7cfc04
.EX
Packit 7cfc04
mknod \-m 640 /dev/kmem c 1 2
Packit 7cfc04
chown root:kmem /dev/kmem
Packit 7cfc04
.EE
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
.IR /dev/port
Packit 7cfc04
is similar to
Packit 7cfc04
.IR /dev/mem ,
Packit 7cfc04
but the I/O ports are accessed.
Packit 7cfc04
.PP
Packit 7cfc04
It is typically created by:
Packit 7cfc04
.PP
Packit 7cfc04
.in +4n
Packit 7cfc04
.EX
Packit 7cfc04
mknod \-m 660 /dev/port c 1 4
Packit 7cfc04
chown root:kmem /dev/port
Packit 7cfc04
.EE
Packit 7cfc04
.in
Packit 7cfc04
.SH FILES
Packit 7cfc04
.I /dev/mem
Packit 7cfc04
.br
Packit 7cfc04
.I /dev/kmem
Packit 7cfc04
.br
Packit 7cfc04
.I /dev/port
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR chown (1),
Packit 7cfc04
.BR mknod (1),
Packit 7cfc04
.BR ioperm (2)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.