; Made by HotHeart
; MENUET RUN 0.4
; 1) 缺省目录 /RD/1/
; 2) 可以更改程序目录,在SETUP里设置硬盘后可以运行
; 硬盘上的程序
; 3) 只能访问根目录
; 4) 自动根据屏幕大小调整窗口位置(限任务栏为文字模式)
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ;
阅读全文 »
中断大全
http://www.ctyme.com/intr/int.htm
操 作系统资源(英文)
http://www.nondot.org/sabre/os/articles
内核版之OS设 计
http://www.linuxforum.net/forum/printthread.php?Ca ... mp;main=334068&type=thread
Linux的一些Kernel资源
http://diy-os.gro.clinux.org/file.html
纯 C论坛文档资源中心
在写自己的操作系统时,不能总在实模式下,进入保护模式才是"正道",不过怎么进入保护模式又是一个问题,我把
XuOS里进入保护模式的代码分析一下.
; 装入GDT
mov eax,ds ;设置GDT在物理内存中的正确位置
shl eax,4
add [gdt_addr+2],eax
cli ; 关中断
lgdt [gdt_addr] ;载入GDT
; 下面打开A20地址线,这段代码可以在OSzone上找到相关解释.
call Empty_8042
mov al,0xd1
out 0x64,al
call Empty_8042
mov al,0xdf
out 0x60,al
call Empty_8042
; 进入保护模式
mov eax,cr0 ;置PE位
or eax,1
mov cr0,eax
jmp oscodesel:code_32 ; 跳到32位代码处执行
Empty_8042:
in …
阅读全文 »
这是转载的,原文可以在http://www.xemean.net的文档中心里找到.
因为原文中的代码编译后运行有错误,这里我把改过后能正确运行的代码讲一下
org 0x07c00 ; 起始地址是0000:7c00
jmp begin_boot ; 跳过其它的数据,跳转到引导程序的开始处
OEM_ID db "OSeg " ;软盘信息,具体请参考"FAT格式"
BytesPerSector dw 0x0200
SectorsPerCluster db 0x01
ReservedSectors dw 0x0001
TotalFATs db 0x02
MaxRootEntries dw 0x00E0
TotalSectorsSmall dw 0x0B40
MediaDescriptor db 0xF0
SectorsPerFAT dw 0x0009
SectorsPerTrack dw 0x0012
NumHeads dw 0x0002
HiddenSectors dd 0x00000000…
阅读全文 »
近期评论