]> 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)
commiteaf3cc6e161eb3db79fad33ff2c074db988bc694
treeb4f32a036e8c37b62abd732e530868167f6f7a46
parent4b209f065dfd7917c88d086af141786c955262c4
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