+ -
当前位置:首页 → 问答吧 → 寻高手 帮忙看os引导写错到那里了

寻高手 帮忙看os引导写错到那里了

时间:2011-11-05

来源:互联网

为什么   我跳到   保护模式   以后   要显示的那个a   没有显示出来呀

org   07c00h
mov   ax,cs
mov   ds,ax
mov   es,ax
mov   ax,LoadMsg
call   DisplayMsg

lgdt   [gdtr]
cli
in   al,92h
or   al,00000010b
out   92h,al
mov   eax,cr0
or   eax,1
mov   cr0,eax

jmp   dword   Code32:0

Code32:
mov   ax,8h
mov   gs,ax
mov   edi,(80*10+0)*2
mov   ah,0ch
mov   al, 'b '
mov   [gs:edi],ax

jmp   $
DisplayMsg:
;mov   ax,LoadMsg
mov   bp,ax
mov   cx,18
mov   bx,000ch
mov   dl,010h
mov   dh,dl
mov   ax,01301h
int   10h
ret
LoadMsg:   db   "Load   system   ...... "


gdt:
      dd 0,0,0,0

      dw 0002h
      dw 8000h
      dw 920bh
      dw 00c0h
gdtr:
dw     $   -   gdt
dd gdt
times   510   -   (   $   -   $$)   db   1
dw     0xaa55

作者: rentiansheng   发布时间: 2011-11-05

lgdt [gdtr] 
----------
这句应该是
lgdt [gdt] 

作者: Areslee   发布时间: 2011-11-06