引导程序的大小
|
我正在阅读brokenthorn.com的O / S开发教程,是其中一个教程,下面的代码在那里。
http://www.brokenthorn.com/Resources/OSDev3.html
我不明白为什么这段代码会清除510个字节。代码中也有org,bits,cli,hlt。是否应该将其更改为少于510字节?可能是拼写错误吗?
谢谢。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;*********************************************
; Boot1.asm
; - A Simple Bootloader
;
; Operating Systems Development Tutorial
;*********************************************
org 0x7c00 ; We are loaded by BIOS at 0x7C00
bits 16 ; We are still in 16 bit Real Mode
Start:
cli ; Clear all Interrupts
hlt ; halt the system
times 510 - ($-$$) db 0 ; We have to be 512 bytes. Clear the rest of the bytes with 0
dw 0xAA55 ; Boot Signiture
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
没有找到相关结果
已邀请:
2 个回复
舞备联
是当前位置,而
是该节的开始,因此它会清除
个字节。 这将从512字节的限制中最多正确填充两个字节,并将签名放在最后两个字节上。
骂狮淋唐便