|
debug中做的引导程序,在进入保护模式时遇到问题,请指点,谢谢!
jmp 3e
这里是引导测试代码,测试正常,请看下一个问题。
[0]
mov ax,4f02h
mov bx,118h
int 10h
mov ax,0a000h
mov gs,ax
mov ax,4f05h
mov bx,0
mov dx,3
int 10h
xor di,di
mov ax,4488h
mov dl,77h
mov cx,2345h
mov gs:[di],al
inc di
mov gs:[di],ah
inc di
mov gs:[di],dl
inc di
dec cx
cmp cx,0
jnz 60h
mov ah,0
int 16h
cmp ah,1
jnz 72
从这里开始进入保护模式。
所有的数据都是已知的(加载到0:7c00开始运行)应该不用初始化了吧。
lgdt [0144] 请问这里是否正确?
cli
in al,92h
or al,2
out 92h,al
mov eax,00000011h
mov cr0,eax
db 66 ea a0 7d 00 00 08 00 请问这个跳转到01a0+7c00对不对?
GDT表对不对?
[0]
00 00 00 00 00 00 00 00-ff ff 00 00 00 98 00 00
ff ff 00 80 0b 92 00 00-ff ff 00 00 00 92 00 00
ff ff 00 00 00 92 00 00-ff ff 00 00 00 92 00 00
ff ff 00 00 00 92 00 00-ff ff 00 00 00 92 00 00
[0]
40 00 04 7d 00 00
这里段基址(7c00+0104)和界限对不对?
[0] :进入保护模式后向b800段写数据,请问是否正确?
mov ax,0010h
mov es,ax
mov ds,ax
mov gs,ax
mov fs,ax
mov ss,ax
mov bp,ax
mov sp,ax
mov di,ax
[01b3]:
mov gs:[di],ax
inc di
jmp 01b3 |
|