1MEM(4)                     Linux Programmer's Manual                    MEM(4)
2
3
4

NAME

6       mem, kmem, port - system memory, kernel memory and system ports
7

DESCRIPTION

9       /dev/mem is a character device file that is an image of the main memory
10       of the computer.  It may be used, for example,  to  examine  (and  even
11       patch) the system.
12
13       Byte   addresses   in  /dev/mem  are  interpreted  as  physical  memory
14       addresses.  References to nonexistent  locations  cause  errors  to  be
15       returned.
16
17       Examining  and  patching  is  likely to lead to unexpected results when
18       read-only or write-only bits are present.
19
20       Since Linux  2.6.26,  and  depending  on  the  architecture,  the  CON‐
21       FIG_STRICT_DEVMEM  kernel  configuration  option limits the areas which
22       can be accessed through this file.  For example: on x86, RAM access  is
23       not allowed but accessing memory-mapped PCI regions is.
24
25       It is typically created by:
26
27           mknod -m 660 /dev/mem c 1 1
28           chown root:kmem /dev/mem
29
30       The file /dev/kmem is the same as /dev/mem, except that the kernel vir‐
31       tual memory rather than  physical  memory  is  accessed.   Since  Linux
32       2.6.26,  this  file is available only if the CONFIG_DEVKMEM kernel con‐
33       figuration option is enabled.
34
35       It is typically created by:
36
37           mknod -m 640 /dev/kmem c 1 2
38           chown root:kmem /dev/kmem
39
40       /dev/port is similar to /dev/mem, but the I/O ports are accessed.
41
42       It is typically created by:
43
44           mknod -m 660 /dev/port c 1 4
45           chown root:kmem /dev/port
46

FILES

48       /dev/mem
49       /dev/kmem
50       /dev/port
51

SEE ALSO

53       chown(1), mknod(1), ioperm(2)
54

COLOPHON

56       This page is part of release 5.07 of the Linux  man-pages  project.   A
57       description  of  the project, information about reporting bugs, and the
58       latest    version    of    this    page,    can     be     found     at
59       https://www.kernel.org/doc/man-pages/.
60
61
62
63Linux                             2015-01-02                            MEM(4)
Impressum