Linux 驱动程序
千雅爸爸
爱生活,爱编程;每天一小步,总有新高度;500mi 勇闯天涯,勇创辉煌
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c语言指针相关的提纲
c语言指针相关的提纲 1:指针 是什么,如何声明和使用 指针就是地址,一般是指向变量的头地址 星号✳️,声明时候表示是指针,使用的时候表明是对象 int *a = c; *a = 1; 2: 指针 和 数组 只要是可以用数组下标的都是可以用指针的 3: 字符数组,这里因为c语言没有string 类型 char a[] char a* 这两个都是表示的字符数组 4: 指针 和 函数 两个方面要注意⚠️ 4.1 实参和形参的区别 4.2 结构的使用里面使用指针,比...原创 2020-10-08 08:39:43 · 328 阅读 · 0 评论 -
Linux 系统对中断的处理
1:寄存器的状态保存在栈中 2:中断中断,中断谁?中断正在运行的进程或者是线程 Linux 中 资源分配的单位是进行,调度的单位是线程 3:ARM 芯片 属于精简指令集计算机 RISC ,他所用的指令比较简单 对内存只有读写的指令 对于数据的运算是在cpu内部实现的 使用risc 指令的cpu 复杂度小一点,易于设计 4:执行a+b的几个步骤都要保证 读取a 读取b cpu中计算a+b 写入到a的寄存器中 步骤中 代码,数据,cpu内部寄存器 都不要被修改,cpu内部寄存器 保存在栈中,保存的这些值,我们称原创 2020-09-07 23:44:16 · 381 阅读 · 0 评论 -
linux pinctrl 子系统和 gpio子系统
GPIO 子系统和Pinctrl 子系统 首先介绍Pinctrl 之前都是直接操作寄存器,这里相当于通过Pinctrl 进行了一层封装,将引脚的复用和设置都通过Pinctrl 来操作,主要是给GPIO I2C 系统使用的,可以理解为之前的IOMUX 复用控制器 Pinctrl 可以分为Pin ctroller 和Client device Pin Controller 只是一个概念和命名,实际上可能并没有,这里需要和GPIO Controller 进行却别,Pin Controller 用来设置引脚工作在G原创 2020-09-07 00:42:32 · 546 阅读 · 0 评论 -
linux 中断处理流程
奶奶带小孩的案例 1: 1:中断源 2:初始化 3:中断处理的流程 4:中断向量原创 2020-09-03 23:13:07 · 440 阅读 · 0 评论 -
mark
1: EOF Please use " ctrl + d" 2: exception: 9.c:9:28: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration] printf("isdigit(c) = %d",isdigit(c)); #include <stdio.h> int main(){ printf("please input char\n");...原创 2020-08-06 00:25:37 · 376 阅读 · 0 评论 -
linux devicetree
1: test # ls /sys/firmware/ devicetree fdt 2: /sys/firmware/devicetree目录下是以目录结构程现的dtb文件, 根节点对应base目录, 每一个节点对应一个目录, 每一个属性对应一个文件。这些属性的值如果是字符串,可以使用cat命令把它打印出来;对于数值,可以用hexdump把它打印出来。一个单板启动时,u-boot先运行,它的作用是启动内核。U-boot会把内核和设备树文件都读入内存,然后启动内核。在启动内核时会把设备树在内存中.原创 2020-08-04 09:50:21 · 424 阅读 · 0 评论 -
hello Linux module FIrst
#include <linux/module.h> #include <linux/fs.h> #include <linux/errno.h> #include <linux/miscdevice.h> #include <linux/kernel.h> #include <linux/major.h> #include <linux/mutex.h> #include <linux/proc_fs.h> #.原创 2020-07-26 23:05:33 · 348 阅读 · 0 评论 -
Ubuntu Environment setup
1: sudo apt-get install putty 2: sudo putty . if not sudo, it will can not connect 3: update serial configuration input "/dev/ttyUSB0" for Serial line to connect to input 115200 for serial line speed select "None" for Flow control and Parity input 8 f原创 2020-07-24 16:29:02 · 430 阅读 · 0 评论 -
linux 驱动第4课 - 文件io
https://ke.qq.com/course/466167?taid=4166603608890615 1: ls -al/dev 下面显示的第一个字母如果是c 代表的是字符设备,b 代表的是块设备 2: 后面的 信息里面,第一个是主设备好,第二个是次设备号 root@iZrj9e3565o1e423gw4xgiZ:~# ls -al /dev total 4 drwxr-xr-x 18 root root 3740 Jun 24 02:31 . drwxr-xr-x 25 r..原创 2020-06-30 23:51:59 · 348 阅读 · 0 评论 -
《linux 驱动第3课》Makefile 的使用
makefile 的作用高效的编译,减少不必要的编译,只编译涉及到的文件 一个简单的规则:依赖里面有修改了 那么执行下面的命令,千万要记得 前面要有tab而不是空格,这里怎么判断呢 就是判断 taeget的时间和依赖文件的时间对比 target :依赖 tab:命令 test:main.o sub.o gcc -o test main.o sub.o 保存为Makefile 执行的两个条件 : 依赖比目标新,目标还没有生成 执行 直接执行make命令就可以了 2: 为.原创 2020-06-29 23:15:14 · 336 阅读 · 0 评论 -
《Linux 驱动 学习 -2》 gcc 编译器学习
https://ke.qq.com/course/466167?taid=4166586429021431 https://book.100ask.org/documentation/6-2/6-2.html main.c #include <stdio.h> #include "sub.h" int main(int argc, char *argv[]){ int i; printf("main fun\n"); sub_fun();原创 2020-06-29 00:07:16 · 534 阅读 · 0 评论 -
《Linux 驱动学习 - 1 》hello world 没有那么简单
https://ke.qq.com/course/466167?taid=4166582134054135 #include <stdio.h> /* * 执行命令 ./hello kodulf * argc = 2 * argv[0] = ./hello * argv[1] = kodulf * */ int main(int argc, char **argv){ if(argc >= 2){ printf(.原创 2020-06-28 08:07:47 · 333 阅读 · 0 评论 -
ubuntu 和linux 上面git clone 的时候内存不足导致失败的最完美解决 index-pack died of signal
warning: redirecting to https://android.googlesource.com/kernel/goldfish.git/ remote: Sending approximately 1.60 GiB ... remote: Counting objects: 119, done remote: Finding sources: 100% (119/119) error: index-pack died of signal 9451266), 563.58 MiB |.原创 2020-06-24 03:06:46 · 3100 阅读 · 0 评论 -
ubuntu 上下载编写
学习的老罗的: https://blog.youkuaiyun.com/Luoshengyang/article/details/6559955 1: 遇到的第一个问题 sudo apt-get installgit-core gnupg 运行失败: ubuntu进行apt-get时候出现Package ssh is not available, but is referred to by another package 错误 今天在ubuntu进行ssh安装的时候,出现如下错误。 Re...原创 2020-06-24 00:49:00 · 507 阅读 · 0 评论 -
如何编写驱动程序
1:确定主设备好 2:定义自己的file_oprations 结构体 3: 实现对应的 open/read/write 等函数,填入file_oprations 结构体 4: 把file_oprations 结构体告诉内核,注册驱动程序 register_chrdev 5: 谁来注册驱动程序呢?得有一个入口函数,安装驱动程序时,就会去调用这个入口函数 6: 出口函数,就会去调用这个出口函数 7: 其他完善,提供设备信息,自动创建设备节点 ...原创 2020-06-19 01:16:52 · 1508 阅读 · 0 评论
分享