To build XenevaOS natively on Linux without relying on MSVC, ensure you have the appropriate GCC toolchain installed.
- For x86_64 Kernel:
g++andmake(multilib support may be required). - For ARM64 (KernelAA64):
aarch64-linux-gnu-gccandaarch64-linux-gnu-binutils.
- Open a terminal and navigate to the
KernelAA64/directory. - Run
make cleanto clear any old MSVC objects or stale binaries. - Run
maketo compile the.cand.sfiles. - The Makefile will automatically link the objects into
KernelAA64.elfand generate a PE32+ binary (KernelAA64.exe) usingaarch64-linux-gnu-objcopy.
- Open a terminal and navigate to the
Kernel/directory. - Run
make cleanand thenmaketo compile the C++ source files into the higher-half kernel elf format.
Note: The GCC port is actively being developed. More subsystems and drivers will be added to the GCC build pipeline over time, moving completely away from Windows-specific Visual Studio configurations.
To automate the creation of the FAT32 boot image and launch the OS in QEMU, use the provided bash script:
- Navigate to the root of the XenevaOS repository.
- (Temporary Dev Workaround) Place a pre-built
initrd2.img(containing GUI/resources) at the root of the repository. Note: Using a pre-built ramdisk is a temporary development workaround for the active porting phase to help Linux developers test the user-space GUI easily. In the future, this will be replaced by a dedicated native build step. - Run the script:
./Scripts/Linux/build_and_run_qemu.sh
Note: The GCC build for ARM64 automatically defines __TARGET_BOARD_QEMU_VIRT__, which tells the bootloader to bypass the interactive screen resolution menu. This allows QEMU to boot directly into the OS without hanging for user input.
If you do not have a pre-built initrd2.img or want to generate a fresh one from the Resources/resources/ directory, you can pass a flag to force a manual build:
./Scripts/Linux/build_and_run_qemu.sh --force-manual-build
Note: This will require mkfs.vfat and mcopy (from the mtools package) to be installed on your Linux system.