C Kernel - Works fine on VM but not actual computer?

前端 未结 1 1998
我寻月下人不归
我寻月下人不归 2021-01-14 08:00

I am making a basic C kernel. (Loaded by an assembly program) I am compiling it with an i686-elf cross compiler for windows. My C code is as follows:

void c         


        
相关标签:
1条回答
  • 2021-01-14 08:37

    You're not initializing the segment registers. Try changing the start of your bootsector to something like this:

    xor ax, ax
    mov bp, 0x9000
    mov ds, ax
    mov es, ax
    mov ss, ax ; disables interrupts until the end of the next instruction
    mov sp, bp
    mov [BOOT_DRIVE], dl
    
    0 讨论(0)
提交回复
热议问题