-
Notifications
You must be signed in to change notification settings - Fork 22
Building from Source
This guide provides instructions for building CSMWrap on a Linux-based system.
-
Operating System: A Linux distribution (e.g., Ubuntu, Fedora).
-
Build Tools:
-
build-essential(or equivalent package group providinggcc,make, etc.) -
nasm(Netwide Assembler) git-
curl(for downloading OVMF for testing, optional) -
xxd(typically part ofvim-commonor similar)
On Ubuntu/Debian, you can install these with:
sudo apt-get update sudo apt-get install -y build-essential nasm git curl xxd
-
Clone the CSMWrap repository and its submodules:
git clone https://github.com/FlyGoat/CSMWrap.git --recursive
cd csmwrapIf you've already cloned without --recursive, you can initialize submodules with:
git submodule update --init --recursiveCSMWrap relies on specific binaries from a customized SeaBIOS build. These are Csm16.bin (the CSM itself) and vgabios.bin (the VESA VBIOS). The build system automates this.
-
Configure SeaBIOS: The project includes a
seabios-configfile which is copied toseabios/.config. This configuration enables CSM and Coreboot VGA support, among other things. -
Build SeaBIOS components:
This command will:
make seabios
- Clean the SeaBIOS build directory.
- Copy
seabios-configtoseabios/.config. - Run
make olddefconfigandmakewithin theseabiossubdirectory. - Use
xxdto convert the resultingCsm16.binandvgabios.bininto C header files (src/bins/Csm16.handsrc/bins/vgabios.h) which are then compiled into CSMWrap.
CSMWrap can be built for ia32 (32-bit UEFI) or x86_64 (64-bit UEFI).
make ARCH=x86_64Or simply:
makeThe output will be bin-x86_64/csmwrap.efi. The GitHub Actions workflow renames this to csmwrapx64.efi.
make ARCH=ia32The output will be bin-ia32/csmwrap.efi. The GitHub Actions workflow renames this to csmwrapia32.efi.
After a successful build, you will find the EFI application in the bin-<ARCH> directory (e.g., bin-x86_64/csmwrap.efi).
- To clean CSMWrap object files and binaries for a specific architecture:
make clean ARCH=x86_64 # or ARCH=ia32 - To clean only the SeaBIOS build products (leaves CSMWrap builds intact):
make -C seabios distclean
- To clean everything including downloaded dependencies for testing:
make distclean
The Makefile includes rules to run CSMWrap in QEMU using OVMF firmware.
-
Download OVMF:
The first time you run, it will download the necessary OVMF files if they are not present in an
ovmfsubdirectory. -
Run for x86_64:
make run ARCH=x86_64 QEMUFLAGS="-m 2G -hda your_boot_disk.img" -
Run for IA32:
Replace
make run ARCH=ia32 QEMUFLAGS="-m 1G -hda your_boot_disk.img"your_boot_disk.imgwith a path to a disk image containing a legacy OS. TheQEMUFLAGSvariable can be used to pass additional options to QEMU. The application will be copied to a temporary FAT-formatted boot drive for QEMU.