/dev/mem和/dev/kmem不存在? [英] /dev/mem and /dev/kmem not exists?

查看:839
本文介绍了/dev/mem和/dev/kmem不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人能向我解释为什么两个文件不存在,我将不胜感激. 没有这两个文件,Android内核的虚拟内存空间和物理空间会如何?

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?

我使用的是Android 2.3.7(Cyanogen mod),这2个文件不存在:

I am having Android 2.3.7 (Cyanogen mod), the 2 files do not exist:

Edit2: 我检查了运行ICS的Samsung Galaxy S3,存在2个文件

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

推荐答案

/dev/mem(c:1:1)和/dev/kmem(c:1:2)设备节点仅仅是drivers/char/mem.c在Linux内核公开给用户空间.内核本身直接管理内存,而无需使用这些设备节点,并且通常在用户空间中也不需要它们.

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只是一个目录,按照传统,它包含设备节点,这些设备节点是特殊的文件";在/dev中可用的内容与内核提供的内容之间没有严格的关系. (有诸如udevmdev之类的工具可以根据内核事件在/dev中创建和销毁设备节点,但是在硬件相对固定和已知的嵌入式世界中并不总是使用这些工具.)如果您愿意,您可以尝试创建这些节点以使用mknod与之交互(并且该节点可以存在于任何地方,而不必存在于/dev中).但是,可能内核已经配置了CONFIG_DEVKMEM=n,在这种情况下,这些设备将无法正常工作.

/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.

这篇关于/dev/mem和/dev/kmem不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆