摘要: /** linux/fs/fcntl.c** (C) 1991 Linus Torvalds*/#include <string.h>#include <errno.h>#include <linux/sched.h>#include <linux/kernel.h>#include <asm/segment.h>#include <fcntl.h>#include <sys/stat.h>exter 阅读全文
posted @ 2010-02-16 09:13 qiang.xu 阅读(526) 评论(0) 推荐(0) 编辑
摘要: /** 该文件的两个函数是为了向open和write函数提供接口,实现内核数据* 和用户数据的交互*//** linux/fs/block_dev.c** (C) 1991 Linus Torvalds*/#include <errno.h>#include <linux/sched.h>#include <linux/kernel.h>#include <asm/segment.h>#include <asm/system.h>/** | block 阅读全文
posted @ 2010-02-16 09:12 qiang.xu 阅读(690) 评论(0) 推荐(0) 编辑
摘要: /** linux/fs/bitmap.c** (C) 1991 Linus Torvalds*//* bitmap.c contains the code that handles the inode and block bitmaps */#include <string.h>#include <linux/sched.h>#include <linux/kernel.h> // 一些内核常用函数的原形定义/* 将指定地址(addr)处的一块内存清零 */#define clear_block(addr) 阅读全文
posted @ 2010-02-16 09:10 qiang.xu 阅读(1846) 评论(0) 推荐(0) 编辑
摘要: ## 这段代码被连接到system模块的最前面,这也是它为什么称之为head.s的原因。# 从这里开始内核完全运行在保护模式下。head.s采用的是at&t格式的# 汇编。注意的是代码中的赋值方向是从左到右。## 这段程序实际上是出于内存的绝对地址0开始处。首先是加载各个数据段寄存器。# 重新设置全局描述符表gdt --> 检测a20地址线是否真的开启,没有开启,loop# 掉了 --> 检测pc是否含有数学协处理器 --> 设置管理内存分页的处理机制 --># 将页目录放置在内存地址0开始处。所以这段程序将被覆盖掉。 - 阅读全文
posted @ 2010-02-16 09:07 qiang.xu 阅读(1519) 评论(0) 推荐(0) 编辑
摘要: Have you ever gotten that classic job interview question,"where do you see yourself in five years?"When asked, I'm always mentally transported back toa certain Twisted Sister video from 1984.I want you to tell me -- no, better yet, stand up andtell the class--what do you wanna do with 阅读全文
posted @ 2010-02-14 18:07 qiang.xu 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1. “按位与”运算符(&) 参加运算的两个数据,按二进位进行“与”运算。原则是全1为1,有0为0,即:0&0=0; 0&1=0; 1&0=0; 1&1=1; 如下例: a=5&3; //a=(0b 0101) & (0b 0011) =0b 0001 =1 那么如果参加运算的两个数为负数,又该如何算呢?会以其补码形式表示的二进制数来进行与运算。 a=-5&-3; //a=(0b 阅读全文
posted @ 2010-02-12 23:53 qiang.xu 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 一个老工程师的心理话:诸位,俺当工程师十余年了,从研发到管理!回顾工程师生涯,感慨万千,愿意讲几句掏心窝子的话,也算给兄弟姐妹提个醒,希望他们比咱们强!1.提高自己的专业知识,扩大自己的知识面,学习他人的经验,少走弯路。请教要虚心。2.好好规划自己的路,不要跟着感觉走!根据个人的理想决策安排,绝大部分人并不指望成为什么院士或教授,而是希望活得滋润一些,爽一些。那么,就需要慎 重安排自己的轨迹。从哪个行业入手,逐渐对该行业深入了解,不要频繁跳槽,特别是不要为了一点工资而转移阵地,从长远看,这点钱根本不算什么,当你对一个 行业有那么几年的体会,以后钱根本不是问题。频繁地动荡不是上策,最后你对哪个行 阅读全文
posted @ 2010-02-12 12:21 qiang.xu 阅读(359) 评论(0) 推荐(0) 编辑
摘要: /** 该文件主要是实现do_execve函数,主要是实现对于二进制文件的加载执行* 和shell脚本文件的加载执行*//** linux/fs/exec.c** (C) 1991 Linus Torvalds*//** #!-checking implemented by tytso.*//** Demand-loading implemented 01.12.91 - no need to read anything but* the header into memory. The inode of the executable is put into* "current-&am 阅读全文
posted @ 2010-02-09 22:53 qiang.xu 阅读(1537) 评论(0) 推荐(0) 编辑
摘要: /** linux/fs/file_dev.c** (C) 1991 Linus Torvalds*/#include <errno.h>#include <fcntl.h>#include <linux/sched.h>#include <linux/kernel.h>#include <asm/segment.h>#define MIN(a,b) (((a)<(b))?(a):(b))#define MAX(a,b) (((a)& 阅读全文
posted @ 2010-02-08 11:16 qiang.xu 阅读(613) 评论(0) 推荐(0) 编辑
摘要: /** 该文件中的两个函数read_pipe和write_pipe是上层函数* read和write的底层实现*//** linux/fs/pipe.c** (C) 1991 Linus Torvalds*/#include <signal.h>#include <linux/sched.h>// 内存管理头文件。含有页面大小定义和一些页面释放函数原型#include <linux/mm.h> /* for get_free_page */#include <asm/segment.h&g 阅读全文
posted @ 2010-02-08 11:13 qiang.xu 阅读(1465) 评论(0) 推荐(0) 编辑
摘要: /** buffer.c 程序用于对高速缓冲区(池)进行操作和管理。高速缓冲* 区位于内核代码和主内存区之间。** |---|---|------------------|---------------------|-------------------|* | | | * * * | buffer | |* |---|---|------------------|---------------------|-------------------|* | /|\* |------------------------------------|* \|/* buffer_head 阅读全文
posted @ 2010-02-08 11:10 qiang.xu 阅读(1487) 评论(0) 推荐(0) 编辑
摘要: /** linux/fs/char_dev.c** (C) 1991 Linus Torvalds*/#include <errno.h>#include <sys/types.h> // 定义了基本的系统数据类型#include <linux/sched.h>#include <linux/kernel.h> // 含有一些内核常用函数的原形定义#include <asm/segment.h>#include <asm/io.h&g 阅读全文
posted @ 2010-02-08 11:08 qiang.xu 阅读(682) 评论(0) 推荐(0) 编辑
摘要: /** 该文件实现系统调用read,write和lseek。*//** linux/fs/read_write.c** (C) 1991 Linus Torvalds*/#include <sys/stat.h>#include <errno.h>#include <sys/types.h>#include <linux/kernel.h>#include <linux/sched.h>#include <asm/segment.h& 阅读全文
posted @ 2010-02-08 11:07 qiang.xu 阅读(1441) 评论(0) 推荐(0) 编辑
摘要: /** 该文件主要实现的是truncate函数,该函数是释放指定i* 节点在设备上占用的所有逻辑块,包括直接块、一次间* 接块和二次间接块*//** linux/fs/truncate.c** (C) 1991 Linus Torvalds*/#include <linux/sched.h>#include <sys/stat.h>/* 释放一次间接块,参数int dev, int block指明一次间接块的设备号 */static void free_ind(int dev,int block){ struct buffer_head 阅读全文
posted @ 2010-02-08 11:05 qiang.xu 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: 文件可能比较长,呵呵。/** linux/fs/namei.c** (C) 1991 Linus Torvalds*//** Some corrections by tytso.*/#include <linux/sched.h>#include <linux/kernel.h>#include <asm/segment.h>#include <string.h>#include <fcntl.h>#include <errno.h& 阅读全文
posted @ 2010-02-06 22:53 qiang.xu 阅读(1330) 评论(0) 推荐(0) 编辑