Random Access Memory (RAM) is a block device, why Linux uses a character device file instead of a block device file for user-processes to interface with /dev/mem?

$ ls -l /dev/mem
crw-r----- 1 root kmem 1, 1 Jul 24 19:05 /dev/mem

1 Answer 1


The answer is in the question: RAM isn’t a block device, it can be accessed and modified without constraints (physically) and doesn’t need any buffering.

/dev/mem on Linux is handled by drivers/char/mem.c which implements a number of character devices: /dev/mem, /dev/kmem (before 5.13), /dev/null, /dev/port, /dev/zero, /dev/full, /dev/random, /dev/urandom and /dev/kmsg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.