
《Orange's》上篇代码注释版
文章平均质量分 75
array020
这个作者很懒,什么都没留下…
展开
-
boot/boot.asm
;By Marcus Xing;boot/boot.asm,程序必须小于等于510字节;加载LOADER.BIN,并把控制权交给LOADER;----------------------------------------------------------------------调试的预处理;%define _BOOT_DEBUG_ ; 做 Boot Sector 时一定将此行注释掉原创 2010-03-22 15:09:00 · 2440 阅读 · 0 评论 -
kernel/global.c
/* By Marcus Xing kernel/global.c 全局变量的分配*/#include "type.h"#include "const.h"#include "protect.h"#include "console.h"#include "tty.h"#include "proc.h"#include "proto.h"原创 2010-03-23 08:54:00 · 501 阅读 · 0 评论 -
kernel/init_8253.c
/* By Marcus Xing kernel/init_8253.c 设置8253,控制2次时钟中断发生的间隙*/#include "type.h"#include "const.h"#include "console.h"#include "tty.h"#include "protect.h"#include "proc.h"#include原创 2010-03-23 08:58:00 · 574 阅读 · 0 评论 -
kernel/init_8259a.c
/* By Marcus Xing kernel/init_8259a.c 初始化8259A的函数*/#include "type.h"#include "const.h"#include "console.h"#include "tty.h"#include "protect.h"#include "proc.h"#include "proto.h原创 2010-03-23 08:58:00 · 548 阅读 · 0 评论 -
kernel/keyboard.c
/* By Marcus Xing kernel/keyboard.c 与键盘的输入输出有关的代码*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "globa原创 2010-03-23 09:00:00 · 1318 阅读 · 0 评论 -
kernel/proc.c
/* By Marcus Xing kernel/proc.c 与进程有关的处理在此*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global.h"#in原创 2010-03-23 09:02:00 · 809 阅读 · 0 评论 -
kernel/protect.c
/* By Marcus Xing kernel/protect.c 有关保护模式的函数*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global.h"#原创 2010-03-23 09:03:00 · 519 阅读 · 0 评论 -
kernel/system_call.c
/* By Marcus Xing kernel/system_call.c 各功能号的处理函数如下*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global原创 2010-03-23 09:04:00 · 521 阅读 · 0 评论 -
kernel/tty.c
/* By Marcus Xing kernel/tty.c 处理终端的代码*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global.h"#includ原创 2010-03-23 09:07:00 · 721 阅读 · 0 评论 -
lib/lib_kernel_in_c.c
/* By Marcus Xing lib/lib_kernel_in_c.c 内核中用C写的功能函数*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "globa原创 2010-03-23 09:07:00 · 607 阅读 · 0 评论 -
lib/lib_kernel_in_asm.asm
;By Marcus Xing;lib/lib_kernel_in_asm.asm;内核中用到的用汇编写的工具函数;注意,有些函数使用了IO操作,根据当前特权级和EFLAG的相应限制使用;---------------------------------------------------------------------global集合global Disp_Str原创 2010-03-23 09:16:00 · 807 阅读 · 0 评论 -
makefile.boot
#makefile for boot#this programTARGET = boot/boot.bin boot/loader.bin#programs,flags,etcASM = nasmASMFLAGS = -I boot/include/#PHONY for boot.PHONY:everything clean all buildimg原创 2010-03-23 09:17:00 · 1179 阅读 · 0 评论 -
makefile.kernel
#makefile for kernelENTRYPOINT=0x30400#Programs,flags,etcASM=nasmCC=gccLD=ldASMFLAGS=-f elfCFLAGS=-I include/ -c -fno-builtin -fno-stack-protectorLDFLAGS=-Ttext $(ENTRYPOINT) -s原创 2010-03-23 09:18:00 · 554 阅读 · 0 评论 -
kernel/console.c
/* By Marcus Xing kernel/console.c 与控制台有关的函数*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global.h"#原创 2010-03-23 08:53:00 · 1382 阅读 · 0 评论 -
kernel/clock.c
/* By Marcus Xing kernel/clock.c 时钟中断调用的函数*/#include "type.h"#include "const.h"#include "protect.h"#include "proc.h"#include "console.h"#include "tty.h"#include "global.h"#in原创 2010-03-23 08:51:00 · 626 阅读 · 0 评论 -
boot/loader.asm
;By Marcus Xing;boot/loader.asm;加载原始KERNEL.BIN,在保护模式下分析ELF把各;段转移到对应的虚拟地址上,并把控制权交给KERNELorg 0100h%include "pm.inc";-------------------------------------------------------------------------------宏原创 2010-03-22 15:34:00 · 863 阅读 · 0 评论 -
boot/include/lib_in_protect_mode.inc
;By Marcus Xing;boot/include/lib_in_protect_mode.inc;在boot/loader.asm中保护模式下使用的函数;------------------------------------------------------------------------Disp_StrDisp_Str:;C函数原型(保护模式模式下调用,短调用):;void原创 2010-03-22 15:56:00 · 529 阅读 · 0 评论 -
boot/include/lib_in_real_mode.inc
;By Marcus Xing;boot/include/lib_in_real_mode.inc;在boot/loader.asm中在实模式下调用的函数;--------------------------------------------------------------------Read_SectorRead_Sector:;C函数原型(实模式下调用,短调用):;void Read原创 2010-03-22 16:12:00 · 457 阅读 · 0 评论 -
boot/include/pm.inc
;By Marcus Xing;boot/include/pm.inc;保护模式下的宏定义,供boot文件夹下的文件使用 ; 描述符类型DA_32 EQU 4000h ; 32 位段DA_LIMIT_4K EQU 8000h ; 粒度4K DA_DPL0 EQU 00h ; DPL = 0DA_DPL1 EQU 20h ; DPL原创 2010-03-22 16:14:00 · 924 阅读 · 0 评论 -
include/global.h
/* By Marcus Xing include/global.h 包含全局变量的声明*//* forward include: type.h const.h protect.h proc.h console.h tty.h*/#ifndef _GLOBAL_H_#define _GLOBAL_H_原创 2010-03-22 16:29:00 · 2857 阅读 · 0 评论 -
include/keyboard.h
/* By Marcus Xing include/keyboard.h 键盘有关的信息*//* forward include: type.h*/#ifndef _KEYBOARD_H_#define _KEYBOARD_H_ /* 8042的各端口值 */ #define OUT_BUFFER_8042 0x60 /* 输出缓冲原创 2010-03-22 16:33:00 · 2487 阅读 · 0 评论 -
include/keymap.h
/* By Marcus Xing include/keymap.h 扫描码映射表定义*/ #ifndef _KEYMAP_H_ #define _KEYMAP_H_ /* forward include: type.h keyboard.h*/ /* Keymap for US MF-2 keyboard原创 2010-03-22 16:38:00 · 642 阅读 · 0 评论 -
include/proc.h
/* By Marcus Xing include/proc.h 与进程有关的头文件*//* forward include: type.h protect.h*/#ifndef _PROC_H_#define _PROC_H_ #define MAX_PROC 50 /* 进程的最大个数 */ #define ST原创 2010-03-22 16:40:00 · 846 阅读 · 0 评论 -
include/protect.h
/* By Marcus Xing include/protect.h 在内核使用的有关保护模式的数据结构*//* forward include: type.h*/#ifndef _PROTECT_H_#define _PROTECT_H_ /* 外中断向量号 */ #define INT_VECTOR_IRQ0 0x20原创 2010-03-22 16:41:00 · 734 阅读 · 0 评论 -
include/proto.h
/* By Marcus Xing include/proto.h 原型集合*//* forward include: type.h console.h tty.h protect.h proc.h*/#ifndef _PROTO_H_#define _PROTO_H_ /* 打印一个字符串 */ void Disp_Str原创 2010-03-22 16:42:00 · 1386 阅读 · 0 评论 -
include/tty.h
/* By Marcus Xing include/tty.h 与终端有关的信息*//* forward include: type.h console.h*/#ifndef _TTY_H_#define _TTY_H_ #define TTY_BUFFER_SIZE 64 /* TTY输入缓冲区大小 */ #define原创 2010-03-22 16:43:00 · 532 阅读 · 0 评论 -
include/type.h
/* By Marcus Xing include/type.h 在内核中需要的类型的定义*//* forward include:none*/#ifndef _TYPE_H_#define _TYPE_H_ /* 数据类型定义,为的是能一眼就看出数据的位数 注意此处都为无符号类型 */ typedef unsig原创 2010-03-22 16:43:00 · 786 阅读 · 0 评论 -
/kernel/kernel.asm
;By Marcus Xing;/kernel/kernel.asm;内核的入口,以及进行后续的一系列工作;----------------------------------------------------------------------------EQUSelector_Kernel_Flat_RW equ 8 ;内核中GDT的FLAT_RW段选择子Sel原创 2010-03-25 19:10:00 · 870 阅读 · 0 评论