【问题标题】:Bootloader help... why is USB drive booting even without boot signature?引导加载程序帮助...为什么即使没有引导签名,USB 驱动器也会引导?
【发布时间】:2011-04-08 19:24:42
【问题描述】:

我正在阅读这篇关于如何从软盘启动的文章:http://www.cs.umbc.edu/portal/help/nasm/boot.shtml

我将在这里给出代码:

; boot1.asm   stand alone program for floppy boot sector
; Compiled using            nasm -f bin boot1.asm
; Written to floppy with    dd if=boot1 of=/dev/fd0

; Boot record is loaded at 0000:7C00,
    ORG 7C00h
; load message address into SI register:
    LEA SI,[msg]
; screen function:
    MOV AH,0Eh
print:  MOV AL,[SI]         
    CMP AL,0         
    JZ done     ; zero byte at end of string
    INT 10h     ; write character to screen.    
        INC SI         
    JMP print

; wait for 'any key':
done:   MOV AH,0       
        INT 16h     ; waits for key press
            ; AL is ASCII code or zero
            ; AH is keyboard code

; store magic value at 0040h:0072h to reboot:
;       0000h - cold boot.
;       1234h - warm boot.
    MOV  AX,0040h
    MOV  DS,AX
    MOV  word[0072h],0000h   ; cold boot.
    JMP  0FFFFh:0000h    ; reboot!

msg     DB  'Welcome, I have control of the computer.',13,10
    DB  'Press any key to reboot.',13,10
    DB  '(after removing the floppy)',13,10,0
; end boot1

我使用 nasm 组装它,然后使用 dd 将其复制到 USB 驱动器。然后我重新启动了系统,它工作得很好。我的问题是,为什么即使我们没有在第 511 个字节定义 0xaa55 也能正常工作?请向我解释一下。还有,什么是冷启动和热启动?请给我一个很好的链接,在那里我可以详细了解启动过程...


编辑: 感谢您的回复!但我发现为什么在这种情况下会发生这种情况。那是我前段时间让这个驱动器可以启动,之后又格式化了很多次。原来格式不影响MBR。因此,当我使用 lde 打印驱动器内容的十六进制转储时,我发现签名仍然存在。现在我删除了它,从驱动器启动显示错误“找不到操作系统”。

【问题讨论】:

  • 当 0072:0000 的值为 0 时,计算机执行更多的开机自检 (POST)。如果值为 1234h,则完成的 POST 较少。特别是,将值设置为 1234h 将绕过启动内存测试。

标签: assembly bootstrapping


【解决方案1】:

这取决于您计算机的 BIOS。许多 BIOS 实现不需要 AA55 签名来启动软盘,并且由于 USB 驱动器既不是软盘也不是硬盘驱动器,因此由 BIOS 决定它应该被视为哪个。我猜你的 BIOS 不需要软盘签名,并将 USB 驱动器视为软盘驱动器,这意味着它也不需要 USB 驱动器的签名。

请参阅 Jim 的评论了解冷启动和热启动之间的区别。

【讨论】:

    猜你喜欢
    • 2012-04-12
    • 2021-12-29
    • 2020-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    • 2011-03-29
    • 1970-01-01
    相关资源
    最近更新 更多