What is the difference between /dev/mem, /dev/kmem and /proc/kcore?

Asked
Active3 hr before
Viewed126 times

4 Answers

difference
90%

/dev/kmem gives access to the kernel's virtual memory space, and /dev/mem gives access to physical memory.,/proc/kcore is a pseudofile in ELF core format, of the kernel's virtual memory space. You should be able to examine it with standard ELF utilities, like objdump and gdb - although you will likely better off to make a regular file copy of it and work on that., In laymans terms what is the difference between this virtual memory space and physical memory – user567879 Feb 3 '11 at 7:37 , @user567879: The virtual memory address space corresponds to the addresses as seen by the program in question (in this case, the kernel). The physical memory address space corresponds to the actual memory addresses that are placed on the system bus. The MMU within the CPU translates virtual addresses into physical addresses. – caf Feb 3 '11 at 8:43

/dev/kmem gives access to the kernel's virtual memory space, and /dev/mem gives access to physical memory.

/dev/kmem

/dev/kmem gives access to the kernel's virtual memory space, and /dev/mem gives access to physical memory.

/dev/mem
load more v
88%

/dev/kmem gives access to the kernel's virtual memory space, and /dev/mem gives access to physical memory.,What is the difference between /dev/mem, /dev/kmem and /proc/kcore?,/proc/kcore is a pseudofile in ELF core format, of the kernel's virtual memory space. You should be able to examine it with standard ELF utilities, like objdump and gdb - although you will likely better off to make a regular file copy of it and work on that.,If you find copyright violations, you can contact us at info-generacodice.com to request the removal of the content.

What is the difference between /dev/mem, /dev/kmem and /proc/kcore?

/dev/mem

What is the difference between /dev/mem, /dev/kmem and /proc/kcore?

/dev/kmem

What is the difference between /dev/mem, /dev/kmem and /proc/kcore?

/proc/kcore
load more v
72%

I wanted to use that feature on Linux for some self made evaluation boards with PCIe connection before I start writing a device driver. However it seems that I cannot access device address regions that way with /dev/kmem. , On Unix systems with free kernels, there is pretty much no safe way to use /dev/kmem in any case: too many details of kernel memory layout can and do change too often. Revving all the tools whenever you hack the memory manager would be appalling. , Basically it should be a kernel debugging option, and thus off for the vast majority of systems. , /dev/kmem has no real use today, other than rootkits - hence the removal from Fedora. It should be removed from mainline too.

	if (!pfn_valid(vma - > vm_pgoff))
	   return -EIO;
	val = (u64) vma - > vm_pgoff << PAGE_SHIFT;
	vma - > vm_pgoff = __pa(val) >> PAGE_SHIFT;
	return mmap_mem(file, vma);
65%

Connect and share knowledge within a single location that is structured and easy to search.,Thanks for contributing an answer to Unix & Linux Stack Exchange!, Unix & Linux help chat ,Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.

Well, looking over man mem gives us some details about how its created:

mknod - m 660 / dev / mem c 1 1
chown root: kmem / dev / mem
load more v

Other "difference-undefined" queries related to "What is the difference between /dev/mem, /dev/kmem and /proc/kcore?"