DepthOS - AArch64 Educational Operating System
DepthOS is a minimalist operating system designed for the AArch64 architecture. Built from the ground up as an educational project, it demonstrates fundamental OS concepts including bootloading, kernel initialization, and basic system services.
[BOOT] DepthOS kernel_main() starting...
[BOOT] Initializing UART...
[BOOT] UART ready.
[BOOT] Launching shell...
π DepthOS Kernel Started by DepthBOOT!
Current Features
π Two-Stage Bootloader
Custom bootloader with Stage 1 (4KB) and Stage 2 (8KB) for system initialization
π» Interactive Shell
Command-line interface with basic commands: help, about, clear, echo, panic
πΊ UART Communication
Full UART support with colored output and terminal control sequences
π§ System Monitor
Built-in system health monitoring and panic handling
System Architecture
Memory Layout: βββββββββββββββββββββββ 0x40200000 β Kernel Space β βββββββββββββββββββββββ€ 0x40100000 β Bootloader S2 β βββββββββββββββββββββββ€ 0x40080000 β Bootloader S1 β βββββββββββββββββββββββ Target: AArch64 (ARM64) Platform: QEMU virt machine CPU: Cortex-A57
Bootloader Implementation
DepthOS uses a two-stage bootloader design to initialize the system and prepare the environment for the kernel.
Stage 1 Bootloader
Size: 4KB
Location: 0x40080000
File: bootloader/stage1/boot1.s
Functions:
- Minimal bootstrap code
- Stack initialization
- Basic UART output
- Jump to Stage 2
Stage 2 Bootloader
Size: 8KB
Location: 0x40100000
File: bootloader/stage2/boot2.s
Functions:
- Extended initialization
- System environment setup
- Kernel loading preparation
- Transfer control to kernel
Boot Sequence
1. Power-on/Reset 2. Stage 1 loads at 0x40080000 3. Initialize minimal stack 4. Print boot messages via UART 5. Jump to Stage 2 at 0x40100000 6. Stage 2 system initialization 7. Transfer control to kernel at 0x40200000
Kernel Implementation
The DepthOS kernel provides core system functionality including memory management, device drivers, and system services.
Core Components
Memory Layout
Kernel Functions
- β’ BSS section clearing
- β’ Stack setup
- β’ UART initialization
- β’ System banner display
- β’ Panic handling
- β’ System monitoring
- β’ Shell launch
- β’ Color terminal output
Interactive Shell
The DepthOS shell provides a command-line interface for interacting with the operating system.
Available Commands
helpDisplay available commandsaboutShow system informationclearClear the terminal screenechoPrint text to terminalpanicTrigger kernel panic (debug)Shell Features
- β’ Command line editing
- β’ Backspace support
- β’ Enter key processing
- β’ Buffer overflow protection
- β’ Color-coded messages
- β’ System banner display
- β’ Error reporting
- β’ Command prompt
Example Session
DepthOS> help ΠΠΎΡΡΡΠΏΠ½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ: help - ΠΠΎΠΊΠ°Π·Π°ΡΡ ΡΡΠΎ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ about - ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΡΠΈΡΡΠ΅ΠΌΠ΅ clear - ΠΡΠΈΡΡΠΈΡΡ ΡΠΊΡΠ°Π½ echo <text> - ΠΡΠ²Π΅ΡΡΠΈ ΡΠ΅ΠΊΡΡ DepthOS> about DepthOS: AArch64 ΡΡΠ΅Π±Π½ΠΎΠ΅ ΡΠ΄ΡΠΎ DepthOS> echo Hello World! Hello World! DepthOS> _
Development Status
Build & Run
# Build the complete OS make all # Run in QEMU make run # Debug mode make debug # Clean build make clean
Requires: aarch64-elf-gcc toolchain, QEMU system emulation