[英]Bootloader help… why is USB drive booting even without boot signature?
我正在閱讀有關如何從軟盤啟動的文章: 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打印驅動器內容的十六進制轉儲時,我發現簽名仍然存在。 現在,我將其刪除,從驅動器啟動時顯示錯誤“找不到操作系統”。
這取決於您計算機的BIOS。 許多BIOS實現不需要AA55簽名來引導軟盤,並且由於USB驅動器既不是軟盤也不是硬盤驅動器,因此BIOS決定應將其視為哪種。 我猜想您的BIOS不需要軟盤簽名,而將USB驅動器視為軟盤驅動器,這意味着它也不需要USB驅動器簽名。
有關冷啟動和熱啟動之間的區別,請參見Jim的評論。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.