linux_device_drivers_tutorial:Linux设备驱动程序教程

  • e3_445044
    了解作者
  • 17.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-02 21:43
    上传日期
Linux设备驱动程序教程 嗨,这是多个教学Linux内核模块的纲要,我之所以这样做,是因为很多人说LDD本书太复杂了,下面是一系列可能有用的示例。 在我看来,对于真正的新手来说,这是一个不错的开始。Linux模块开发者WAS(过去有目的地)Linux内核模块编程指南( )。 但是,本指南基于Kernel 2.6 ..,它与3 ..内核有很多不赞成使用的部分。 好吧,这个项目试图将该指南的源代码更新为最新的内核版本(请尽可能进行更新和改进),希望,如果许多人同意该指南将按照其作者的意愿进行更新。 设置: 费朵拉 下载所有内核开发包(对于Fedora): https://fedoraproject.org/wiki/Building_a_custom_kernel 您可能对livna.repo有问题,请暂时将其删除 CentOS的 如果是CentOS: yum -y grou
linux_device_drivers_tutorial-master.zip
  • linux_device_drivers_tutorial-master
  • Dockerfile
    338B
  • .gitignore
    36B
  • README.md
    1.9KB
  • LICENSE
    17.6KB
  • src
  • jiffies_1.c
    1019B
  • null_pointer.c
    293B
  • hello-3.c
    540B
  • led.h
    232B
  • char_simple.c
    3.9KB
  • hello-2.c
    558B
  • led.c
    4.8KB
  • timer_hiresolution.c
    980B
  • timer_simple.c
    790B
  • hello_simple.c
    490B
  • scripts
  • build-kernel.sh
    146B
  • Makefile
    273B
内容介绍
# Linux Device Drivers Tutorial Hi, this is a compendium of multiple didactic Linux Kernel modules, I am doing this due to the fact that many times somebody says that the LDD book is too complicated, well here is a series of examples that might be helpful. In my opinion a really good start for really newbies Linux Modules Developers WAS (past time on purpose) The Linux Kernel Module Programming Guide (http://www.tldp.org/LDP/lkmpg/2.6/html/). However, this guide is based on the Kernel 2.6.. which has many deprecated parts in relationship with the 3.~ kernel Well this project tries to update the source code of that guide to the latest a version of the kernel (please update and improve as possible), hopefully, if many folks agree the guide will be updated, just as its authors wanted. ## SET UP: * Fedora Download all the kernel dev packages (in case of Fedora): https://fedoraproject.org/wiki/Building_a_custom_kernel You might have some problems with the livna.repo, please temporary remove it * CentOS In case of CentOS: ``` yum -y groupinstall "Development Tools" yum -y install ncurses-devel \ hmaccalc \ zlib-devel \ binutils-devel \ elfutils-libelf-devel \ bc \ openssl-devel \ kernel-devel \ kernel-headers ``` ### BUILD KERNEL If you want to build the kernel we have a Dockerfile image, just run: ``` make iamge docker run build_kernel:latest ``` Is important to customize a shared volume to copy the kernel uimage, the build_kernel docker image just build the upstream kernel (adjust the git clone to your needs) ## BUILD MODULES: 1) make MODULE="<name_of_module>" // DO NOT add the .c, just the name of the module. If no name is passed the makefile will build the basic hello world module 2) make clean: will clean the module ## INSTALL MODULES: insmod module.ko modprobe module.ko REMOVE: rmmod module Check printk message: dmesg or cat /var/log/syslog
评论
    相关推荐