在使用GRUB作为引导加载程序进行了数周的工作后,我决定自己动手做,以便我了解它们的工作原理。我在互联网上找到了Brokenthorn的教程(当前在http://www.brokenthorn.com/Resources/OSDev9.html上)。当我尝试切换到保护模式时,cpu硬件会在跳远后重置。我正在运行bochs v。2.6。
这是我的第二阶段引导程序(几乎是本教程的副本,因为我认为它可以解决我的问题-不会)
bits 16
; Remember the memory map-- 0x500 through 0x7bff is unused above the BIOS data area.
; We are loaded at 0x500 (0x50:0)
org 0x50:0x0
jmp main ; go to start
;*******************************************************
; Preprocessor directives
;*******************************************************
%include "Gdt.inc" ; Gdt routines
;*******************************************************
; Data Section
;*******************************************************
;*******************************************************
; STAGE 2 ENTRY POINT
;
; -Store BIOS information
; -Load Kernel
; -Install GDT; go into protected mode (pmode)
; -Jump to Stage 3
;******************************************************* …Run Code Online (Sandbox Code Playgroud)