This guide walks you through cloning the CrisOS v2 repository, compiling the freestanding i386 kernel, packing the CRFS rootfs image, generating a bootable ISO with GRUB, and launching the system inside QEMU — from a fresh checkout to an interactive shell prompt in about five minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CRISTOP-bot/cris-os-v2/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you start, make sure the following tools are available on your host machine:| Tool | Notes |
|---|---|
gcc or i686-elf-gcc | A C compiler that can target 32-bit i386. A bare-metal cross-compiler is recommended but not required. |
make | Standard GNU Make for running the build targets. |
qemu-system-i386 | QEMU machine emulator — install via your package manager (e.g. qemu-system-x86). |
grub-mkrescue | Part of GRUB 2 utilities — needed only to produce a bootable ISO. |
| Python 3 | Used by tools/build_rootfs.py to pack the rootfs directory into a CRFS binary image. |
Build and Run
Build the kernel
Run The Makefile compiles every On success, the kernel ELF binary is written to:
make (or make all) to compile all C and Assembly sources and link them into the kernel binary:.c file in src/ and drivers/, assembles boot/boot.S, src/asm_utils.S, and src/math_asm.S, then links the objects via linker.ld using these flags:Build the rootfs and create a bootable ISO
Run This target does three things in sequence:
make echo-iso to pack the rootfs, copy the kernel into the ISO tree, and invoke grub-mkrescue:- Runs
tools/build_rootfs.py rootfs iso/boot/rootfs.bin— walks therootfs/directory and writes a CRFS-format binary image (4-byte magicCRFS, version field, file entry table, then file data). - Copies
build/kernel.bintoiso/boot/kernel.bin. - Calls
grub-mkrescue -o os.iso iso/to produce a hybrid El Torito ISO using the GRUB configuration iniso/boot/grub/grub.cfg.
Run in QEMU
Launch the ISO in a QEMU virtual machine with 512 MB of RAM:This is equivalent to:GRUB reads
iso/boot/grub/grub.cfg, loads kernel.bin and the rootfs.bin module, and hands control to the start symbol in boot/boot.S. The kernel clears the screen, initializes all subsystems in order (GDT → IDT → PIC → timer → keyboard → mouse → VFS → services), and drops into the shell.You should see:GDT and IDT are initialized silently before the PIC. No console output is produced for those two steps — they are confirmed working only if the system continues past the PIC initialization line without a fault.
Make Targets Reference
| Target | What it does |
|---|---|
make | Compiles all C and Assembly sources and links build/kernel.bin. |
make iso | Builds the kernel, packs iso/boot/rootfs.bin from rootfs/, and copies build/kernel.bin to iso/boot/kernel.bin. |
make echo-iso | Runs make iso, then calls grub-mkrescue to produce os.iso. |
make run | Runs make echo-iso, then launches qemu-system-i386 -cdrom os.iso -m 512M. |
make clean | Removes build/, os.iso, iso/boot/kernel.bin, and iso/boot/rootfs.bin. |