Fedora-ARM
全部博文(241)
分类: LINUX
2007-10-20 15:47:42
dengwei30102010-04-26 15:01:28
Linux设备驱动程序学习(3)-并发和竞态一节 中 [Tekkaman2440@SBC2440V4]#read code=0 这句话是什么意思? 在我电脑上怎么会是bash: read: “code=0”: 无效的标识符 请教大侠!!
dengwei30102010-04-22 21:05:14
oot@dw:/home/dengwei/eclipse_workspace/hello1# echo 1 > /proc/sys/kernel/printk root@dw:/home/dengwei/eclipse_workspace/hello1# cat /proc/sys/kernel/printk 1 4 1 7 root@dw:/home/dengwei/eclipse_workspace/hello1# insmod hello.ko root@dw:/home/dengwei/eclipse_workspace/hello1# echo 8 > /proc/sys/kernel/printk root@dw:/home/dengwei/eclipse_workspace/hello1# rmmod hello.ko root@dw:/home/dengwei/eclipse_workspace/hello1#
dengwei30102010-04-22 20:37:24
sculltest = open("/dev/scull",O_WRONLY ); for ( i=20 ; i>0 ; i-=code) { if ((code=write(sculltest , &buffer1[20-i] , i)) != i) printf("write error! code=%d \n",code); else printf("write ok! code=%d \n",code); } close(sculltest); //这里为什么不是release(sculltest) 在file_operations 中赋值 struct file_operations scull_fops = { .owner = THIS_MODULE, .read = scull_read,