小编Ces*_*rod的帖子

使用gdb和QEMU调试bootloader/bios时如何跳过中断调用?

出于教育目的,我已经从mikeos.berlios.de/write-your-own-os.html改编了这个引导加载程序,将其重写为专门加载地址0x7c00.

最终的代码是这样的:

[BITS 16]           ; Tells nasm to build 16 bits code
[ORG 0x7C00]        ; The address the code will start

start: 
    mov ax, 0       ; Reserves 4Kbytes after the bootloader
    add ax, 288 ; (4096 + 512)/ 16 bytes per paragraph 
    mov ss, ax 
    mov sp, 4096 
mov ax, 0   ; Sets the data segment 
    mov ds, ax 
    mov si, texto   ; Sets the text position 
    call imprime    ; Calls the printing routine
jmp $       ; Infinite …
Run Code Online (Sandbox Code Playgroud)

assembly gdb qemu bootloader

5
推荐指数
2
解决办法
2458
查看次数

标签 统计

assembly ×1

bootloader ×1

gdb ×1

qemu ×1