小编Mak*_*ese的帖子

在 QEmu 中使用简单引导扇区从磁盘读取不正确的字节

所以我正在尝试学习如何制作一个小操作系统,主要是使用这个教程。

我在该教程的第 28 页,正在尝试做一个小磁盘加载器。

但是,当我运行qemu-system-i386 boot_sector.bin适用于前面的引导扇区示例的 时,我得到的十六进制输出是0xDADA 0xZRWV,其中第一个是正确的,而第二个则不正确。

我的代码如下。

引导扇区.asm

; Very simple boot sector to read sectors from disk

jmp main        ; ensures that we start where we want to

%include "disk_load.asm"

BOOT_DRIVE:
  db 0

[org 0x7c00]    ; tell the assembler where this code will be loaded

main:
  mov   bp, 0x8000        ; Make sure the stack is out of our way
  mov   sp, bp

  mov   bx, 0x9000
  mov   dh, 2             ; Want to …
Run Code Online (Sandbox Code Playgroud)

boot assembly operating-system qemu nasm

4
推荐指数
1
解决办法
209
查看次数

标签 统计

assembly ×1

boot ×1

nasm ×1

operating-system ×1

qemu ×1