
Linux
Loopers
操作系统爱好者
展开
-
内存模拟块设备驱动程序设计
/*既然上面分析了,块设备的工作原理。 那如何写一个块设备呢?*//*怎么写一个块设备驱动程序?* 1. 分配一个gendisk结构,用alloc_disk函数* 2. 分配一个request队列,用blk_init_queue函数* 3. 设置gendisk结构* 3.1 设置主设备号,次设备号* 3.2 设置block_device_operations结构* 3.3 设置qu原创 2015-02-04 11:43:02 · 946 阅读 · 0 评论 -
块设备工作原理分析
/*分析 块设备的工作原理*/void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]){ int i; for (i = 0; i < nr; i++) { struct buffer_head *bh = bhs[i]; if (!trylock_buffer(bh)) continue; //写操作原创 2015-02-03 19:31:57 · 971 阅读 · 0 评论 -
Linux内核双向循环链表分析
#include struct list_head{ struct list_head *next; struct list_head *prev;};struct score{ int num; int math; struct list_head list; };#define list_for_each(pos, head) \ for (pos = (he原创 2015-02-09 13:34:18 · 757 阅读 · 0 评论 -
双向循环链表分析设计之三
#include #include #include typedef char D_Char;typedef int D_Int;typedef struct _D_List D_List;struct _D_List{ D_List *prev; D_List *next;};typedef struct{ D_List list; D_Char name原创 2015-02-09 19:00:30 · 713 阅读 · 0 评论 -
双向循环链表设计分析之四
#include #include #include typedef unsigned char D_U8;typedef unsigned short D_U16;typedef unsigned int D_U32;typedef struct _D_List D_List;struct _D_List{ D_List *prev; D_List *next;}原创 2015-02-09 19:23:14 · 587 阅读 · 0 评论 -
双向循环链表设计分析之五
#include #include #include typedef unsigned char D_U8;typedef unsigned short D_U16;typedef unsigned int D_U32;typedef struct _D_List D_List;struct _D_List{ D_List *prev; D_List *next;}原创 2015-02-09 19:39:34 · 523 阅读 · 0 评论 -
双向循环链表设计分析之二
#include #include #include typedef char D_Char;typedef int D_Int;typedef struct _D_List D_List;struct _D_List{ D_List *prev; D_List *next;};typedef struct{ D_List list; D_Char name原创 2015-02-09 18:46:54 · 585 阅读 · 0 评论 -
双向循环链表设计分析之一
#include #include #include typedef char D_Char;typedef int D_Int;typedef struct _D_List D_List;struct _D_List{ D_List *prev; D_List *next;};typedef struct{ D_List list; D_Char name原创 2015-02-09 18:41:29 · 506 阅读 · 0 评论 -
使用 rtcwake 定时唤醒休眠的linux
原文地址: http://www.tuicool.com/articles/ryIFFrJ1.功能作用 rtcwake是利用电脑主板上带的rtc来作为定时基准,在给定的时间唤醒处于待机或休眠状态的电脑。 2.位置 /usr/sbin/rtcwake 3.格式用法 rtcwake[options] 4.主要参数-d, –device select rtc转载 2016-03-15 15:24:56 · 9245 阅读 · 0 评论