• 第一个Linux驱动查询:统计单词个数


    第一个Linux驱动查询:统计单词个数

    编写Linux驱动程序的步骤

    第一步:建立Linux驱动骨架(装载和卸载Linux驱动)

    第二步:注册和注销设备文件

    可以分别使用misc_register和misc_deregister函数创建和移除设备文件。

    第三步:指定与驱动相关的信息

    第四步:指回调函数

    第五步:编写业务逻辑

    第六步:编写Makefile文件

    第七步:编译Linux驱动程序

    第八步:安装和卸载Linux驱动

    1. 将Linux驱动编译进内核,只要将Linux使用该内核,驱动程序就会自动装载
    2. 如果Linux驱动程序以模块单独存在,需要使用ismod或modprobe命令装载Linux驱动模块,使用rmmod命令卸载Linux驱动模块。
    3. 查看驱动输出的日志信息:dmesg | grep 模块名| tail -n 2

    开源协议

    1. GPL协议 2.LGPL协议 3.BSD协议 4.Apache Licence2.0协议 5.MIT协议 6.MIT协议

    统计单词个数

    1. 编写Linux驱动程序前的准备工作
    2. 编写Linux驱动程序的骨架
    3. 指定与驱动相关的信息
    4. 注册和注销设备文件
    5. 指定回调函数
    6. 实现统计单词数的算法
    7. 编译、安装、卸载Linux驱动程序

    使用多种方式测试Linux驱动

    1.使用Ubuntu Linux测试Linux驱动

    2.在Android模拟器上通过原生(Native)C程序测试Linux驱动

    3.使用Android NDK测试Linux驱动

    4.使用Java代码直接操作设备文件来测试Linux驱动

    5.使用SCS6410开发板测试Linux驱动

  • 相关阅读:
    openssh升级到openssh-7.5p1踩坑
    office online server部署和简单操作
    aspnetmvc和aspnetcoremvc的一些区别
    office web app server部署和简单操作
    PHP之cURL
    认识PHP的全局变量
    认识Linux系统/etc/hosts
    git学习——stash命令(4)
    Linux netstat命令
    phpstorm+xdebug
  • 原文地址:https://www.cnblogs.com/levity/p/5562857.html
Copyright © 2020-2023  润新知