Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/dev/mem and /dev/kmem not exists?

I would appreciate if some one can explain me why the two files do not exist? How Android kernel's virtual memory space and physical space be like without have the 2 files?

Edit: I am having Android 2.3.7 (Cyanogen mod), the 2 files do not exist: enter image description here

Edit2: I have checked the Samsung Galaxy S3 running ICS, the 2 files exist

like image 408
Krypton Avatar asked Jan 16 '23 16:01

Krypton


2 Answers

The /dev/mem (c:1:1) and /dev/kmem (c:1:2) device nodes are merely an API that drivers/char/mem.c in the Linux kernel exposes to user-space. The kernel itself manages memory directly without use of these device nodes, and in general user-space does not need them either.

/dev is simply a directory which (by tradition) contains device nodes, which are special "files"; there is no strict relation between what is available in /dev and what the kernel provides. (There are tools like udev or mdev which create and destroy device nodes in /dev in response to kernel events, but these are not always used in the embedded world where hardware is relatively fixed and known.) If you wish, you may try creating these nodes to interact with using mknod (and this can live anywhere, not ncessarily in /dev). However, it is possible that the kernel has been configured with CONFIG_DEVKMEM=n, in which case these devices will not work anyways.

like image 106
ephemient Avatar answered Jan 24 '23 13:01

ephemient


They exist on my phone.

enter image description here

Most file browsers on android won't be able to see these files because of permissions

like image 38
vikki Avatar answered Jan 24 '23 11:01

vikki