摘要:实模式下,堆栈宽度是2byte保护模式下, 堆栈宽度是 4byte属于满递减堆栈
阅读全文
摘要:标致寄存器eflags内存管理寄存器控制寄存器段选择符段描述符通用格式 代码段描述符,数据段描述符,系统段描述符存在位P=0是的段描述符代码段,数据段type字段系统段和门描述符type字段页目录和页表调用门描述符中断门,陷阱门,任务门描述符 tss段描述符
阅读全文
摘要:boot.s简单的引导程序,head.s简单内核,makefile内容如下# Makefile for the simple example kernel.AS86 =as86 -0 -aLD86 =ld86 -0AS =asLD =ldLDFLAGS =-m elf_i386 -Ttext 0 -e startup_32 -s -x -M all: ImageImage: boot system dd bs=32 if=boot of=Image skip=1 objcopy -O binary system head cat head >> Imagedisk: Image d
阅读全文
摘要:1 ;%define _BOOT_DEBUG_ ; 制作 Boot Sector 时一定将此行注释掉! 2 ; 去掉此行注释后可做成.COM文件易于调试: 3 ; nasm Boot.asm -o Boot.com 4 5 %ifdef _BOOT_DEBUG_ 6 org 0100h ; 调试状态, 做成 .COM 文件, 可调试 7 %else 8 org 07c00h ; BIOS 将把 Boot Sector 加载到 0:7C00 处 9 %endif10 11...
阅读全文
摘要:这是一段i386的引导代码,无org 1 mov ax, cs 2 mov ds, ax 3 mov es, ax 4 mov ax, 0b800h 5 mov gs, ax 6 mov al, 65 7 8 call DispStr ; 调用显示字符串例程 9 jmp $ ; 无限循环10 DispStr:11 mov ax, BootMessage12 mov bp, ax ; ES:BP = 串地址13 mov cx, 16 ...
阅读全文