操作系统开发
我正在编写一个开源操作系统,我的启动扇区如下所示
I''m writing an open source operating system and I''ve got the boot sector as follows
[BITS 16] ; We need 16-bit instructions for Real mode
[ORG 0x7C00] ; The BIOS loads the boot sector into memory location 0x7C00
mov ah, 0Eh ; We want to print a single character
mov al, 'A' ; That character is 'A'
mov bh, 0Eh ; White text on black background, not blinking
mov bl, 0 ; Page number 0
int 10h
hang:
jmp hang ; Loop, self-jump
times 510-($-$) db 0 ; Fill the rest of the files with zeros, until we reach 510 bytes
dw 0AA55h ; Our boot sector identifier
我的第一个问题-
我正在将引导扇区写为每个扇区4096个字节的硬盘.我不应该将行"times 510-($-$)db 0"更改为"times 4094-($-$)db 0". Cos我正在为每个扇区写入4096个字节.
我的第二个问题-
除了在引导扇区中填充0,然后在最后2个字节写入引导签名之外,我还可以在引导扇区中添加哪些其他信息? (而不是用0填充)
感谢
My first question -
I''m writing the boot sector for 4096 bytes per sector Hard Disks. Shouldn''t I change the line "times 510-($-$) db 0" to "times 4094-($-$) db 0". Cos I''m writing for 4096 bytes per sector.
My second question -
Instead of filling the boot sector with 0 and then writing the boot signature at the last 2 bytes, what other information can I put in the boot sector? (that''s instead of filling it with 0)
thanks
-
) db 0 ; 用零填充其余文件,直到达到510字节 dw 0AA55h ; 我们的引导扇区标识符
) db 0 ; Fill the rest of the files with zeros, until we reach 510 bytes dw 0AA55h ; Our boot sector identifier
我的第一个问题-
我正在将引导扇区写为每个扇区4096个字节的硬盘.我不应该更改行"times 510-(
My first question -
I''m writing the boot sector for 4096 bytes per sector Hard Disks. Shouldn''t I change the line "times 510-(
-