SawitCore OS is a specialized Unikernel Database Operating System built with Rust, designed to run directly on bare metal (x86_64) without a traditional OS like Linux. It prioritizes performance for database workloads through direct hardware access.
The goal is to port the SawitDB engine (originally Go/Node.js) to run natively as the OS kernel.
- Kernel Core: Minimal x86_64 kernel with custom target specification.
- VGA Text Mode: Driver for printing text to the screen (
println!macro). - Interrupt Handling:
- IDT (Interrupt Descriptor Table)
- PIC (Programmable Interrupt Controller)
- Keyboard Input (via PS/2 Controller)
- Memory Management:
- Paging (Recursive Page Tables)
- Heap Allocation (
Linked List Allocator) - Dynamic types enabled (
Box,Vec,String, etc.)
- Async & Multitasking:
- Cooperative Multitasking (Async/Await)
- Simple Task Executor
- Lock-free Scancode Queue (
crossbeam-queue)
- User Interface:
- Interactive Shell (
Sawit>) - Management Menu (
managecommand)
- Interactive Shell (
The project is organized as a Rust workspace:
src/: Kernel source codemain.rs: Kernel entry point and initializationlib.rs: Central module exports and PIC initializationdrivers/: Hardware driversvga_buffer.rs: VGA text mode driverserial.rs: COM1 serial port drivernet.rs: VirtIO network drivervirtio_transport.rs: Legacy PCI transport for VirtIOvirtio_hal.rs: DMA memory management (HAL trait)block.rs: Block I/O abstraction
sawitdb/: Database enginemod.rs: Database module exportsbtree.rs: BTree index implementationpager.rs: Page management and I/O
task/: Async executor and taskssimple_executor.rs: Cooperative task executorkeyboard.rs: Keyboard input handlershell.rs: Interactive shell tasknet.rs: Network polling and server tasks
memory.rs&allocator.rs: Memory managementinterrupts.rs: IDT and interrupt handlers
tools/: Helper scriptsrun.ps1: Build and run with user-mode networkingrun_tap.ps1: Build and run with TAP networking (requires admin)test_network.ps1: Auto-detect network mode and launch
docs/: DocumentationTAP_NETWORK_SETUP.md: TAP adapter setup guideNETWORK_TESTING.md: Network testing procedures
- Custom bootloader with
bootimage - VGA text mode driver
- Serial port driver (COM1)
- Interrupt handling (IDT)
- Memory management (paging, heap allocation)
- Keyboard input handling
- Shell interface (VGA console)
- Core types (
Valueenum for Int/Float/String) - BTree index implementation (insert, search)
- Pager with block I/O abstraction
- RamDisk storage backend (in-memory)
- Shell commands:
db_init,put,get(via management menu) - Global database state management
- Persistent storage (requires disk driver)
- VirtIO network driver (Legacy PCI transport)
- smoltcp TCP/IP stack integration
- TCP server on port 8023
- Network interface configuration (10.0.2.15/24)
- Feature negotiation (VIRTIO_F_MRG_RXBUF masking)
- DMA memory management via VirtioHal
- Polling-based network task
- [
⚠️ ] RX packet reception (blocked by QEMU/Windows TAP limitation) - TCP echo/shell functionality (pending RX fix)
Note: Network stack is 85% complete. Code is production-ready but RX reception is blocked by QEMU user-mode networking limitations on Windows. See docs/TAP_NETWORK_SETUP.md for TAP adapter setup, or use WSL2/Linux for full functionality.
- Rust Nightly:
rustup toolchain install nightly - Bootimage:
cargo install bootimage - QEMU: Ensure
qemu-system-x86_64is in your PATH.
Use the provided PowerShell script:
./tools/run.ps1Or manually:
cargo build
cargo bootimage
qemu-system-x86_64 -drive format=raw,file=target/x86_64-sawitcore/debug/bootimage-sawitcore-os.bin- License: This project is licensed under the MIT License.
- Contributing: Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.