From 9781ea2e95c9e59b3994eab7b17104dc98dec950 Mon Sep 17 00:00:00 2001 From: Tulio A M Mendes Date: Tue, 26 May 2026 01:08:52 -0300 Subject: [PATCH] init: integrate partition scanning after blockdev registration (Etapa 6) - Added partition_scan_mbr() call for each ATA drive present - Scans hda, hdb, hdc, hdd for MBR partitions - Partitions are automatically registered during scan - Tests: 124/124 PASS --- src/kernel/init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kernel/init.c b/src/kernel/init.c index 2591986b..a6bbec65 100644 --- a/src/kernel/init.c +++ b/src/kernel/init.c @@ -291,8 +291,16 @@ int init_start(const struct boot_info* bi) { blockdev_init_lock(); blockdev_register_ata(); - /* Initialize partition subsystem (scan will be done later) */ + /* Initialize partition subsystem and scan for partitions */ partition_init_lock(); + for (int i = 0; i < ATA_MAX_DRIVES; i++) { + if (!ata_pio_drive_present(i)) continue; + const char* names[ATA_MAX_DRIVES] = { "hda", "hdb", "hdc", "hdd" }; + block_device_t* bdev = blockdev_find(names[i]); + if (bdev) { + partition_scan_mbr(bdev); + } + } /* If root= is specified on the kernel command line, mount that device * as the disk root filesystem. The filesystem type is auto-detected -- 2.43.0