ExFAT boot sector checksum简单介绍

在测试各种卡的时候,遇到这样的一个error:ExFAT: Invalid boot sector checksum.  Was 0x123, should be 0x8b165b50.
摘要由CSDN通过智能技术生成

在测试各种卡插拔测试的时候,遇到这样的一个error:

ExFAT: Invalid boot sector checksum.  Was 0x12345678, should be 0x87654321.

这个error会导致系统弹出提示框


“You need to format the disk in driver J: before you can use it. Do you want to format it?”

于是很好奇什么是boot sector checksum,是否真的是boot sector checksum错误导致这样的error。


        要了解ExFat中的boot sector checksum,首先需要了解MBR,因为只有正确解析了MBR这个sector,才可以找到ExFAT boot sector的位置。MBR的细节可以参考:http://en.wikipedia.org/wiki/Master_boot_record#PTE

这里我们只看Classical Generic的版本,参考下图:

Structure of a classical generic MBR
Address Description Size
(bytes)
Hex Dec
+000h +0 Bootstrap code area 446
+1BEh +446 Partition entry #1 Partition table
(for primary partitions)
16
+1CEh +462 Partition entry #2 16
+1DEh +478 Partition entry #3 16
+1EEh +494 Partition entry #4 16
+1FEh +510 55h Boot signature[a] 2
+1FFh +511 AAh
Total size: 446 + 4×16 + 2 512
可以看到其中的boot signature是 0x55AA,partion entry从0x1BE开始,最多支持4个partition entry。其中的每个partion entry的格式如下(16 byte):

Layout of one 16-byte partition entry [13] (all multi-byte fields are little-endian)
Offset
(bytes)
Field
length
Description
+0h   1 byte status / physical drive (bit 7 set: active / bootable, old MBRs only accept 80h), 00h: inactive,01h7Fh: invalid)[a]
+1h   3 bytes CHS address of first absolute sector in partition.[b] The format is described by 3 bytes, see the next 3 rows.
  +1h 1 byte
h7–0 head[c]
x x x x x x x x
  +2h 1 byte
c9–8 s5–0 sector in bits 5–0; bits 7–6 are high bits of cylinder
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值