2024年4月27日
摘要: 在学习linux设备驱动时遇到的问题,请求大佬指点: 1、 insmod char_dev.ko 2、 mknod /dev/mydevice c 240 0 3、 ./test write 返回-1, 内核没有调用的 device_write 函数。 char_dev.c #include <li 阅读全文
posted @ 2024-04-27 15:45 gaozy6626 阅读(22) 评论(0) 推荐(0) 编辑
  2024年1月5日
摘要: 1 /* 2 * This creates a new process as a copy of the old one, 3 * but does not actually start it yet. 4 * 5 * It copies the registers, and all the app 阅读全文
posted @ 2024-01-05 19:09 gaozy6626 阅读(25) 评论(0) 推荐(0) 编辑
  2023年8月22日
摘要: fork 是linux创建进程的系统调用,相关的函数(不只是系统调用)还有 vfork,clone,sys_frok等。这些函数会整理不同参数,再调用到 do_fork 中。 本篇文章主要介绍do_fork 函数。(sys_call_table 是 系统调用表, fork -> syscall(nu 阅读全文
posted @ 2023-08-22 22:39 gaozy6626 阅读(34) 评论(0) 推荐(1) 编辑
  2021年3月27日
摘要: 16、保证异常安全 1 void PrettyMenu::changBackground(std::istream &imgSrc) 2 { 3 lock(&mutex); 4 delete bgImage; 5 ++imageChanges; 6 bgImage = new Image(imgSr 阅读全文
posted @ 2021-03-27 11:00 gaozy6626 阅读(23) 评论(0) 推荐(0) 编辑
  2021年3月6日
摘要: 1、尽量以const,enum,inline替换#define 对于变量, const 更容易定位问题, const 可能会使代码交少。 相比 const char* const author = "Scott"; const std::string author("Scott"); 更好一些。 宏 阅读全文
posted @ 2021-03-06 16:53 gaozy6626 阅读(50) 评论(0) 推荐(0) 编辑