皮皮学,免费搜题
登录
搜题
【简答题】
#include #include #include #include #include #include #define _BUF_MAX 125 static int major = 250; static int minor = 0; //定义设备名为devno,定义结构体名为cdev; _________________________; _________________________; static int my_drv_open(struct inode *inode, struct file *fl); static ssize_t my_read(struct file *rfl, char __user *rbuf, size_t count, loff_t *lf); static ssize_t my_write(struct file *wfl, const char __user *wbuf, size_t count, loff_t *lf); //file_operations添加三个方法,open方法调用my_drv_open函数,read方法调用my_read函数,write方法调用my_write函数 static struct file_operations my_drv_fops={ _________________________, _________________________, _________________________, }; static char val[_BUF_MAX] = {0}; static int my_drv_open(struct inode *inode, struct file *fl) { printk("my_drv_open"); return 0; } static ssize_t my_read(struct file *rfl, char __user *rbuf, size_t count, loff_t *lf) { unsigned int buf_len = (unsigned int)(sizeof(val)/sizeof(char)); unsigned int i; if(buf_len < count) count = buf_len; printk("my_drv read len:%ld", count); if(copy_to_user(rbuf, val, count)) { return -EFAULT; } buf_len = count; for(i = 0; i < buf_len;i++) printk("my_drv read val[%d]=%d", i, val[i]); return 0; } static ssize_t my_write(struct file *wfl, const char __user *wbuf, size_t count, loff_t *lf) { unsigned int buf_len = (unsigned int)(sizeof(val)/sizeof(char)); unsigned int i; if(buf_len < count) count = buf_len; printk("my_drv write buf len:%ld", count); if(copy_from_user(val, wbuf, count)) { return -EFAULT; } buf_len = count; for(i = 0; i < buf_len;i++) printk("my_drv write val[%d]=%d", i, val[i]); return 0; } int my_drv_init(void) { int ret; printk("my_drv_init"); //指定dev_t设备的主次设备号为major和minor _________________________; //静态注册设备devno,已指定主次设备号,设备数量1,物理设备名为/dev/hello,如果注册返回值小于0,显示出错 _________________________; _________________________ { _________________________; _________________________; } //初始化结构体cdev,结构体cdev的名称hello_d,结构体file_operations的名称hello_ops _________________________; //向系统添加结构体cdev的名称为hello_d,设备dev_t名称为devno,数量为1。 _________________________; if(ret < 0) { printk("cdev_add fail \n"); return ret; } return 0; } void my_drv_exit(void) { unregister_chrdev(100, "my_drv"); } module_init(my_drv_init); module_exit(my_drv_exit); //作者qyt,版本0.1,版权GPL _________________________; _________________________; _________________________;
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【简答题】___________称为气缸总容积,用V a 表示。
【简答题】遇硫酸易炭化或易氧化而呈色的微量有机杂质一般叫作
【判断题】自发突变具有不对应性和稀有性的特点。
A.
正确
B.
错误
【单选题】Our management technique has been proven to be the most effective way to get into a target market and acquire potential customers.
A.
我们的管理业务已经实现了市场目标,新客户也已获利,形势令人鼓舞。
B.
我们的管理技术业已证明是进入目标市场并获得潜在客户的最有效途径。
C.
我们的管理方法证明是非常有效的,可以实现市场目标并吸引更多客户。
【判断题】木兰在园林应用时候可以种植在水边。
A.
正确
B.
错误
【单选题】是广告战略要达到的目的,也是广告活动所要达到的目的的具体表现。
A.
广告主
B.
广告渠道
C.
广告预算
D.
广告目标
【简答题】___________称为气缸总容积,用V a 表示。
【单选题】Our management technique has been proven to be the most effective way to get into a target market and acquire potential customers.
A.
我们的管理业务已经实现了市场目标,新客户也已获利,形势令人鼓舞。
B.
我们的管理技术业已证明是进入目标市场并获得潜在客户的最有效途径。
C.
我们的管理办法证明是非常有效的,可以实现市场目标并吸引更多客户。
【单选题】遇硫酸易炭化或易氧化而呈色的微量有机杂质一般叫作()
A.
易氧化物
B.
易脱水有机物
C.
易炭化物
D.
碳水化合物
【单选题】下列哪一选项不是家家禽的皮肤衍生物?
A.
羽毛
B.
C.
皮肤腺
D.
鳞片
相关题目: