]>
Commit | Line | Data |
---|---|---|
3d54a910 MK |
1 | .\" Copyright (c) 1993 Michael Haardt (michael@moria.de), |
2 | .\" Fri Apr 2 11:32:09 MET DST 1993 | |
fea681da | 3 | .\" |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
5 | .\" |
6 | .\" Modified Sat Jul 24 16:59:10 1993 by Rik Faith (faith@cs.unc.edu) | |
639dfde8 | 7 | .TH MEM 4 2015-01-02 "Linux" "Linux Programmer's Manual" |
fea681da MK |
8 | .SH NAME |
9 | mem, kmem, port \- system memory, kernel memory and system ports | |
10 | .SH DESCRIPTION | |
1ae6b2c7 | 11 | .I /dev/mem |
35cfd378 | 12 | is a character device file |
c13182ef MK |
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. | |
dd3568a1 | 15 | .PP |
c13182ef | 16 | Byte addresses in |
1ae6b2c7 | 17 | .I /dev/mem |
e8046fd0 | 18 | are interpreted as physical memory addresses. |
c382a365 | 19 | References to nonexistent locations cause errors to be returned. |
dd3568a1 | 20 | .PP |
fea681da MK |
21 | Examining and patching is likely to lead to unexpected results |
22 | when read-only or write-only bits are present. | |
dd3568a1 | 23 | .PP |
2174e8e3 | 24 | Since Linux 2.6.26, and depending on the architecture, the |
639dfde8 EDB |
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. | |
dd3568a1 | 30 | .PP |
fea681da | 31 | It is typically created by: |
bdd915e2 MK |
32 | .PP |
33 | .in +4n | |
34 | .EX | |
4d9b6984 | 35 | mknod \-m 660 /dev/mem c 1 1 |
9df0bd1d | 36 | chown root:kmem /dev/mem |
bdd915e2 MK |
37 | .EE |
38 | .in | |
39 | .PP | |
c13182ef | 40 | The file |
1ae6b2c7 | 41 | .I /dev/kmem |
c13182ef | 42 | is the same as |
2174e8e3 | 43 | .IR /dev/mem , |
e8046fd0 | 44 | except that the kernel virtual memory |
fea681da | 45 | rather than physical memory is accessed. |
2174e8e3 | 46 | Since Linux 2.6.26, this file is available only if the |
0d9096a7 EDB |
47 | .B CONFIG_DEVKMEM |
48 | kernel configuration option is enabled. | |
dd3568a1 | 49 | .PP |
fea681da | 50 | It is typically created by: |
bdd915e2 MK |
51 | .PP |
52 | .in +4n | |
53 | .EX | |
4d9b6984 | 54 | mknod \-m 640 /dev/kmem c 1 2 |
9df0bd1d | 55 | chown root:kmem /dev/kmem |
bdd915e2 MK |
56 | .EE |
57 | .in | |
58 | .PP | |
1ae6b2c7 | 59 | .I /dev/port |
35cfd378 | 60 | is similar to |
2174e8e3 | 61 | .IR /dev/mem , |
a28e26a1 | 62 | but the I/O ports are accessed. |
dd3568a1 | 63 | .PP |
fea681da | 64 | It is typically created by: |
bdd915e2 MK |
65 | .PP |
66 | .in +4n | |
67 | .EX | |
4d9b6984 | 68 | mknod \-m 660 /dev/port c 1 4 |
463f35e1 | 69 | chown root:kmem /dev/port |
bdd915e2 MK |
70 | .EE |
71 | .in | |
fea681da MK |
72 | .SH FILES |
73 | .I /dev/mem | |
74 | .br | |
75 | .I /dev/kmem | |
76 | .br | |
77 | .I /dev/port | |
47297adb | 78 | .SH SEE ALSO |
fea681da MK |
79 | .BR chown (1), |
80 | .BR mknod (1), | |
81 | .BR ioperm (2) |