RiftOS is a small x86_64 operating system I'm writing in C to learn how kernels work. I got really into operating systems in my OS class and wanted to build one myself instead of just reading about it.
It's still early. Right now it boots with Limine, prints boot logs over serial, and draws "Hello, world." on the screen.
- Boots with the Limine bootloader (BIOS and UEFI)
- Runs as a higher-half kernel at
0xffffffff80000000 - Sets up COM1 serial at 38400 baud and logs each boot step
- Gets a framebuffer from Limine (1024x768, 32-bit color)
- Draws text with a small 5x7 bitmap font I made by hand
- Panics with a message over serial if something goes wrong, then halts
The font only has the characters needed for the boot message right now. Anything else shows up as a box. I'm planning to switch to a real font file at some point.
When it boots you should see this in the serial output:
RiftOS booting
Limine base revision supported
Framebuffer initialized
Boot screen drawn
RiftOS/
├── kernel/
│ ├── include/ headers
│ └── src/
│ ├── kernel.c entry point and boot sequence
│ ├── serial.c COM1 serial driver
│ ├── framebuffer.c pixel drawing and the font
│ ├── io.c inb/outb port I/O
│ └── panic.c kernel panic
├── limine/ Limine bootloader files
├── limine.conf boot config
├── linker.ld linker script
└── Makefile
You'll need:
x86_64-elf-gcc(cross compiler)xorrisoqemumake
On macOS:
brew install x86_64-elf-gcc xorriso qemuOn Linux you'll probably need to build the cross compiler yourself. The OSDev wiki has a guide.
Then:
make # build the kernel and ISO
make run # run in QEMU with serial output in the terminal
make run-serial # run without a window, serial only
make clean # remove build filesThings I want to work on next, roughly in order:
- GDT and IDT so exceptions get handled
- A text console with scrolling and a
kprintf - A full font
- Physical memory manager
- Paging
- Timer interrupts
- Keyboard input
- Kernel heap
- Processes, scheduling, and eventually a simple shell
- OSDev Wiki
- Limine boot protocol
- Intel Software Developer's Manual
- Operating Systems: Three Easy Pieces
Limine has its own license in limine/LICENSE. I haven't picked a license for the rest of the code yet.