Chinaunix首页 | 论坛 | 博客
  • 博客访问: 465483
  • 博文数量: 150
  • 博客积分: 2706
  • 博客等级: 少校
  • 技术积分: 1200
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-09 11:41
文章分类

全部博文(150)

文章存档

2012年(7)

2011年(6)

2010年(68)

2009年(69)

我的朋友

分类: LINUX

2010-07-15 12:14:09

Programming方面的一些知识:


1. By convention, all kernel prefixes are lowercase.

2. The file /proc/kallsyms holds all the symbols that the kernel knows about and which are therefore accessible
to your modules since they share the kernel's codespace.

3. 结构体赋值方法的不同
GCC:
struct file_operations fops = {
read: device_read,
write: device_write,
open: device_open,
release: device_release
};


C99:
struct file_operations fops = {
.read = device_read,
.write = device_write,
.open = device_open,
.release = device_release
};

4. Normally a negative return value means the registration failed

5. major number分配方法
a. major number can be dynamically assigned by kernel.
b. must look throught documenet/devices.txt and then get an unused one

6. /proc/modules which provides the list of modules
   /proc/meminfo which stats memory usage statistics
   

阅读(611) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~