How lukenar11/moleculeos works
MoleculeOS is a minimalist, text-based i386 monolithic operating system. Its principal runtime path initializes kernel memory and ATA storage, loads the RAM-resident filesystem, then repeatedly steps a terminal under a simple interrupt-driven loop. The graph also preserves the documented shell, hardware, interrupt, and system-control capabilities. Some subsystem links are dashed where the excerpts or README do not establish the exact call path; unsampled implementations are represented only at supported tree paths.
Main entry points: main.cpp Kernel scheduler · isr_handler.cpp Exception handler · storage_manager.cpp Storage manager · terminal.cpp Terminal
Components 17
Kernel runtime
- Kernel scheduler
kernel/src/main.cpp - Block allocator
kernel/src/heap/block.cpp
i386 architecture
- Interrupt handling
arch/i386/kernel/src/idt - Exception handler
arch/i386/kernel/src/idt/isr_handler.cpp - IRQ handler
arch/i386/kernel/src/idt/irq_handler.cpp - CPU register state
arch/i386/kernel/include/utils/regs.hpp - System control
arch/i386/kernel/src/sys
Hardware devices
- ATA-PIO driver
drivers/src/ata/pio.cpp - PS/2 keyboard
drivers/src/ps2/keyboard_input.cpp - VGA text mode
drivers/src/vga/text_mode.cpp
RAM storage
- Storage manager
kernel/src/storemgr/storage_manager.cpp - MOFS2 filesystem
kernel/src/filesys/mofs2.cpp
User interface
- Terminal
terminal/src/terminal.cpp - Shell interpreter
shell/src/shell.cpp - Shell commands
shell/src/cmds - Text output
runtime/stdlib/src/text_output.cpp
Other components
- OS user
Connections 21
- Kernel scheduler → Block allocator: initializes
kernel/src/main.cpp - Kernel scheduler → ATA-PIO driver: initializes
kernel/src/main.cpp - Kernel scheduler → Storage manager: initializes
kernel/src/main.cpp - Kernel scheduler → Storage manager: loads filesystem
kernel/src/main.cpp - Kernel scheduler → Terminal: steps repeatedly
kernel/src/main.cpp - Kernel scheduler → Interrupt handling: uses scheduling
- Storage manager → ATA-PIO driver: reads and writes
- Storage manager → MOFS2 filesystem: loads and saves
- MOFS2 filesystem → Block allocator: allocates file data
- IRQ handler → PS/2 keyboard: dispatches keyboard IRQ
- IRQ handler → CPU register state: uses register state
- Exception handler → CPU register state: reads register state
arch/i386/kernel/src/idt/isr_handler.cpp - Exception handler → Text output: prints diagnostics
arch/i386/kernel/src/idt/isr_handler.cpp - Exception handler → System control: halts execution
arch/i386/kernel/src/idt/isr_handler.cpp - Interrupt handling → Exception handler: routes exceptions
- Interrupt handling → IRQ handler: routes hardware IRQs
- Terminal → Shell interpreter: runs shell
- Shell interpreter → Shell commands: dispatches commands
- OS user → Terminal: interacts
- Shell commands → MOFS2 filesystem: manages files
- Terminal → VGA text mode: displays text