/dev/kmem no such device or address

Kernels & Hardware, configuring network, installing services

/dev/kmem no such device or address

Postby paulbilkis » 2017-10-24 12:57


I have recently built linux kernel ver. 4.13.9, with config options CONFIG_DEVKMEM and CONFIG_DEVMEM. I need access to kernel memory because of the homework, I need to look at the File Descriptor Table of some process in memory (yes, I know about /proc filesystem, but I want to look at the exact structure in the kernel memory).

So, I built kernel with those options. /dev/mem is working fine, but when I try to read something from /dev/kmem, I'm getting following error:

Code: Select all
user@debian-macbook:~$ sudo dd if=/dev/kmem bs=1k count=1 of=~/kmem
dd: error reading '/dev/kmem': No such device or address
0+0 records in
0+0 records out
0 bytes copied, 6.9563e-05 s, 0.0 kB/s

/dev/kmem is exist:
Code: Select all
user@debian-macbook:~$ file /dev/kmem
/dev/kmem: character special (1/2)

I'm running Debian 9:

Code: Select all
user@debian-macbook:~$ uname -a
Linux debian-macbook 4.13.9 #1 SMP Mon Oct 23 01:17:31 MSK 2017 x86_64 GNU/Linux
user@debian-macbook:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.2 (stretch)
Release:    9.2
Codename:   stretch

Please, tell me what is wrong with /dev/kmem, or maybe suggest a different approach?

Thank you.

PS. Those options are enabled for sure:
Code: Select all
user@debian-macbook:~$ cat /boot/config-4.13.9 | grep -Ee 'DEV(|K)MEM'
Posts: 3
Joined: 2011-06-18 09:49

Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests