Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Presumably it's somehow related to memory? What would

sudo cat /dev/urandom > /dev/mem

do? Trash all RAM? All non-kernel virtual memory? None of the above?

share|improve this question
    
See also: dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOM –  user3490 Sep 9 '12 at 12:14
    
Shouldn't memory protection stop access to the physical RAM for all processes except the one which has been assigned to that area of RAM? Or does sudo override that protection? –  Matthew Lock Aug 14 at 3:05

2 Answers 2

up vote 17 down vote accepted

It provides access to the system's physical memory.

Here's some more info on what /dev/mem is.

Yes -- it could cause all sorts of problems. A reboot should fix you, but bad things can happen very easily. Be careful! :-)

share|improve this answer
2  
I'd suggest reviewing the mem man page. Rags is correct. "mem is a character device file that is an image of the main memory of the computer. It may be used, for example, to examine (and even patch) the system. Byte addresses in mem are interpreted as physical memory addresses." And... "The file kmem is the same as mem, except that the kernel virtual memory rather than physical memory is accessed." –  Mr. Shickadance Feb 24 '11 at 12:26

/dev/mem provides access to system physical memory, not virtual. The kernels virtual address space can be accessed using /dev/kmem.

It's primarily used to access IO memory addresses related to peripheral hardware, like video adaptors.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.