Home
/Kernel
v0.2 • IPv6-First Dual-Stack

manster / DBKernel

A database-native x86_64 operating system kernel written in Rust + NASM assembly. Boots bare-metal, runs entirely in ring 0, no userspace, no OS overhead.

manster - QEMU/KVM
Manster Kernel Screenshot 1
Manster Kernel Screenshot 2
Manster Kernel Screenshot 3
Manster Kernel Screenshot 4
Manster Kernel Screenshot 5

The Concept

The Database Engine IS the OS.

Instead of building a database on top of a traditional operating system, DBKernel provides all primitives needed for database workloads directly in the kernel itself.

This includes direct NVMe access, MVCC, WAL, lock-free data structures, query scheduling, and replication — everything running strictly in Ring 0.

0

Userspace

0

Syscall Overhead

100%

Ring 0 Execution

~68%

Rust Codebase

Userspace AppsEliminated
OS Page Cache / SyscallsEliminated
RING 0 KERNEL
DB Engine (20 Modules)
MVCC & Lock-free structures
Buffer Pool & Direct NVMe
Bare Metal Hardware

System Architecture

A modular, fully integrated stack built from the ground up to bypass traditional bottlenecks.

Interactive Shell (COM1 / Network)
DB Engine20 Custom Subsystems
NetworkingTCP/IP • SSH • Firewall
ManagementHTTP Registry • Workers
Scheduler (Worker Pool)
Storage / WAL
Memory (Frame+Heap)
IDT / GDT
Serial / VGA
Framebuffer
Keyboard (PS/2)
x86_64 Bootloader (Multiboot2)

Rationale

Core Design Decisions

Ring 0 Only

Eliminates system call overhead and context switches. Every database worker operates purely as a kernel thread.

No Double-Caching

The database buffer pool replaces the traditional OS page cache entirely, ensuring memory is utilized perfectly without duplication.

Identity-mmap (1 GiB)

Identity-mapped first 1 GiB utilizing 2 MiB huge pages directly from Boot.asm, preventing TLB thrashing during heavy I/O workloads.

Stateless Workers & WAL Truth

Workers are completely stateless. All durability and state truth is ensured strictly through the Write-Ahead Log (WAL).

Build & Execute Environment

# Prepare toolchain

rustup toolchain install nightly

rustup component add rust-src llvm-tools-preview

# Build bare-metal ELF

cargo build --release --target x86_64-dbkernel.json

# Boot via QEMU (No Display, Serial Out)

qemu-system-x86_64 \

-kernel target/x86_64-dbkernel/release/dbkernel \

-serial stdio -display none

Deep Dive: 20 DB Engine Modules

DBKernel packs custom-designed engine subsystems optimized specifically for raw hardware manipulation in Ring 0.

arena_alloc

Arena/slab allocator for DB objects

lock_free

Skiplist, MPMC queue, RCU

async_io

Vectorized / batch async I/O

direct_storage

Page/segment manager — no FS layer

buffer_pool

In-kernel DB buffer cache

layout_manager

Hot/cold data, WAL placement

btree

B-tree index engine

mvcc

Multi-Version Concurrency Control

query_scheduler

Priority-aware query scheduler

query_exec

Parallel query execution runtime

wal_engine

Group commit, sequential write

io_scheduler

OLTP vs analytics throughput

io_batching

Coalesces multiple writes

numa_memory

ACPI NUMA topology routing

isolation

Per-instance CPU/memory limits

runtime

Lightweight instance runtime

network_engine

Zero-copy, ring-0 NIC bypass

replication

Cross-instance data sync

multi_engine

Pluggable storage backends

telemetry

Latency & hit rate statistics

Status: Experimental / v0.2

Development Roadmap

Phase 1 • Current

Foundation

Keyboard, VGA, interactive shell, arena allocator, lock-free structures, and basic telemetry monitoring.

Phase 2 & 3

Storage & TX

NVMe driver, disk WAL, buffer pool integrated with full MVCC, transaction isolation, and parallel query execution.

Phase 4

Distribution

NUMA awareness, replication protocols, multi-engine backends, and DPDK-style zero-copy network bypass.