148 lines
2.8 KiB
HTML
148 lines
2.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of MEM</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>MEM</H1>
|
|
Section: Linux Programmer's Manual (4)<BR>Updated: 2015-01-02<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
mem, kmem, port - system memory, kernel memory and system ports
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<I>/dev/mem</I>
|
|
|
|
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.
|
|
<P>
|
|
|
|
Byte addresses in
|
|
<I>/dev/mem</I>
|
|
|
|
are interpreted as physical memory addresses.
|
|
References to nonexistent locations cause errors to be returned.
|
|
<P>
|
|
|
|
Examining and patching is likely to lead to unexpected results
|
|
when read-only or write-only bits are present.
|
|
<P>
|
|
|
|
Since Linux 2.6.26, and depending on the architecture, the
|
|
<B>CONFIG_STRICT_DEVMEM</B>
|
|
|
|
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.
|
|
<P>
|
|
|
|
It is typically created by:
|
|
<P>
|
|
|
|
|
|
|
|
mknod -m 660 /dev/mem c 1 1
|
|
chown root:kmem /dev/mem
|
|
|
|
|
|
<P>
|
|
|
|
The file
|
|
<I>/dev/kmem</I>
|
|
|
|
is the same as
|
|
<I>/dev/mem</I>,
|
|
|
|
except that the kernel virtual memory
|
|
rather than physical memory is accessed.
|
|
Since Linux 2.6.26, this file is available only if the
|
|
<B>CONFIG_DEVKMEM</B>
|
|
|
|
kernel configuration option is enabled.
|
|
<P>
|
|
|
|
It is typically created by:
|
|
<P>
|
|
|
|
|
|
|
|
mknod -m 640 /dev/kmem c 1 2
|
|
chown root:kmem /dev/kmem
|
|
|
|
|
|
<P>
|
|
|
|
<I>/dev/port</I>
|
|
|
|
is similar to
|
|
<I>/dev/mem</I>,
|
|
|
|
but the I/O ports are accessed.
|
|
<P>
|
|
|
|
It is typically created by:
|
|
<P>
|
|
|
|
|
|
|
|
mknod -m 660 /dev/port c 1 4
|
|
chown root:kmem /dev/port
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<I>/dev/mem</I>
|
|
|
|
<BR>
|
|
|
|
<I>/dev/kmem</I>
|
|
|
|
<BR>
|
|
|
|
<I>/dev/port</I>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chown">chown</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+mknod">mknod</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioperm">ioperm</A></B>(2)
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">FILES</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">SEE ALSO</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:02 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|