]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: move x86 ELF loader from src/kernel/elf.c to src/arch/x86/elf.c
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:32:41 +0000 (02:32 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:32:41 +0000 (02:32 -0300)
commite25d91a1ba2906e30216135eea5584709bcde57b
tree3997ac1734811793d7cae78dccd1c2ce3d6bbfd1
parentd5cdfa8ac744d2634b261c554a7298855e347b7c
refactor: move x86 ELF loader from src/kernel/elf.c to src/arch/x86/elf.c

The ELF loader uses x86-specific page table manipulation (recursive
mapping at 0xFFFFF000/0xFFC00000), EM_386 validation, and low-16MB
allocation. It is 100% architecture-dependent and should not live
in the generic kernel directory.

- Move full implementation to src/arch/x86/elf.c (no #if guards)
- Replace src/kernel/elf.c with a weak stub returning -1
- The linker picks the arch-specific version when available

Passes: make, cppcheck, QEMU smoke test.
src/arch/x86/elf.c [new file with mode: 0644]
src/kernel/elf.c