From: Tulio A M Mendes Date: Tue, 17 Feb 2026 00:45:26 +0000 (-0300) Subject: fix: KVA_IOAPIC VA collision with BSS — move from 0xC0201000 to 0xC0401000 X-Git-Url: https://projects.tadryanom.me/sitemap.xml?a=commitdiff_plain;h=13bd34116cddb4768cd518a55152f668cca4d5b9;p=AdrOS.git fix: KVA_IOAPIC VA collision with BSS — move from 0xC0201000 to 0xC0401000 Root cause: multiboot_copy (64KB static buffer) starts at VA 0xC0200FE0, spanning pages 0xC0200000-0xC0210000. KVA_IOAPIC at 0xC0201000 mapped IOAPIC MMIO over the BSS page containing the multiboot2 cmdline tag data. After arch_platform_setup, reading bi->cmdline returned IOAPIC register data (zeros) instead of the original cmdline string. Symptom: [CMDLINE] "" regardless of GRUB menu entry selected. Classic Heisenbug — adding a debug kprintf before IOAPIC init read the correct data, masking the corruption. Fix: move KVA_IOAPIC to 0xC0401000 (next to LAPIC at 0xC0400000), well past _end at 0xC0265728. Updated VA map comment to reflect current BSS extent (~0xC0266000). --- diff --git a/include/arch/x86/kernel_va_map.h b/include/arch/x86/kernel_va_map.h index b5c3505..3ab77b2 100644 --- a/include/arch/x86/kernel_va_map.h +++ b/include/arch/x86/kernel_va_map.h @@ -10,8 +10,7 @@ * * Layout (sorted by VA): * - * 0xC0000000 .. ~0xC0203000 Kernel .text/.data/.bss (variable) - * 0xC0201000 IOAPIC MMIO (1 page) + * 0xC0000000 .. ~0xC0266000 Kernel .text/.data/.bss (variable) * 0xC0280000 vDSO shared page (1 page) * 0xC0300000 .. 0xC030FFFF ACPI temp window (16 pages) * 0xC0320000 ATA DMA PRDT (1 page) @@ -22,6 +21,7 @@ * 0xC0352000 .. 0xC0361FFF E1000 TX buffers (16 pages) * 0xC0362000 .. 0xC0371FFF E1000 RX buffers (16 pages) * 0xC0400000 LAPIC MMIO (1 page) + * 0xC0401000 IOAPIC MMIO (1 page) * 0xC8000000 .. Kernel stacks (guard + 8KB per thread) * 0xD0000000 .. Kernel heap (10 MB) * 0xDC000000 .. Initrd / generic phys mapping (up to 64 MB) @@ -29,7 +29,7 @@ */ /* IOAPIC (arch/x86/ioapic.c) */ -#define KVA_IOAPIC 0xC0201000U +#define KVA_IOAPIC 0xC0401000U /* vDSO shared page (kernel/vdso.c) */ #define KVA_VDSO 0xC0280000U