linux2.6驱动编程第一例:hello,world的实现步骤

linux内核编程(hello world示例程序) linux内核编程(hello world) Linux可加载内核模块是 Linux 内核的最重要创新之一。它们提供了可伸缩的、动态的内核。其它开发者可以不用重新编译整个内核便可以开发内核层的程序,极大方便了驱动程序等的开发速度。 本系列文章主要是记录个人从hello world开始,通过学习linux内核基本编程操作,再对ipvs负载均衡器源码进行初步学习分析;最后,基于netfil 阅读详情

按照《linux设备驱动开发详解》一书中的步骤实现经典例子"hello,world!"的例子。具体步骤如下:

遇到的问题:

  不知道如何生成.ko内核模块文件,在2.4下,直接#gcc -c hello.c 生成hello.o文件就可以#insmod hello.o,但在2.6中必须生成.ko文件,这又需要你根据具体情况编写Makefile文件。

具体步骤如下
1.编写代码:
/*
* hello.c -- the example of printf "hello world!" in the screen of driver program
*/
#include <linux/init.h>
#include <linux/module.h>

MODULE_LICENSE("Dual BSD/GPL");/* declare the license of the module ,it is necessary */

static int hello_init(void)
{
printk(KERN_ALERT "Hello World enter!/n");
return 0;
}

static int hello_exit(void)
{
printk(KERN_ALERT "Hello world exit!/n");
}

module_init(hello_init); /* load the module */
module_exit(hello_exit); /* unload the module */

/* before is some decription of the model,not necessary */
MODULE_AUTHOR("YJ Hou");
MODULE_DESCRIPTION("This is an example of programming driver!");
MODULE_ALIAS(“a simplest module”);

2.编译代码:
在代码的目录下建立一个Makefile文件,将下面的语句写入其中:
obj-m := hello.o
执行如下命令编译代码:
make -C /home/hyj/linux2.6/ M=/home/hyj/driver/ modules
注意:这里的/home/hyj/linux2.6/是内核源码树的目录,/home/hyj/driver/是你要放置编译文件的目录。我的源文件和编译好的文件都在这个目录下,建议大家要放在同一目录下哦,不然可能出错。
编译完成后将出现下列代码:

[hyj@localhost driver]$ make -C /home/hyj/linux-2.6 M=/home/hyj/driver
make: Entering directory `/home/hyj/linux-2.6'
CC [M] /home/hyj/driver/hello.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/hyj/driver/hello.mod.o
LD [M] /home/hyj/driver/hello.ko
make: Leaving directory `/home/hyj/linux-2.6'

这时就表示编译成功,在目录下将产生hello.ko文件。


3.执行代码,加载驱动模块:
insmod ./hello.ko即可加载模块。
有的朋友可能会出现insmod命令找不到的错误,这可能有下面几个原因:
<1> 你的系统没有安装module-init-tools工具,关于此问题,只需安装即可,但是一般装完系统是有这个命令的。
<2> 环境变量没有添加导致不能使用该命令。使用echo $PATH即可查看PATH环境变量,发现没有/sbin这个路径,所以你当然不能使用insmod这个命令了。解决的方法很简单,只需在命令行输入:
PATH = "$PATH:/sbin"即可添加。(insmod在/sbin这个目录下,你可以使用whereis insmod查看)。
<3> insmod这个命令需要在root权限下才能使用。
加载完成后你可以输入lsmod查看hello这个模块哦。

[root@localhost driver]# insmod ./hello.ko
Message from syslogd@localhost at Apr 15 09:20:03 ...
kernel: Hello,world

4.卸载驱动模块:rmmod hello.

加载模块后就可在屏幕上看到如下信息:Hello world enter.
卸载时就可在屏幕上看到如下信息:hello world exit.

[root@localhost driver]# rmmod hello
[root@localhost driver]#
Message from syslogd@localhost at Apr 15 09:20:47 ...
kernel: Goodbye,cruel world

什么?我执行的时候竟然什么也没有,既没有报错,也没有任何输入?
这时你可以在/var/log/messages这个文件中看到以上输出信息(使用cat /var/log/messages一般在最下面几行)。
那么怎么才能在屏幕上打印出这些信息呢?
这时你必须对源文件做如下修改:
<1> 将"printk(KERN_ALERT "Hello World enter!/n");”一句中的“KERN_ALERT”换成"KERN_EMERG"以提高内核打印的优先级(0);
<2> 同理将printk(KERN_ALERT "Hello world exit!/n");改成printk(KERN_ALERT "Hello world exit!/n");
重新编译,加载,你就可在屏幕上看到输出信息了。
哈哈,总算大功告成了。

另外,如果有多个文件,则按下列方式编写Makefile文件(file1.c、file2.c):
obj -m := modulename.o
module-objs := file1.o file2.o
:0wpoi2

 

Linux设备驱动开发入门——Hello world       近期做的工作主要有两个,一是将dvsdk_4中的video_copy项目移植到自己的板子上,在参考资料极其匮乏的情况下,本人继续发扬艰苦奋斗的作风和打不死的小强精神,终于将Omap3530中的DSP成功地跑起来了。另一个工作就是开始学习Linux设备驱动开发,为编写新设备的驱动做准备。dvsdk的内容比较庞杂,所做的工作还在整理之中,后面我会发出来。Linux设备驱动开发的资料很多 阅读详情

相关推荐

openwrt 驱动 hello world

本想按照官网文档去编译驱动,发现好麻烦,不知道那步骤出了差错,死活编译不出来, 后来看了网上有一篇教程编译openwrt的应用的,发现openwrt其实就跟普通linux无差别 所以试试写用之前的驱动helloworld写了makefile,果然也是可行的 下面是最普通的驱动hello world程序 #include #include #include /* hello_i

zmy12007的专栏 911

Linux设备驱动Hello World程序介绍

本文由赵锟翻译,转载于“酷壳”:http://cocre.com/?p=566  by Valerie Henson07/05/2007(译者注:本文的例子是只能在linux的2.6内核下使用的,2.6以上的内核,译者没有做过实验,2.4是要修改make文件才能运行。)本文的出处:这里自古以来,学习一门新编程语言的第一步就是写一个打印“hello world”的程序(可以看

陈皓专栏 【空谷幽兰,心如皓月】 1万+

ubantu14.04 32位下第一个hello world驱动程序

ubantu14.04 32位下第一个hello world驱动程序 平台:ubantu14.04,内核版本: 3.13.0-32-generic 编写驱动程序时,首先必须建立内核源码树,内核源码树我现在的理解就是整个linux内核源代码编译后的形式,即下载源码后,执行make编译后的形式,它是编译驱动的前提。ubuntu系统默认情况下是没有的。先前的内核只需要有一套内核头文件

我的新博客 3440

第一个linux helloWorld驱动编译和常见问题解决

最简单的hello驱动,在make的时候出现了“empty variable name”,最后是如下原因:在Makefile中有如下一句话,出现这个错误的原因是“=”左边多了一个空格 make -C $(LINUX_SRC) SUBDIRS=$(shell pwd) modules 如果在”=”右边多一个空格,则会出现另外的错误: *** Error during update of the k

小石头 1659

PX4飞控参数详解-Multicopter Position Control​多旋翼位置控制

Maximum horizontal velocity for which position hold is enabled (use 0 to disable check)//启用悬停时的最大水平速度(使用 0 可禁用此检查)(仅适用MPC_POS_MODE 0 或 MPC_ALT_MODE 2)Maximum horizontal and vertical jerk in Position/Altitude mode//位置/高度模式下的最大水平和垂直加加速度。

u013096791的博客 1817

华为路由器静态路由配置实战:从零搭建企业级网络环境(含常见错误排查)

本文以真实企业组网案例为基础,详细解析华为路由器静态路由的实战配置流程。内容涵盖从网络拓扑规划、IP地址分配到具体的`ip route-static`命令配置,并重点讲解了缺省路由、浮动路由等进阶应用。文章还提供了系统化的排错指南,帮助网络工程师规避回程路由缺失、子网掩码错误等常见问题,是掌握企业级网络搭建与维护的实用指南。

weixin_29313817的博客 89

linux设备驱动程序--hello-world

linux字符设备驱动程序--hello_world 基于4.14内核, beagleBone green平台 PC端的设备驱动程序 有过电脑使用经验的人都知道,当我们将外部硬件设备比如鼠标键盘插入到电脑端口(通常是USB口)时,在windows系统右下角会弹出"安装设备驱动程序"的显示框,那么,为什么每个硬件都需要安装设备驱动程序才能使用呢? 首先,每个硬件都有相应的功能,鼠标的功能就...

did59261的博客 502

主板USB接口全部失效解决方案(通用串行总线USB控制器有黄色叹号)保姆级教程亲测有效

通用串行总线控制器总是有叹号解决办法 办公室的崩腾时代老电脑,疫情期间没人用,来了开机之后发现鼠标键盘都用不了,本以为是主机放时间长出了问题,后来想起来就百度了“鼠标键盘都失效”的标题,结果发现了“串行总线控制器总是感叹号”的关联问题。正好办公室电脑都装有teamviwer常用来远程办公(在家偷懒)。所以通过远程发现电脑室可以运行的。并在控制面板发现:通用串行总线控制器总是感叹号,插入外设时USB无反应。如图:​ 并且右键选中其中一个,点击最后一个选项:“属性” 可以发现“设备状态”中会提示“由...

xiao_bai_0_0的博客 2万+

linux设备驱动第二篇:构造和运行模块

printk的级别 日志级别一共有8个级别,printk的日志级别定义如下(在include/linux/kernel.h中):   #define KERN_EMERG 0/*紧急事件消息,系统崩溃之前提示,表示系统不可用*/   #define KERN_ALERT 1/*报告消息,表示必须立即采取措施*/   #define KERN_CRIT 2/*临界条件,通常涉及严重的硬件或软

haomcu的专栏 3489

【Vite+Vue3+TS】基于Vite+Vue3+TypeScript+ESLint+Prettier+Stylelint搭建项目(亲测超详细)

结合了很多项目和文章,总结一篇项目构建的笔记。 温馨提示:文章末尾记录了我在搭建项目过程中,遇到的一些问题和解决办法 ~

aDiaoYa_的博客 4231

智能体在车联网中的应用:第31天 基于RLlib的多智能体PPO实战:MAPPO算法解决simple_spread合作任务

本文介绍了如何利用RLlib框架实现多智能体强化学习算法MAPPO,解决simple_spread任务。首先分析了RLlib的架构设计理念和多智能体支持特性,包括策略映射、环境包装等核心组件。然后详细解析了simple_spread环境的任务定义、观察空间和奖励函数设计。最后回顾了MAPPO算法原理,说明其如何在RLlib中实现集中式训练与分布式执行的CTDE范式。文章提供了完整的安装指南和环境配置方法,帮助读者快速搭建多智能体强化学习实验环境。

IT深耕十余载,大道之简 1333

linux 驱动编程入门----hello world ----Makefile ---及简单的调试

// hello.c#include #include MODULE_LICENSE("Dual BSD/GPL"); static int hello_init(void) { printk(KERN_ALERT "hello world!/n"); return 0; } static void hello_exit(void) { printk(KERN_ALERT "goodbye!/n"); } module_init(hello_init);

power的专栏 2369

Vmware虚拟机克隆详解:固定ip + 修改uuid等内容

分两大步 设置固定ip 克隆后修改相关配置 本文引用的其他地方的图片。会附上链接 若侵权,删 一、设置静态ip 先进行虚拟网络的编辑 接下来的操作需要管理员权限。(给权限就完事了) 接下来设置网卡: 网络和共享中心→ 更改适配器设置→VMware Network Adapter VMnet8 -> 右键属性 修改TCP/Ipv4的配置,网上常见是这种,笔者是英文的...

Unknownfuture的博客 9070

linux2.6驱动编程第一例:hello,world的实现

《linux2.6驱动编程第一例:hello,world的实现步骤》已由 gongji110  于2008-4-14 发表于红联http://www.linuxdiyf.com,作为基于linux 2.6内核驱动开发的一个最简单也是最经典的例子,我写于此,作为对gongji110

832

YOLOv11 改进 - 注意力机制 | Deformable-LKA 可变形大核注意力:自适应采样网格优化特征捕捉,提升不规则目标感知

本文介绍了可变形大核注意力(D-LKA Attention)及其在YOLOv11中的结合。D-LKA Attention是一种简化的注意力机制,采用大卷积核利用体积上下文信息,通过可变形卷积灵活调整采样网格,适应多样数据模式。它有2D和3D版本,3D版本在跨深度数据理解上表现出色,共同构成了D-LKA Net架构。我们将D-LKA Attention集成进YOLOv11,在模型的检测头部分引入deformable_LKA_Attention模块。实验表明,该方法在分割任务上表现优于现有方法,提升了模型的检测

魔改工程师的博客 1171

用 ABAP RAP + XCO 把 Excel 导入业务对象:从弹窗 Action 到 EML 落库与附件清理的完整实践

摘要:本文介绍了在SAP RAP框架下实现Excel批量导入功能的完整方案。通过XCO库的XLSX模块解析Excel文件,结合RAP的行为定义和Fiori Elements界面集成,构建了一个支持试运行、数据校验和自动合并的业务导入功能。方案采用RAP标准范式,包括Action参数设计、EML事务处理、附件管理以及异常消息反馈,实现了从文件上传到数据落库的端到端流程,既保证了系统稳定性,又提升了业务用户体验。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 276

跟我一起学“仓颉”编程语言—仓颉语言介绍及Hello World

本章为大家详细的介绍了仓颉编程语言的特性、环境安装以及Hello World的内容。

Cool_foolisher的博客 8990

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Linux2.6驱动程序入门—Hello World

1、引言     记得在学习VC++和C语言的时候,一开始都会以一个HELLO WORLD的例子作为演示,将学者逐渐引入殿堂,这个几乎成了计算机编程语言学习必经的一个入门之路。     当然,在学习linux编程的时候也是这样,下面的例子应该是再熟悉不过了:     首先用VI编写一个C程序:vi hello.c     #include   "stdio.h"      int ma

lwe的专栏 792

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Linux设备驱动之Hello world驱动的实现

前言本文的写作对象是刚刚接触Linux设备驱动,希望能够快速上手编写一个简单设备驱动的学生或者是爱好者。读者应当对Linux操作系统有一定的了解,掌握基本的Linux系统命令。准备工作搭建Linux环境本文所使用的Linux环境为: 项目 内容 操作系统 Ubuntu 14.04 LTS 搭建时间 2015年12月 内核版本 3.16.0-30-generic 内核版本

u013686105的博客 1204

linux内核驱动与ubuntu驱动,Ubuntu下Hello World驱动实现全过程

今天是一个值得纪念的日子,我也不知道我花了多长时间才编译成功!在编写这个驱动的过程中,真的体会到驱动编程不是那么简单的~,现在有点小小的激动,真的,很不容易啊~我把整个过程在重复一遍吧!在编写这个驱动的过程中参考了网上的很多文档,最终的结果是弄的我头都晕了,每个人写的都不一样,其实我现在还有一些概念不是很清楚。1:到底丫的什么是内核源码树?2:为什么要编译内核源码树?1:内核源码树我现在的理解就是...

weixin_32509847的博客 326

Linux驱动学习之Hello World驱动

文章目录前言一、Linux驱动说明1.1 Linux驱动分类二、字符设备驱动实现2.1 设备号2.2 file_operation结构体2.3 设备操作函数2.4 设备注册和注销2.5 驱动加载和卸载2.6 入口和出口函数2.7 添加相关信息三、hello驱动 前言 linux驱动的开发一般都是在一下框架之下实现的,先从最简单的Hello World驱动开始,可以帮助我们了解Linux驱动开发的基...

NameisBoy的博客 775

【Linux】第一个驱动程序,hello world!开启驱动之旅

不涉及硬件,实现过程中熟悉驱动。

希希雾里 2133

【Linux】设备驱动开发:hello world实战

Linux设备驱动开发:hello world

梦想博客 2151
上一篇: S3C6410 SPI驱动移植
下一篇: 2410上NAND的初始化及驱动流程
willand1981
博客等级 码龄18年 136粉丝 31原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值