我的 /proc/iomem 中的尝试都是 00000000-00000000
与 /proc/ioports 相同。都是0000-0000
喜欢:
00000000-00000000 : reserved
00000000-00000000 : System RAM
00000000-00000000 : reserved
我正在运行 4.10.3-1-ARCH x86_64
也欢迎任何有关如何自行找出原因的建议,谢谢。
答案1
尝试sudo
在命令前面使用,例如sudo less /proc/io{mem,ports}
答案2
这修补解释了这一现象。
diff --git a/kernel/resource.c b/kernel/resource.c
index 2e78ead..9b5f044 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -105,16 +105,25 @@
{
struct resource *root = m->private;
struct resource *r = v, *p;
+ unsigned long long start, end;
int width = root->end < 0x10000 ? 4 : 8;
int depth;
for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent)
if (p->parent == root)
break;
+
+ if (file_ns_capable(m->file, &init_user_ns, CAP_SYS_ADMIN)) {
+ start = r->start;
+ end = r->end;
+ } else {
+ start = end = 0;
+ }
+
seq_printf(m, "%*s%0*llx-%0*llx : %s\n",
depth * 2, "",
- width, (unsigned long long) r->start,
- width, (unsigned long long) r->end,
+ width, start,
+ width, end,
r->name ? r->name : "<BAD>");
return 0;
}