Debian Codegraph @

upstream/debian-trixie/man4/mem.4

raw
1 .\" Copyright (c) 1993 Michael Haardt ([email protected]),
2 .\" Fri Apr 2 11:32:09 MET DST 1993
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" Modified Sat Jul 24 16:59:10 1993 by Rik Faith ([email protected])
7 .TH mem 4 2024-05-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 mem, kmem, port \- system memory, kernel memory and system ports
10 .SH DESCRIPTION
11 .I /dev/mem
12 is a character device file
13 that is an image of the main memory of the computer.
14 It may be used, for example, to examine (and even patch) the system.
15 .P
16 Byte addresses in
17 .I /dev/mem
18 are interpreted as physical memory addresses.
19 References to nonexistent locations cause errors to be returned.
20 .P
21 Examining and patching is likely to lead to unexpected results
22 when read-only or write-only bits are present.
23 .P
24 Since Linux 2.6.26, and depending on the architecture, the
25 .B CONFIG_STRICT_DEVMEM
26 kernel configuration option limits the areas
27 which can be accessed through this file.
28 For example: on x86, RAM access is not allowed but accessing
29 memory-mapped PCI regions is.
30 .P
31 It is typically created by:
32 .P
33 .in +4n
34 .EX
35 mknod \-m 660 /dev/mem c 1 1
36 chown root:kmem /dev/mem
37 .EE
38 .in
39 .P
40 The file
41 .I /dev/kmem
42 is the same as
43 .IR /dev/mem ,
44 except that the kernel virtual memory
45 rather than physical memory is accessed.
46 Since Linux 2.6.26, this file is available only if the
47 .B CONFIG_DEVKMEM
48 kernel configuration option is enabled.
49 .P
50 It is typically created by:
51 .P
52 .in +4n
53 .EX
54 mknod \-m 640 /dev/kmem c 1 2
55 chown root:kmem /dev/kmem
56 .EE
57 .in
58 .P
59 .I /dev/port
60 is similar to
61 .IR /dev/mem ,
62 but the I/O ports are accessed.
63 .P
64 It is typically created by:
65 .P
66 .in +4n
67 .EX
68 mknod \-m 660 /dev/port c 1 4
69 chown root:kmem /dev/port
70 .EE
71 .in
72 .SH FILES
73 .I /dev/mem
74 .br
75 .I /dev/kmem
76 .br
77 .I /dev/port
78 .SH SEE ALSO
79 .BR chown (1),
80 .BR mknod (1),
81 .BR ioperm (2)