操作系统开发 [英] Operating System Development

查看:83
本文介绍了操作系统开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个开源操作系统,我的启动扇区如下所示


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-(


-


这篇关于操作系统开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆