Prerequisites
Before you begin, make sure the following tools are installed and available on yourPATH:
- GCC with x86_64 support — either a cross-compiler targeting
x86_64-elfor a nativegccinstallation with multilib support. The build usesgccdirectly; no wrapper script is required. - GNU Make — the build system is a plain
Makefilewith no additional build generator. - GNU ld — the linker (
ld) must support theelf_x86_64emulation (-m elf_x86_64). This is included in standard GNU Binutils.
1
Clone the repository
Clone the MVH Kernel source to your local machine and enter the project directory.
2
Build the kernel
Run When the build succeeds you will find the kernel ELF binary at:This is a standard ELF64 binary for x86_64 with no external runtime dependencies. To clean the build directory and remove all compiled objects, run
make from the project root. The build system compiles every kernel module, links them with linker.ld, and writes the output binary to build/kernel.elf.make clean.MVH Kernel does not include a bootloader.
build/kernel.elf is the kernel binary only — you must load it with your own bootloader.3
Integrate with your bootloader
Your bootloader must satisfy three requirements before jumping to the kernel entry point:
- Enter x86_64 Long Mode — the kernel entry point
_kernel64_startis 64-bit code. Your bootloader must complete the transition to Long Mode before transferring control. - Identity-map the first GiB — the kernel expects a 1:1 physical-to-virtual mapping covering the first 1024 MiB of address space.
- Pass available memory size in KiB — load the total available RAM in KiB into the first argument register (
rdi/edi) before calling the entry point. This is theboot-memory-size-kibconvention the PMM uses to claim its page range.
_kernel64_start symbol exported from build/kernel.elf. The entry stub clears BSS, initialises FPU/SSE/XSAVE, and calls kernel_main.For full boot requirements and memory layout details, see the Boot Requirements reference page.
4
First shell interaction
After a successful boot, MVH Kernel initialises all subsystems and drops into the interactive shell. You will see the
mvh> prompt on the VGA text display and mirrored on the serial port (16550 UART).Try these commands to verify the kernel is working correctly:What happens at boot
When_kernel64_start runs, the kernel performs the following sequence automatically:
- Clears the BSS segment and initialises FPU, SSE, and XSAVE.
- Calls
kernel_main, which initialises the HAL and all hardware. - Installs the IDT, remaps the 8259 PIC, and starts the PIT timer at 100 Hz.
- Initialises the PMM with the memory size passed by your bootloader, then sets up VMM page protections and the kernel heap.
- Initialises VGA, serial, PS/2 keyboard, CPUID, RTC, and PCI drivers.
- Mounts RAMFS as the root filesystem at
/. - Drops into the
mvh>interactive shell.
Next steps
- Read Building MVH Kernel from Source for detailed compiler flags and Makefile targets.
- Read Introduction for a full list of capabilities and current limitations.
- Browse the API reference starting with the Physical Memory Manager.