![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
kernel
畏天
心之所向,身之所往
展开
-
linux kernel学习笔记(hrtimer使用示例)
#include <linux/module.h>#include <linux/hrtimer.h>struct hrtimer timer;int called_cnt = 0;static enum hrtimer_restart monitor_handler(struct hrtimer * hrtimer){ printk("timer function called %d times\n", ++called_cnt); hrtimer_forwar原创 2020-12-14 13:41:02 · 416 阅读 · 0 评论 -
linux kernel学习笔记(打印所有进程部分信息)
//task_struct.c#include <linux/init.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/init_task.h>#include <linux/sched.h>MODULE_LICENSE("GPL");static int __init print_pid(void){ int task_cnt = 0;原创 2020-12-10 15:49:19 · 675 阅读 · 0 评论 -
内核学习笔记(打印,加载,卸载)
helloword.c#include <linux/init.h>#include <linux/kernel.h>#include <linux/module.h>static int __init lkm_init(void){ printk("hello world\n"); return 0;}static void __exit lkm_exit(void){ printk("bye bye\n");}module_init(l原创 2020-11-12 10:41:05 · 193 阅读 · 0 评论