发布时间:2013-01-26 14:46:37
1. init进程2. zygote进程2.1 AndroidRuntime2.2 ZygoteInit3. system_server进程3.1 init1阶段3.2 init2阶段接着Linux启动部分 http://blog.csdn.net/qianjin0703/article/details/68811071. init进程系统在内核空间初始化进程,内存,文件系统,驱动模块之后,调用in.........【阅读全文】
chen_chuang2012-10-11 16:33
高手,有本书上写cdev初始化和注册是这样写的
static void VirtualDisk_setup_cdev(struct VirtualDisk *dev, int minor)
{
int err;
devno = MDDEV(VirtualDisk_major, minor);
cdev_init(&dev->cdev, &VirtualDisk_fops);
dev->cdev.owner = THIS_MOUDULE;
dev->cdev.ops = &VirtualDisk_fops;
err = cdev_add(&dev->cdev, debno, 1);
if (err)
printk(KERN_NOTICE "Error in cdev_add()\n");
}
而cdev_init里
void cdev_init(struct cdev *cdev, const struct file_operations *fops)
{
memset(cdev, 0, sizeof *cdev);
INIT_LIST_HEAD(&cdev->list);
kobject_init(&cdev->kobj, &ktype_cdev_default);
cdev->ops = fops;
}
已经有cdev->ops = fops了
那上面的代码cdev_init之后又有dev->cdev.ops ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白