From: Tulio A M Mendes Date: Tue, 26 May 2026 04:08:52 +0000 (-0300) Subject: init: integrate partition scanning after blockdev registration (Etapa 6) X-Git-Url: https://projects.tadryanom.me/?a=commitdiff_plain;h=9781ea2e95c9e59b3994eab7b17104dc98dec950;p=AdrOS.git 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 --- 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