1mem(4) Kernel Interfaces Manual mem(4)
2
3
4
6 mem, kmem, port - system memory, kernel memory and system ports
7
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 ad‐
14 dresses. References to nonexistent locations cause errors to be re‐
15 turned.
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
48 /dev/mem
49 /dev/kmem
50 /dev/port
51
53 chown(1), mknod(1), ioperm(2)
54
55
56
57Linux man-pages 6.05 2022-10-30 mem(4)