Installation & Setup¶
To develop TilekarOS, you need a cross-compilation environment for i386.
1. Prerequisites¶
Ubuntu / Debian¶
sudo apt update
sudo apt install build-essential cmake nasm qemu-system-x86 grub-pc-bin xorriso mtools python3 clang lld
Fedora¶
sudo dnf groupinstall "Development Tools"
sudo dnf install cmake nasm qemu-system-x86 grub2-tools-extra xorriso mtools python3 clang lld
macOS (Homebrew)¶
On macOS, you'll need i686-elf binutils and potentially a cross-compiler if you aren't using the provided Clang setup.
llvm is in your PATH to use clang and lld for cross-compilation.
2. Recommended IDE¶
We recommend using VS Code or Zed with the following extensions: - Clangd: For C/C++ intellisense and cross-compilation support. - ASM-LSP: For NASM syntax highlighting and completions.
The project root contains a compile_flags.txt and .clangd file which are automatically generated to help your editor understand the kernel headers.
Source Files: .clangd, compile_flags.txt
Code Preview: .clangd
3. Common Pitfalls¶
grub-mkrescueissues: On some systems,grub-mkrescuerequiresgrub-pc-bin(Ubuntu) orgrub2-tools-extra(Fedora). Without these, ISO creation will fail.mtoolsmissing:mtoolsis required for FAT12 filesystem manipulation during the build process.- Case-Insensitive FS: If building on macOS or Windows (via WSL), ensure your filesystem is case-sensitive or be careful with filename casing in includes.
4. Cloning the Repository¶
5. First Build¶
6. Test/Example: Verifying your Toolchain¶
Run the following command to ensure your compiler is targeting the correct architecture:
You should see output indicating Target: i386-unknown-elf.