代码改变世界

随笔档案-2011年08月

/etc/passwd

2011-08-07 23:31 by RayLee, 425 阅读, 收藏,
摘要: 嵌入式Linux往往没有用户管理,shell登陆也仅仅是给开发者用的。因此,像Android,无需输入用户名,可以直接登入shell。如果你需要用户管理(嵌入式Linux通常只需要root),可以添加/etc/passwd。login shell读取输入的用户名和密码后,在passwd文件中验证输入的合法性。 添加passwd前,必须了解passwd的格式。 The /etc/passwd con... 阅读全文

sysfs

2011-08-06 23:59 by RayLee, 289 阅读, 收藏,
摘要: A feature introduced in version 2.6 of the kernel is sysfs. This is a virtual filesystem that provides well-organized and very detailed information about available devices, their configurations and th... 阅读全文

Linux device files and device numbers

2011-08-06 23:44 by RayLee, 520 阅读, 收藏,
摘要: 最近给系统添加了一个驱动,结果导致系统一些功能异常。查了好久,发现是device numbers冲突引起的。开始写驱动时,很自然的使用了动态分配device numbers(major=0 minor=0)的方法,而没有符合平台的特点。后来确认,平台中的device numbers都是预先分配的。 问题现象 使用系统函数open()打开device files总是成功,用ioctl()操作devi... 阅读全文