随笔 - 192,  文章 - 0,  评论 - 2,  阅读 - 25万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
02 2019 档案
字符设备驱动框架
摘要:字符设备驱动框架 #include <linux/init.h> //定义了module_init#include <linux/module.h> //最基本的头文件,其中定义了MODULE_LICENSE这一类宏#include <linux/fs.h> // file_operations结构 阅读全文
posted @ 2019-02-26 11:33 Malphite 阅读(409) 评论(0) 推荐(0) 编辑
linux do{} while(0)
摘要:do{}while(0) 在linux中,经常会看到do{}while(0)这样的语句,许多人开始都会疑惑,认为do{}while(0)毫无意义,因为它只会执行一次,加不加do{}while(0)效果是一样的,其实do{}while(0) 的用法主要在于宏定义中。 这里用一个简单的宏来演示: #de 阅读全文
posted @ 2019-02-24 19:22 Malphite 阅读(1415) 评论(0) 推荐(0) 编辑
rootfs 制作
摘要:最小 根文件系统 (1)/dev/console(终端控制台, 提供标准输入、标准输出以及标准错误) /dev/null (表示空设备终端, 所有写到这个文件中的数据都会被丢弃掉。) (2)init进程的程序(也就是busybox,因为init程序位于busybox中,已经完成) (3)/etc/i 阅读全文
posted @ 2019-02-23 12:28 Malphite 阅读(1854) 评论(0) 推荐(0) 编辑
git 使用方法
摘要:1、本地回退 git reset --hard commit_id 2、下载branch code git clone -b branch_name URL 3、查看已经暂存起来的变化 git diff --cached 4、stash当前修改 git stash 5、重新应用缓存的stash gi 阅读全文
posted @ 2019-02-20 14:08 Malphite 阅读(139) 评论(0) 推荐(0) 编辑
linux c 输出信息到console
摘要:static void console_log(const char *format, ...) { static FILE *fpConsole; if (fpConsole == NULL) { fpConsole = fopen("/dev/console", "w"); } if (fpConsole != NULL) { char aMsg[3584... 阅读全文
posted @ 2019-02-20 11:31 Malphite 阅读(883) 评论(0) 推荐(0) 编辑
linux c 获取console 结果
摘要:getLine(char *line, const char *cmd) { FILE *pf = popen(cmd, "r"); if (pf == NULL) { return -1; } fgets(line, 25, pf); if (strlen(line) > 0) { if (line[strlen(line) - 1] == '\n') ... 阅读全文
posted @ 2019-02-20 11:26 Malphite 阅读(489) 评论(0) 推荐(0) 编辑
Makefile 中 -rpath -rpath-link
摘要:-rpath和-rpath-link 假设有3个文件,在同一目录下,有这样的依赖关系 test->liba.so->libd.so 如果编译test的时候这样写 gcc test.c –la warning:libd.so, needed by liba.so not found 解决办法有3个 方 阅读全文
posted @ 2019-02-20 11:21 Malphite 阅读(6739) 评论(0) 推荐(0) 编辑
shell中括号的特殊用法 linux if多条件判断
摘要:一. bash [ ] 单双括号 一. bash [ ] 单双括号 基本要素: Ø [ ] 两个符号左右都要有空格分隔 Ø 内部操作符与操作变量之间要有空格:如 [ “a” = “b” ] Ø 字符串比较中,> < 需要写成\> \< 进行转义 Ø [ ] 中字符串或者${}变量尽量使用"" 双引号 阅读全文
posted @ 2019-02-12 09:39 Malphite 阅读(1759) 评论(0) 推荐(0) 编辑
uboot kernel 博客
摘要:https://blog.csdn.net/zqixiao_09/ https://home.cnblogs.com/u/lifexy/ https://blog.csdn.net/chenliang0224 阅读全文
posted @ 2019-02-01 10:30 Malphite 阅读(143) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示