You need a cross-compiler for i686 (32-bit x86):
# On Windows with MSYS2/MinGW:
pacman -S mingw-w64-i686-gcc
# On Linux:
sudo apt-get install gcc-multilibFollow: https://wiki.osdev.org/GCC_Cross-Compiler
i686-elf-gcc -m32 -ffreestanding -nostdlib -fno-pie -fno-stack-protector -c userspace/hello.c -o build/hello.oi686-elf-ld -m elf_i386 -T userspace/linker.ld build/hello.o -o build/hello.elffile build/hello.elf
# Should show: ELF 32-bit LSB executable, Intel 80386cp build/hello.elf rootfs/hello.elfmake runValcOS> ls
ValcOS> exec /hello.elf
The ELF loader is partially implemented:
- ✅ Can parse ELF headers
- ✅ Can identify loadable segments
- ❌ Cannot allocate user memory yet (needs VMM integration)
- ❌ Cannot switch to user mode yet (needs ring 3 setup)
- ❌ Cannot handle syscalls yet
To fully run programs, you need to implement:
- User mode switching (ring 0 → ring 3)
- VMM integration for user memory allocation
- System calls for program interaction
- User stack setup
This is Phase 10 completion + Phase 11 (syscalls).
- Phase 10 completion: 1-2 weeks
- Phase 11 (syscalls): 1 week
- Phase 12 (newlib): 1-2 weeks
After that, you can run real programs with printf, malloc, etc.!