摘要:
/** 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 阅读全文
摘要:
/** 该文件的两个函数是为了向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 阅读全文
摘要:
/** 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) 阅读全文
摘要:
## 这段代码被连接到system模块的最前面,这也是它为什么称之为head.s的原因。# 从这里开始内核完全运行在保护模式下。head.s采用的是at&t格式的# 汇编。注意的是代码中的赋值方向是从左到右。## 这段程序实际上是出于内存的绝对地址0开始处。首先是加载各个数据段寄存器。# 重新设置全局描述符表gdt --> 检测a20地址线是否真的开启,没有开启,loop# 掉了 --> 检测pc是否含有数学协处理器 --> 设置管理内存分页的处理机制 --># 将页目录放置在内存地址0开始处。所以这段程序将被覆盖掉。 - 阅读全文