From: acevest Date: Sun, 22 Sep 2024 04:11:56 +0000 (+0800) Subject: 修复当扩展分区为windows扩展分区时解析分区表失败的问题 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=fef22335982cdc813cbb539959dcfa2c2a3cc947;p=kernel.git 修复当扩展分区为windows扩展分区时解析分区表失败的问题 --- diff --git a/drivers/ata.c b/drivers/ata.c index 6615897..bf6f8be 100644 --- a/drivers/ata.c +++ b/drivers/ata.c @@ -387,7 +387,7 @@ void read_partition_table(ide_drive_t *drv, uint32_t mbr_ext_offset, uint32_t lb // 用于计算保存下一个分区的起始位置 uint32_t lba_offset = 0; - if (0x05 == pt.type) { + if (0x05 == pt.type || 0x0F /*W95 扩展 (LBA)*/ == pt.type) { assert(lba_extended_partition == 0); // 最多只允许有一个扩展分区 mbr_ext_offset = mbr_ext_offset != 0 ? mbr_ext_offset : pt.lba_start; uint32_t offset = depth == 0 ? lba_partition_table : pt.lba_start; @@ -402,7 +402,9 @@ void read_partition_table(ide_drive_t *drv, uint32_t mbr_ext_offset, uint32_t lb part->lba_start = lba_offset; uint32_t size = pt.lba_end; part->lba_end = part->lba_start + size; + ENTER_CRITICAL_ZONE; printk("part[%02d] %02X %10u %-10u\n", part_id, pt.type, lba_offset, part->lba_end - 1); + EXIT_CRITICAL_ZONE; } // 每个分区16个字节