上一页 1 2 3 4 5 6 7 ··· 22 下一页
摘要: 本文介绍 Linux 内核内存分配函数devm_kmalloc()和devm_kzalloc()。 一、devm_kmalloc 文件:drivers/base/devres.c,定义如下: void * devm_kmalloc(struct device *dev, size_t size, g 阅读全文
posted @ 2021-07-14 10:49 不明白就去明白 阅读(2216) 评论(0) 推荐(0) 编辑
摘要: const 变量能被其他文件 extern 引用吗?为什么? 先来看一段代码: // 来源:公众号编程珠玑 // main.cc #include<stdio.h> // 引用外部定义的const_int变量 extern const int const_int; int main() { prin 阅读全文
posted @ 2021-07-13 14:52 不明白就去明白 阅读(194) 评论(0) 推荐(0) 编辑
摘要: led实验中的led_init, static int __init led_init(void) { int ret = 0; /* 设置LED所使用的GPIO */ /* 1、获取设备节点:gpioled */ gpioled.nd = of_find_node_by_path("/gpiole 阅读全文
posted @ 2021-07-07 11:12 不明白就去明白 阅读(355) 评论(0) 推荐(0) 编辑
摘要: static int __init chrdevbase_init(void) { printk(KERN_EMERG"chrdevbase_init\r\n"); return 0; } static void __exit chrdevbase_exit(void) { printk(KERN_ 阅读全文
posted @ 2021-06-29 18:02 不明白就去明白 阅读(657) 评论(0) 推荐(0) 编辑
摘要: 1 KERNELDIR:=/home/wss/work/linux/develop_imx6ull/linux_6ull_develop/ 2 3 CURRENT_PATH:=$(shell pwd) 4 5 obj-m:=chrdevbase.o 6 7 build:kernel_modules 阅读全文
posted @ 2021-06-29 16:53 不明白就去明白 阅读(2250) 评论(0) 推荐(0) 编辑
摘要: 比如重新编译busybox,①找到/output/build/busybox-1.29.3 这个文件夹,此文件夹就是解压后的 busybox 源码 然后进入这个目录。按自己的要求修改文件,然后②删除这个目录下的.stamp_built和.stamp_target_installed. 除了以上两个文 阅读全文
posted @ 2021-06-29 14:16 不明白就去明白 阅读(2680) 评论(0) 推荐(0) 编辑
摘要: 根据正点原子的移植教程移植完成并成功运行,这是前提。 但是自己用buildroot做的rootfs,把qt的库放到里边,运行测试程序缺报错 qt.qpa.plugin: Could not load the Qt platform plugin "linuxfb" in "/usr/lib/arm- 阅读全文
posted @ 2021-06-21 17:15 不明白就去明白 阅读(1279) 评论(0) 推荐(0) 编辑
摘要: 注释drivers/video/console/fbcon.c 两个函数里的内容 static void fb_flashcursor(struct work_struct *work) static void fbcon_cursor(struct vc_data *vc, int mode) 重 阅读全文
posted @ 2021-06-11 09:34 不明白就去明白 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 这种错误的原因是shell脚本文件在windown下编辑,然后行尾带/r/n,而linux下的/n。 使用 cat -A xxx.sh 可以看到 解决办法: sed -i 's/\r$//' xxx.sh 阅读全文
posted @ 2021-06-09 11:25 不明白就去明白 阅读(838) 评论(0) 推荐(0) 编辑
摘要: 前面已经讲到,变量名只能包含数字、字母和下划线,因为某些包含其他字符的变量有特殊含义,这样的变量被称为特殊变量。 例如,$ 表示当前Shell进程的ID,即pid,看下面的代码: $echo $$ 运行结果 29949 特殊变量列表 变量含义 $0 当前脚本的文件名 $n 传递给脚本或函数的参数。n 阅读全文
posted @ 2021-06-07 15:44 不明白就去明白 阅读(271) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 22 下一页