Skip to content
Ryan11cPublic

About

A small x86_64 hobby OS written in C. Boots with Limine and draws to the screen. Built to learn how kernels work.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RiftOS

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.

What it does so far

  • 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

Project layout

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

Building and running

You'll need:

  • x86_64-elf-gcc (cross compiler)
  • xorriso
  • qemu
  • make

On macOS:

brew install x86_64-elf-gcc xorriso qemu

On 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 files

Plans

Things 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

Resources

License

Limine has its own license in limine/LICENSE. I haven't picked a license for the rest of the code yet.

About

A small x86_64 hobby OS written in C. Boots with Limine and draws to the screen. Built to learn how kernels work.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages