TBS is a hobby operating system kernel developed as a learning project to explore low-level system design and operating system internals.
The project focuses on implementing fundamental OS components from scratch in order to better understand how modern systems work. While still experimental, the kernel has grown beyond a minimal prototype and now includes several core subsystems such as preemptive multitasking, terminal interfaces, a basic window compositor, and virtual memory management.
The system is intentionally kept simple and readable so that new features and ideas can be explored without excessive complexity.
Current functionality implemented in the kernel:
-
Preemptive Multitasking
A timer-driven scheduler allowing multiple tasks to run concurrently. Round robin style. -
TTY Subsystem
Basic terminal interfaces used for system interaction and debugging. -
Window Compositor
A minimal graphical compositor capable of drawing and managing simple windows. Runs in VGA text mode. -
Memory Management
- Identity-mapped paging
- Basic virtual memory setup
- No ring userspace seperation for simplicity.
-
RAM Filesystem (Work in Progress)
- An in-memory filesystem used during early system development.
- Loads external .img file using grub modules, mounts it to the ram filesystem.
The goal for TBS is to follow a micro-kernel architecture, executing as much as possible in ring 3. The kernel isn't a microkernel yet. Its in its early stages of development.
Paging is enabled for memory management and hardware-enforced protection. The system currently uses identity-mapped memory, and a bump allocator for early initialization.
While the kernel is currently monolithic, the design leaves room for potential future separation between kernel and userspace as the system evolves.
The primary goals of this project are:
- Learn practical kernel development
- Understand memory management and scheduling
- Build fundamental OS components from scratch
- Experiment with system design decisions
The project prioritizes learning, experimentation, and simplicity over completeness or production readiness.
Planned next steps for the system:
- Improve and stabilize the RAM filesystem
- Implement a disk-based filesystem
- Add a minimal C runtime environment using musl libc
- Port TinyCC (TCC) to allow compiling programs directly inside the OS
- Expand userspace support
- Use graphics framebuffer instead of VGA for more complicated graphics.
- GCC cross-compiler (e.g.
x86_64-elf-gcc) - NASM
- Make
- QEMU
makeA simplified overview of the system startup sequence:
- Bootloader loads the kernel
- Kernel initializes basic hardware and memory
- Paging is enabled
- Bootloader modules are parsed
- Filesystem gets mounted.
- Scheduler and multitasking are initialized
- Core subsystems (TTY, compositor) start
- System enters the main kernel loop
wip
below is a screenshot of the kernel running the simple compositor. a few commands are displayed such as directory manipulation and pci enumeration
