]> Zhao Yanbai Git Server - kernel.git/commitdiff
修复当扩展分区为windows扩展分区时解析分区表失败的问题
authoracevest <zhaoyanbai@126.com>
Sun, 22 Sep 2024 04:11:56 +0000 (12:11 +0800)
committeracevest <zhaoyanbai@126.com>
Sun, 22 Sep 2024 04:11:56 +0000 (12:11 +0800)
drivers/ata.c

index 66158977ae2a327f8a5f0512146bfbcd2b07d8d9..bf6f8be7a7feca080db7757b79d0c40194465268 100644 (file)
@@ -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个字节