标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
arm linux 从入口到start_kernel 代码详细分析7 | 1955 | 0 | 7 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析6 | 2041 | 0 | 4 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析5 | 1758 | 0 | 4 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析4 | 2192 | 0 | 3 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析3 | 1601 | 0 | 3 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析2 | 1440 | 0 | 4 | 2010-09-08 | |
arm linux 从入口到start_kernel 代码详细分析-1 | 1465 | 0 | 3 | 2010-09-08 | |
Inside the Linux boot process | 1231 | 0 | 0 | 2010-09-08 | |
ARM920T的MMU与Cache之CP15协处理器 | 1151 | 0 | 0 | 2010-09-08 | |
ARM MMU工作原理剖析 | 1025 | 0 | 0 | 2010-09-08 | |
浅析arm-linux中断vector向量表的建立流程 | 1036 | 0 | 0 | 2010-09-02 | |
installing vector table | 1320 | 0 | 0 | 2010-09-02 | |
基于ARM Linux中断、异常的处理分析 | 838 | 0 | 0 | 2010-09-02 | |
ARM的启动和中断向量表 | 1234 | 0 | 0 | 2010-09-02 | |
linux中断处理之初始化 | 919 | 0 | 0 | 2010-09-02 |
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 ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白