gpt4 book ai didi

windows - 是否有任何 FAT FS 驱动程序希望引导扇区的字节 508 和 509 为零?

转载 作者:行者123 更新时间:2023-12-03 11:05:54 25 4
gpt4 key购买 nike

在执行 my own boot sector loaders starting in 2012 时我确保将偏移量 508 和 509 处的字节归零。这些是标准 512 字节大小扇区的倒数第四个和倒数第三个字节。这是我放在那里的:

    _fill 508,38,start 

dw 0
; 2-byte magic bootsector signature
dw 0AA55h

我现在不记得这方面的任何具体来源,但我相信我添加了两个零字节是为了增加与某些或其他操作系统驱动程序的兼容性。我一定是在某个时候了解到这可能是必需的。

翻阅文档“Microsoft Extensible Firmware Initiative - FAT32 File System Specification - FAT: General Overview of On-Disk Format - Version 1.03, December 6, 2000”没有得到关于字节 508 和 509 的任何信息。在页面上13 它指出:

There is one other important note about Sector 0 of a FAT volume. If we consider the contents of thesector as a byte array, it must be true that sector[510] equals 0x55, and sector[511] equals 0xAA.

NOTE: Many FAT documents mistakenly say that this 0xAA55 signature occupies the "last 2 bytesof the boot sector". This statement is correct if — and only if — BPB_BytsPerSec is 512. IfBPB_BytsPerSec is greater than 512, the offsets of these signature bytes do not change (although it isperfectly OK for the last two bytes at the end of the boot sector to also contain this signature).

最接近于谈论字节 508 和 509 的是第 22 页对 FAT32 的 FSINFO 结构的描述:

FSI_TrailSig 508 4

Value 0xAA550000. This trail signature is used to validate that this is in fact an FSInfo sector. Note that the high 2 bytes of thisvalue—which go into the bytes at offsets 510 and 511—match thesignature bytes used at the same offsets in sector 0.

但并没有规定整个双字都要匹配引导扇区中的这个签名。

现代 FreeDOS 引导扇区加载器 does provide these two bytes as zeros也是:

       times   0x01f1-$+$$ db 0

filename db "KERNEL SYS",0,0

sign dw 0xAA55

页面"An Examination of theMSWIN4.1 OS Boot Record"将 MS Windows 4.x 引导扇区描述为两个字节也为零。在标题为“数据位置和内存中的错误消息”最后一行包含这些零:

7DF0  00 57 49 4E 42 4F 4F 54 20 53 59 53 00 00 55 AA   .WINBOOT SYS..U.

这些零字节是有原因的还是都是 cargo 崇拜的一个例子?

最佳答案

只要查看所有 FreeDOS 内核的引导扇区加载程序的状态,我就会在他们的另一个文件中发现一个特定的声明。这是在the LBA FAT32 loader :

       times 0x01ee-$+$$ db 0

msg_BootError db "No "
; currently, only "kernel.sys not found" gives a message,
; but read errors in data or root or fat sectors do not.

filename db "KERNEL SYS"

sign dw 0, 0xAA55
; Win9x uses all 4 bytes as magic value here.

关于windows - 是否有任何 FAT FS 驱动程序希望引导扇区的字节 508 和 509 为零?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64145890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com