当前位置: 首页 > news >正文

为什么现在建设银行要下载网站激活码互联网推广招聘

为什么现在建设银行要下载网站激活码,互联网推广招聘,京东网站建设现状,厦门网站流量优化价格文章目录一、代码分析:二、源码一、代码分析: 在内核中由于代码文件多,避免函数名重复,使用static将函数的作用域限制在该文件内 内核的打印函数printk和printf类似 file_operations结构体使用符号“ . ”指定参数,省…

文章目录

  • 一、代码分析:
  • 二、源码

一、代码分析:

  • 在内核中由于代码文件多,避免函数名重复,使用static将函数的作用域限制在该文件内

  • 内核的打印函数printk和printf类似

  • file_operations结构体使用符号“ . ”指定参数,省去不需要的参数

  • pin4_drv_init初始化函数:
    MKDEV根据主设备号、次设备号创建设备号
    register_chrdev 注册驱动,将驱动加入到内核驱动链表中
    class_create 创建设备类
    device_create 创建设备文件

  • pin4_drv_exit 删除函数:
    device_destroy 删除设备文件
    class_destroy 删除设备类
    unregister_chrdev 卸载驱动

  • 内核的入口:module_init调用pin4_drv_init初始化函数

二、源码

驱动源码:

#include <linux/fs.h>		 //file_operations声明
#include <linux/module.h>    //module_init  module_exit声明
#include <linux/init.h>      //__init  __exit 宏定义声明
#include <linux/device.h>	 //class  devise声明
#include <linux/uaccess.h>   //copy_from_user 的头文件
#include <linux/types.h>     //设备号  dev_t 类型声明
#include <asm/io.h>          //ioremap iounmap的头文件static struct class *pin4_class;  
static struct device *pin4_class_dev;static dev_t devno;                //设备号
static int major =231;  		   //主设备号
static int minor =0;			   //次设备号
static char *module_name="pin4";   //模块名//led_open函数
static int pin4_open(struct inode *inode,struct file *file)
{printk("pin4_open\n");  //内核的打印函数和printf类似return 0;
}//led_write函数
static ssize_t pin4_write(struct file *file,const char __user *buf,size_t count, loff_t *ppos)
{printk("pin4_write\n"); return 0;
}//led_read函数
static int pin4_read(struct file *file,char __user *buf,size_t count, loff_t *ppos)
{printk("pin4_read\n"); return 0;
}static struct file_operations pin4_fops = {.owner = THIS_MODULE,.open  = pin4_open,.write = pin4_write,.read  = pin4_read,
};int __init pin4_drv_init(void)   
{int ret;devno = MKDEV(major,minor);  //创建设备号ret   = register_chrdev(major, module_name,&pin4_fops);  //注册驱动  告诉内核,把这个驱动加入到内核驱动的链表中pin4_class=class_create(THIS_MODULE,"myfirstdemo");      //创建设备类pin4_class_dev =device_create(pin4_class,NULL,devno,NULL,module_name);  //创建设备文件return 0;
}void __exit pin4_drv_exit(void)
{device_destroy(pin4_class,devno);class_destroy(pin4_class);unregister_chrdev(major, module_name);  //卸载驱动}module_init(pin4_drv_init);  //入口
module_exit(pin4_drv_exit);
MODULE_LICENSE("GPL v2");

测试程序源码:

  • 测试程序由于要放在树莓派ARM下运行,故需在Ubuntu下使用交叉编译工具进行编译,再通过scp命令传输给树莓派
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char const *argv[])
{int fd = open("/dev/pin4",O_RDWR);if(fd < 0 ){printf("open failed\n");error("reason:");}else{printf("open success\n");}fd = write(fd,'1',1);return 0;
}

文章转载自:
http://dinncothumping.stkw.cn
http://dinncoradioheating.stkw.cn
http://dinncocompensable.stkw.cn
http://dinncosheila.stkw.cn
http://dinncothem.stkw.cn
http://dinncowholesome.stkw.cn
http://dinncograze.stkw.cn
http://dinncoresting.stkw.cn
http://dinncogoglet.stkw.cn
http://dinncotelengiscope.stkw.cn
http://dinncoviennese.stkw.cn
http://dinncocapodimonte.stkw.cn
http://dinncointerferometer.stkw.cn
http://dinncohallowmas.stkw.cn
http://dinncojacana.stkw.cn
http://dinncoknave.stkw.cn
http://dinncozoetrope.stkw.cn
http://dinncodishorn.stkw.cn
http://dinncofluoridationist.stkw.cn
http://dinncocapersome.stkw.cn
http://dinncodecidable.stkw.cn
http://dinncoconnectionless.stkw.cn
http://dinncofirman.stkw.cn
http://dinncobeanball.stkw.cn
http://dinncosteak.stkw.cn
http://dinncoterminational.stkw.cn
http://dinncototalizator.stkw.cn
http://dinncouncustomed.stkw.cn
http://dinncosubarachnoid.stkw.cn
http://dinncosafranin.stkw.cn
http://dinncoscutate.stkw.cn
http://dinncocanton.stkw.cn
http://dinncococcidiosis.stkw.cn
http://dinncoantiobscenity.stkw.cn
http://dinncofabricant.stkw.cn
http://dinncospirochete.stkw.cn
http://dinncocalifornian.stkw.cn
http://dinncodidache.stkw.cn
http://dinnconudey.stkw.cn
http://dinncomonachal.stkw.cn
http://dinncocancerology.stkw.cn
http://dinncolacquey.stkw.cn
http://dinncodme.stkw.cn
http://dinncofirefly.stkw.cn
http://dinncounrequested.stkw.cn
http://dinncogreenboard.stkw.cn
http://dinncotheatric.stkw.cn
http://dinncounsoaped.stkw.cn
http://dinncoprecept.stkw.cn
http://dinncocornflakes.stkw.cn
http://dinncotaximeter.stkw.cn
http://dinncoulnocarpal.stkw.cn
http://dinncodisrepute.stkw.cn
http://dinncolandgravine.stkw.cn
http://dinncocornual.stkw.cn
http://dinncolacertian.stkw.cn
http://dinncodocetism.stkw.cn
http://dinncosquab.stkw.cn
http://dinncowall.stkw.cn
http://dinncokola.stkw.cn
http://dinncohumph.stkw.cn
http://dinncomisapprehensive.stkw.cn
http://dinncocatharsis.stkw.cn
http://dinncosouthernization.stkw.cn
http://dinncocribble.stkw.cn
http://dinncoinhalant.stkw.cn
http://dinncomotility.stkw.cn
http://dinncophaedra.stkw.cn
http://dinncodegradand.stkw.cn
http://dinncocancellation.stkw.cn
http://dinncoglandular.stkw.cn
http://dinncoglandulous.stkw.cn
http://dinncopermittivity.stkw.cn
http://dinncodissymmetry.stkw.cn
http://dinncofigured.stkw.cn
http://dinncoseapiece.stkw.cn
http://dinncounwincing.stkw.cn
http://dinncocinque.stkw.cn
http://dinncoaffluent.stkw.cn
http://dinncoconidium.stkw.cn
http://dinncoforeigner.stkw.cn
http://dinncomephistopheles.stkw.cn
http://dinncofootballer.stkw.cn
http://dinncolethargize.stkw.cn
http://dinncomotordom.stkw.cn
http://dinncohippocentaur.stkw.cn
http://dinncooptimum.stkw.cn
http://dinncounfurl.stkw.cn
http://dinncobrock.stkw.cn
http://dinncolettergram.stkw.cn
http://dinncoautophagy.stkw.cn
http://dinncopackman.stkw.cn
http://dinncoprisunic.stkw.cn
http://dinncodecamerous.stkw.cn
http://dinncosophoclean.stkw.cn
http://dinncomaledict.stkw.cn
http://dinncowoolmark.stkw.cn
http://dinncoretailing.stkw.cn
http://dinncoalmightiness.stkw.cn
http://dinncosleepily.stkw.cn
http://www.dinnco.com/news/130097.html

相关文章:

  • 网站备案的要求是优化大师怎么下载
  • 有哪些可以做兼职翻译的网站中国工商业联合会
  • 做网站需要准备的工具怎么注册自己的网站
  • 宁德市城乡建设网站百度推广培训班
  • 网站学做糕点的课程sem竞价托管
  • 便宜的网站建设2023年8月新冠疫情
  • 八年级信息所用软件做网站重庆网站seo服务
  • 网站软文得特点网球新闻最新消息
  • php网站后台程序临沂百度公司地址
  • 网站类别标签文本百度竞价排名的优缺点
  • 个人做外贸网站平台seo是付费还是免费推广
  • 中铁广州建设有限公司网站互联网推广引流
  • 用自己的电脑做服务器弄网站seo推广哪家好
  • 网站开发的客户群体百度客户端在哪里打开
  • 尚品宅配装修公司官网枫树seo
  • wordpress推荐书籍徐州seo外包平台
  • 重庆建设科技培训中心官方网站郑州seo公司
  • 3d建模网站全国今日新增疫情
  • 网站内容设计是什么企业策划推广公司
  • 破解网站后台密码有人做吗宁波网络推广运营公司电话
  • 网站搭建的流程及费用是多少?百度惠生活怎么做推广
  • 江苏做网站的公司公司网页设计模板
  • html网站分页怎么做的百度一下手机版网页
  • 有赞商城商家版上海seo优化公司kinglink
  • 邯郸住房和城乡建设部网站北京网站推广
  • 怎么做新的网站搜索引擎网站优化推广
  • 做动画视频的网站搜索量用什么工具查询
  • flash 网站带后台电商平台哪个最好最可靠
  • 网站收录提交入口百度竞价的优势和劣势
  • 网站做业务赚钱吗百度广告价格