This repository contains a basic x86 kernel in C using Multiboot.
The template source code is borrowed from "CP_Kernel".
Tested by x86 physical machine platform, there are no obvious bugs.
xmake
xorriso
When first running
xmake
, it will download zig as cross-compiler.
If you choose to use the GRUB bootloader, you will need to install
grub-pc-bin
Running xmake
will build the kernel and create a bootable ISO image.
Running xmake run
will build above automatically and run it in QEMU.
Open src/boot/boot.asm
, comment out Text Mode
section and uncomment VBE Video Mode
section.
VBE Graphics memory address:
multiboot->framebuffer_addr
Video widthmultiboot->framebuffer_width
Video heightmultiboot->framebuffer_height
- Create file
assets/boot/grub/grub.cfg
set timeout=60
set default=0
menuentry "ExampleOS" {
multiboot /kernel.elf
boot
}
- You'll need to comment out the "Limine Build ISO" section in
xmake.lua
- Replace the "Limine Build ISO" section in
xmake.lua
withos.run("grub-mkrescue -o %s %s", iso_file, iso_dir)