摘要: 到http://git-scm.com/ 下载git安装程序。 直接双击进行安装。 安装完成后启动Git Bash 进入命令行界面: 执行git clone命令拷贝linux源代码,git版本库地址是: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git http://git.kernel.org/pub/sc... 阅读全文
posted @ 2011-07-18 20:59 justinzhang 阅读(6832) 评论(1) 推荐(0) 编辑
摘要: A master boot record (MBR) is a type of boot sector popularized by the IBM Personal Computer.[1] It consists of a sequence of 512 bytes located at the first sector of a data storage device such as a h... 阅读全文
posted @ 2011-07-18 20:52 justinzhang 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 在一个c文件中定义一个变量,在另外的c文件中引用该文件中的变量,变量默认是extern的,也就是对外部可见的,如果使用了static声明,那么这个变量就是对这个文件可见,其他模块是不可见的: 如下例: 阅读全文
posted @ 2011-07-18 20:41 justinzhang 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 对二维指针进行sizeof运算是什么意思呢?(c08:Quoter.cpp)屏幕剪辑的捕获时间: 2011-07-17 10:19得到的结果如下所示:Sizeof quotes = 36,正好是指针的大小×一维指针的个数,sizeof *quotes是计算一维指针的大小,所以对二维指针进行sizeof 运算,得到的结果是二维指针中包含的一维指针的个数×一位指针的长度。 阅读全文
posted @ 2011-07-18 20:38 justinzhang 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 一、定义 1.原码 正数的符号位为0,负数的符号位为1,其它位按照一般的方法来表示数的绝对值。用这样的表示方法得到的就是数的原码。 【例2.13】当机器字长为8位二进制数时: X=+1011011 [X]原码=01011011 Y=+1011011 [Y]原码=11011011 [+1]原码=00000001 [-1]原码=10000001 [+127]原码=01111111 [-127]原码=1... 阅读全文
posted @ 2011-07-18 20:36 justinzhang 阅读(5856) 评论(0) 推荐(1) 编辑
摘要: 有如下代码: 1: #include <stdio.h> 2: 3: #include <string.h> 4: 5: #include <malloc.h> 6: 7: #include <stdlib.h> 8: 9: typedef struct AA 10: 11: { 12: 13: int b1:5; 14: 15: int b2:2; 16: 17: }AA; 18: 19: in... 阅读全文
posted @ 2011-07-18 20:30 justinzhang 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 1. /kernel/irq.c softirq_init 2.6.32.25 1.1 for_each_possible_cpu for ( ( ( cpu ) ) = - 1 ; ( ( cpu ) ) = cpumask_next ( ( ( cpu ) ) , ( cpu_possible_mask ) ) , ( ( cpu ) ) < nr_cpu_ids ; ) 1.2 per_cp... 阅读全文
posted @ 2011-07-18 20:16 justinzhang 阅读(916) 评论(0) 推荐(0) 编辑
摘要: 调用spin_lock_irqsave(&chip->lock,flags); 的下层实现是什么?#define spin_lock_irqsave(lock, flags) \do { \typecheck(unsigned long, flags); \flags = _spin_lock_irqsave(lock); \} while (0) 1: /* 2: 3: * Check at c... 阅读全文
posted @ 2011-07-18 20:10 justinzhang 阅读(3244) 评论(0) 推荐(0) 编辑
摘要: /* * 2011年4月8日22:49:50 * 作者:张超 * email:uestczhangchao@gmail.com * Linux2.6.32.25中如何获得当前进程的指针? */ //Thread_info.h //申明per_cpu_kernel_stack变量,它在其它位置定义,见下文内容. 1: DECLARE_PER_CPU(unsigned long, kernel_st... 阅读全文
posted @ 2011-07-18 20:03 justinzhang 阅读(2074) 评论(0) 推荐(0) 编辑
摘要: 问:请教各位大侠:《深入理解linux内核》中,内核同步章节有这样一段话保护可延迟函数(软中断)所访问的数据结构应采取的措施:单处理器上:在单处理器上不存在竞争条件,这是因为可延迟函数(软中断)的执行总是在一个CPU上串行执行--也就是说,一个可延迟函数不会被另一个可延迟函数中断。因此,根本不需要同步原语。 我觉得不太对啊,一个软中断虽然不会被另一个软中断“中断”,但是可能被硬中断“中断”,而硬中... 阅读全文
posted @ 2011-07-18 19:48 justinzhang 阅读(365) 评论(0) 推荐(0) 编辑