A minimalist operating system kernel written in Rust, designed to run directly on x86_64 hardware without any underlying operating system.
JC-OS is a personal hobby kernel project focused on low-level system programming. It runs in a no_std environment and is bootstrapped via the Rust bootloader crate on x86_64 systems.
This project demonstrates the fundamentals of OS creation:
- Custom boot via UEFI/Legacy bootloader
- Hardware management without system abstraction
- Direct communication with CPU and peripherals
- VGA video memory manipulation
- Hardware interrupt handling
- Virtual memory with paging
- Dynamic memory allocation (heap)
- Hierarchical file system with directories and permissions
- Interactive shell with real-time clock display
- Async/await task scheduling with executor
- User management with UID system
- Automatic timezone support (Europe/France)
- PS/2 mouse driver (in development)
- VGA text output (80ร25 characters)
- 16 foreground and background colors
- Automatic scrolling when screen is full
- Smart backspace with line wrapping
- Hardware cursor update (ports 0x3D4/0x3D5)
- Color-coded UI elements with border boxes
- PS/2 keyboard with French AZERTY layout
- Scancode Set 2 (IBM standard)
- Complete alphanumeric key mapping
- Special keys: Enter, Backspace, Escape
- Command buffer with 256 character capacity
- Hierarchical RAM File System - Multi-level directory structure
- Inode-based design with UID and permissions
- Current Working Directory (CWD) navigation
- Directory operations: look, open, room (create directory)
- File operations: touch, cat, read, edit, note, drop
- Path navigation: absolute and relative paths
- Automatic home directory creation for new users
- BTreeMap-based organization for efficient lookup
- Statistics tracking: file count and total size
- Unicode support via UTF-8 lossless conversion
- Command interpreter with multiple built-in commands
- File management commands: touch, cat, rm, edit
- System information: info, stats, whoami, neofetch, date
- Utility commands: help, echo, clear, ls
- Secure login system with authentication
- Role-based access control with Admin and Standard roles
- User management with login/logout functionality
- Dynamic user creation with
useraddcommand (Admin only) - User deletion with
userdelcommand (Admin only) - UID system for user identification
- Session tracking with current user identification
- Password authentication with credential validation
- Automatic home directory creation for new users
- Default admin account: username "andre", password "admin123"
- CMOS RTC access via ports 0x70/0x71
- BCD to decimal conversion for accurate time reading
- Time struct with hours, minutes, seconds
- Automatic timezone adjustment for France (UTC+1/+2)
- Daylight Saving Time (DST) support with European rules
- Non-volatile time keeping independent of system power
- PS/2 mouse interface via ports 0x60/0x64
- 3-byte packet protocol for movement and button data
- Movement delta calculation with sign extension
- Cursor position tracking with screen boundary clamping
- Mouse state management with phase-based packet decoding
- Auxiliary port enablement for mouse device
- Data reporting activation for real-time input
- Async/await support with Rust futures
- Task executor with round-robin scheduling
- Task queue using VecDeque
- Cooperative multitasking via yield_now()
- Task identification with atomic TaskId
- Pin-based future pinning for safe async execution
- GDT (Global Descriptor Table) - CPU segmentation
- TSS (Task State Segment) with Double Fault stack
- IDT (Interrupt Descriptor Table) - Interrupt vectors
- PIC 8259 - Programmable Interrupt Controller
- Double Fault Handler protected by IST (Interrupt Stack Table)
- Timer Interrupt - Hardware timer (IRQ0) for real-time clock display
- Keyboard Interrupt - PS/2 keyboard input handling
- Mouse Interrupt - PS/2 mouse input handling (IRQ12)
- x86_64 Paging (4-level page tables)
- Physical memory mapping via bootloader info
- Frame allocator using UEFI memory map
- Heap allocation (100 KiB) with linked-list allocator
- Virtual to physical address translation
- Page-level protection (PRESENT, WRITABLE flags)
- Error handling with Result type and alloc_error_handler
- COM1 serial output via UART 16550
- Complete boot logging
- Memory statistics display (heap start, size, status)
- Panic error display via serial
- Interrupt event logging
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ JC-OS Kernel v0.4 โ
โ Andre Edition โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Entry Point: kernel_main() โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Initialization Order โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ
โ โ 1. GDT + TSS (CPU segmentation) โ โ
โ โ 2. IDT (interrupt table) โ โ
โ โ 3. PIC (interrupt controller) โ โ
โ โ 4. PS/2 Controller (keyboard+mouse) โ โ
โ โ 5. Keyboard Driver (AZERTY Set2) โ โ
โ โ 6. Paging Setup (4-level page tables) โ โ
โ โ 7. Frame Allocator (memory map parsing) โ โ
โ โ 8. Heap Init (100 KiB allocator) โ โ
โ โ 9. File System (Hierarchical RAMFS) โ โ
โ โ 10. Auth System (user management) โ โ
โ โ 11. RTC Driver (time+timezone) โ โ
โ โ 12. Mouse Driver (PS/2 input) โ โ
โ โ 13. Task System (Executor init) โ โ
โ โ 14. Interrupts enabled โ โ
โ โ 15. UI Launch (shell prompt) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Memory Layout (Virtual Address Space) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ 0x0000_0000_0000 - Kernel Code โ โ
โ โ ... โ โ
โ โ 0x4444_4444_0000 - HEAP START (100 KiB) โ โ
โ โ 0x4444_4444_19000 - HEAP END โ โ
โ โ ... โ โ
โ โ Higher half kernel (identity mapped) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Task Scheduling Architecture โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Executor โ โ
โ โ โโโ Task Queue: VecDeque<Task> โ โ
โ โ โโโ spawn(task) โ push_back โ โ
โ โ โโโ run() โ poll futures in loop โ โ
โ โ โ โ
โ โ Task โ โ
โ โ โโโ id: TaskId (atomic u64) โ โ
โ โ โโโ future: Pin<Box<dyn Future>> โ โ
โ โ โ โ
โ โ YieldNow Future โ โ
โ โ โโโ yielded: bool โ โ
โ โ โโโ poll() โ Pending/Ready โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Authentication & User Management โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ AuthManager โ โ
โ โ โโโ users: Vec<User> โ โ
โ โ โโโ current_user: Option<User> โ โ
โ โ โโโ next_uid: u32 โ โ
โ โ โโโ login(username, password) -> bool โ โ
โ โ โโโ logout() โ โ
โ โ โโโ add_user(username, pass) -> uid โ โ
โ โ โโโ delete_user(username) -> Result โ โ
โ โ โโโ get_current_uid() -> u32 โ โ
โ โ โ โ
โ โ User โ โ
โ โ โโโ username: String โ โ
โ โ โโโ password_hash: String โ โ
โ โ โโโ role: Role (Admin/Standard) โ โ
โ โ โโโ uid: u32 โ โ
โ โ โ โ
โ โ Role Enum โ โ
โ โ โโโ Admin - Full system access โ โ
โ โ โโโ Standard - Limited access โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Hierarchical File System Architecture โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ RamFileSystem โ โ
โ โ โโโ root: Directory โ โ
โ โ โโโ cwd: Vec<String> โ โ
โ โ โโโ look() -> Vec<(name, type)> โ โ
โ โ โโโ open(path) -> Result โ โ
โ โ โโโ room(name, uid) -> Result โ โ
โ โ โโโ write_file(name, content, uid) โ โ
โ โ โโโ read_file(name) -> Option<String> โ โ
โ โ โ โ
โ โ Directory โ โ
โ โ โโโ inode: Inode โ โ
โ โ โโโ entries: BTreeMap<String, FsNode> โ โ
โ โ โ โ
โ โ Inode โ โ
โ โ โโโ uid: u32 โ โ
โ โ โโโ permissions: u16 โ โ
โ โ โโโ node_type: File/Directory โ โ
โ โ โ โ
โ โ FsNode Variants โ โ
โ โ โโโ File(File) โ โ
โ โ โโโ Directory(Directory) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Managed Peripherals: โ
โ โข VGA 0xB8000 - Text screen โ
โ โข COM1 0x3F8 - Serial port โ
โ โข PIC 0x20/0xA0 - Interrupt controller โ
โ โข PS/2 0x60/0x64 - Keyboard + Mouse โ
โ โข PIT 0x40 - Programmable Interval Timer โ
โ โข RTC 0x70/0x71 - Real Time Clock (CMOS) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
jc-os/
โโโ Cargo.toml # Rust project configuration
โโโ Readme.md # This file
โโโ x86_64-jc-os.json # Custom target spec
โโโ src/
โ โโโ main.rs # Entry point + initialization
โ โโโ gdt.rs # GDT + TSS (segmentation)
โ โโโ interrupts.rs # IDT + PIC handling + handlers
โ โโโ vga_buffer.rs # Color VGA text driver
โ โโโ serial.rs # COM1 serial output (UART 16550)
โ โโโ memory.rs # Paging + frame allocator
โ โโโ allocator.rs # Heap allocator (linked-list)
โ โโโ fs.rs # RAM File System (RAMFS)
โ โโโ auth.rs # User authentication system
โ โโโ task.rs # Task structures + async support
โ โโโ executor.rs # Task executor + scheduler
โ โโโ shell.rs # Interactive shell with login
โ โโโ drivers/
โ โโโ mod.rs # Drivers module (export)
โ โโโ keyboard.rs # PS/2 AZERTY keyboard driver + shell
โ โโโ mouse.rs # PS/2 mouse driver (in development)
โ โโโ rtc.rs # Real Time Clock driver
โโโ target/
โโโ x86_64-jc-os/ # Compiled binaries
Role: CPU memory segmentation configuration
โข Kernel Code Segment (64-bit execution)
โข TSS (Task State Segment) for:
- Double Fault Handler stack
- IST Index 0: 5 stack pages (20KB)
Role: Routes interrupts to appropriate handlers
Configured Vectors:
โข Double Fault (CPU Exception) โ Isolated stack
โข Timer (IRQ0) โ Basic handler (for future scheduling)
โข Keyboard (IRQ1) โ Keyboard driver
PIC Configuration:
โข Master: Timer + Keyboard enabled (0xF8)
โข Slave: All disabled (0xFF)
Role: Paging and physical memory allocation
Features:
โข 4-Level Paging (PML4 โ PDP โ PD โ PT)
โข CR3 register read for active page table
โข OffsetPageTable for higher-half mapping
โข BootInfoFrameAllocator uses UEFI memory map
Memory Map Parsing:
โข Iterates through bootloader memory regions
โข Filters for Usable memory type
โข Allocates 4KiB frames for page mapping
โข Tracks next available frame index
Memory Map Entry Example:
Region types:
โข Usable RAM โ Can be allocated
โข Reserved โ Not available
โข ACPI Reclaimable โ Can be used after ACPI
โข EFI Runtime โ Reserved for firmware
Role: Dynamic memory allocation for kernel
Configuration:
โข Heap Start: 0x4444_4444_0000 (virtual)
โข Heap Size: 100 KiB
โข Allocator: linked_list_allocator::LockedHeap
โข Page Flags: PRESENT | WRITABLE
Initialization:
โข Maps 25 pages (25 ร 4KiB = 100 KiB)
โข Initializes LockedHeap with start pointer
โข Provides heap_start() and heap_size() queries
โข Returns Result<(), ()> for error handling
Memory Statistics (displayed at boot):
โข Heap Start : 0x444444440000
โข Heap Size : 100 KB
โข Status : DYNAMIC ALLOCATION OK
Role: Hierarchical in-memory file storage with directories and permissions
Structure:
โข Inode: uid, permissions, node_type (File/Directory)
โข File: inode + data (Vec<u8>)
โข Directory: inode + entries (BTreeMap<String, FsNode>)
โข RamFileSystem: root Directory + cwd (current working directory)
โข Global instance protected by Mutex
FsNode Enum:
โข File(File) - Regular file with content
โข Directory(Directory) - Container for other nodes
Features:
โข Hierarchical Structure:
- Root directory "/" as entry point
- Current Working Directory (CWD) navigation
- open(path) - Navigate to directory
- look() - List current directory contents
- room(name, uid) - Create new directory
โข File Operations:
- write_file(name, content, uid) - Create/overwrite with UID tracking
- read_file(name) - Read file as String (returns Option)
- remove_file(name) - Delete file/directory (returns bool)
- get_stats() - Returns (file_count, total_bytes)
โข Path Navigation:
- "/" - Return to root
- ".." - Go up one level
- name - Enter subdirectory
โข Security:
- UID tracking for file ownership
- Permission flags (0o644 for files, 0o755 for directories)
- Home directory auto-creation for new users
Storage:
โข In-memory only (volatile)
โข Unicode support via UTF-8 lossless conversion
โข No persistence (data lost on reboot)
Role: User management, authentication, and access control
Structure:
โข Role Enum: Admin, Standard
โข User: username, password_hash, role, uid
โข AuthManager: users Vec, current_user Option, next_uid u32
Features:
โข login(username, password) -> bool
- Authenticates user credentials
- Case-insensitive username matching
- Returns true on successful authentication
- Sets current_user session
โข logout()
- Clears current user session
- Sets current_user to None
โข add_user(username, password) -> Result<u32, &str>
- Creates new user with Standard role
- Assigns unique UID (starting from 1000)
- Prevents duplicate usernames
- Returns new UID on success
โข delete_user(username) -> Result<(), &str>
- Removes user from system
- Protects primary admin account
- Prevents deleting current user
- Returns error if user not found
โข get_current_username() -> String
- Returns current username or "Guest" if not logged in
โข get_current_uid() -> u32
- Returns current user's UID
- Returns 1000 for Guest
โข Role-based access control
- Admin: Full system access, user management
- Standard: Limited permissions
Default User:
โข Username: "andre"
โข Password: "admin123"
โข Role: Admin
โข UID: 0
Security Features:
โข Password masking during input
โข Session management
โข Credential validation
โข Case-insensitive username matching
โข Admin-only user management operations
Lazy Static Initialization:
โข AUTH: Mutex<AuthManager> for thread-safe access
โข Automatically initialized at kernel startup
Role: CMOS RTC access for time keeping with automatic timezone
Hardware Interface:
โข Address Port: 0x70 (write register index)
โข Data Port: 0x71 (read/write data)
โข BCD Format: Binary Coded Decimal
RtcTime Structure:
โข seconds: u8 (0-59)
โข minutes: u8 (0-59)
โข hours: u8 (0-23)
Functions:
โข read_rtc_register(reg: u8) -> u8
- Writes register index to port 0x70
- Reads data from port 0x71
- Returns raw BCD value
โข get_time() -> RtcTime
- Reads registers 0x00 (seconds), 0x02 (minutes), 0x04 (hours)
- Reads date registers 0x07 (day), 0x08 (month), 0x09 (year)
- Converts BCD to decimal
- Applies timezone adjustment (France UTC+1/+2)
- Returns RtcTime struct with corrected time
BCD Conversion:
โข BCD = (value & 0x0F) + ((value / 16) * 10)
โข Extracts low nibble and high nibble
โข Combines for correct decimal value
Timezone Support:
โข Automatic adjustment for France timezone
โข Summer time (DST): UTC+2 (March-October)
โข Winter time: UTC+1 (November-February)
โข DST calculated using European rules (last Sunday of March/October)
Features:
โข Battery-backed time keeping (independent of power)
โข Standard CMOS RTC chip compatible
โข 24-hour format support
โข No interrupts required for reading
โข Real-time clock display in shell (updated every second)
Role: PS/2 mouse input handling for cursor tracking
Hardware Interface:
โข Command Port: 0x64 (PS/2 controller)
โข Data Port: 0x60 (keyboard/mouse data)
โข Auxiliary Port: Enabled via command 0xA8
MouseState Structure:
โข phase: u8 - Packet decoding phase (0-2)
โข buffer: [u8; 3] - Raw packet data
โข x, y: i32 - Current cursor position
โข old_x, old_y: i32 - Previous position for rendering
Packet Protocol (3 bytes):
โข Byte 0: Flags (bit 0=Left, 1=Right, 2=Middle, 3=Always 1, 4=X sign, 5=Y sign, 6=X overflow, 7=Y overflow)
โข Byte 1: X movement delta (signed)
โข Byte 2: Y movement delta (signed)
Functions:
โข init() - Initialize mouse controller
- Enables auxiliary port
- Configures interrupt enable
- Sets bit default mouse parameters
- Enables data reporting
โข add_mouse_data(data: u8) - Process incoming mouse data
- Phase-based packet decoding
- Movement delta calculation with sign extension
- Position clamping to screen bounds (0-79 for X, 0-24 for Y)
- Cursor rendering
โข draw_cursor(x, y, old_x, old_y) - Render mouse cursor
- Tracks cursor position changes
- Prepares for visual cursor display
Features:
โข 3-byte packet protocol standard
โข Movement delta with sign extension
โข Screen boundary clamping
โข Button state tracking (left, right, middle)
โข Real-time position updates
โข Auxiliary port communication
โข Data reporting enable/disable
Status:
โข Driver initialized and functional
โข Cursor position tracking implemented
โข Visual cursor rendering prepared
Role: Async task structures and cooperative multitasking
TaskId:
โข Atomic u64 counter for unique identification
โข Thread-safe ID generation
โข Implements Debug, Clone, Copy, Eq, Ord
Task:
โข id: TaskId - Unique task identifier
โข future: Pin<Box<dyn Future<Output = ()>>>
- Pinned future for safe async execution
- Boxed for heap allocation
- Sized for task queue storage
YieldNow Future:
โข Cooperative multitasking primitive
โข yielded: bool flag
โข First poll returns Pending, second returns Ready
โข Used for task yielding in async contexts
yield_now() Function:
โข Creates YieldNow future
โข Enables cooperative task switching
โข Simple API for async code
Role: Async task scheduler and runtime
Executor Structure:
โข task_queue: VecDeque<Task>
- Double-ended queue for efficient push/pop
- FIFO ordering for round-robin scheduling
- Dynamic task storage
Methods:
โข new() -> Self
- Creates empty executor instance
- Initializes task queue
โข spawn(&mut self, task: Task)
- Adds task to end of queue
- Task: Future wrapped in Task struct
- Non-blocking operation
โข run(&mut self) -> !
- Main executor loop
- Calls run_ready_tasks() repeatedly
- Uses hlt() for power efficiency
- Never returns (infinite loop)
โข run_ready_tasks(&mut self)
- Polls all ready tasks
- Processes tasks in queue order
- Maintains remaining_tasks counter
- Re-queues pending tasks
Internal Functions:
โข dummy_waker() -> Waker
- Creates no-op waker for polling
- RawWaker with minimal VTable
- Required by Context::from_waker()
Waker Implementation:
โข clone: Duplicates RawWaker
โข no_op: Empty wake function
โข VTable: Static RawWakerVTable
Role: Text display on VGA screen
Specifications:
โข Address: 0xB8000
โข Size: 80 ร 25 = 2000 characters
โข Attributes: 1 color byte + 1 character byte
Features:
โข 16 ANSI colors (Black โ White)
โข Automatic scroll with line preservation
โข Smart backspace (wraps to previous line)
โข Hardware cursor update
โข Color-coded output support
Role: Translates scancodes to characters and shell command handling
Configuration:
โข Layout: French AZERTY
โข Scancode Set: 2 (IBM standard)
โข Control: Ignore Ctrl (for testing)
โข Command Buffer: 256 character capacity
Shell Commands:
โข help - Show available commands
โข info - Display system information
โข whoami - Display current user
โข date - Display current time from RTC
โข echo - Print text to screen
โข ls - List files in RAMFS
โข touch - Create new file
โข cat - Read file content
โข rm - Delete file
โข edit - Modify existing file
โข stats - Show filesystem statistics
โข neofetch - Display system info (ASCII art)
โข clear - Clear screen
โข Esc - Clear buffer + reset screen
Handled Keys:
โข Letters a-z, A-Z (AZERTY layout)
โข Digits 0-9
โข French accented characters (รจ, รฉ, รช, รซ)
โข Special characters (, ; : !)
โข Enter, Backspace, Escape
Role: Command interpreter with authentication
Shell Features:
โข Secure login system on boot
โข Password masking for sensitive input
โข Command history and buffer management
โข Multi-line command support
โข Color-coded prompt with user info
Login System:
โข Requires authentication before command access
โข Username and password prompts
โข Credential validation via AuthManager
โข Session persistence until logout
Prompt Format:
โข Shows current username and hostname
โข Visual indicator of authentication status
โข Example: "andre@jc-os:~$ "
Session Management:
โข Automatic login requirement
โข Session tracking with AuthManager
โข User identification for commands
โข Future: Multiple user sessions
Command Buffer:
โข 256 character capacity
โข Backspace with visual feedback
โข Escape key to clear and reset
โข Support for long commands with wrapping
Role: Debugging via serial connection
Configuration:
โข Port: COM1 (0x3F8)
โข UART: 16550 standard
โข Output: stdout during QEMU debugging
Usage:
โข Boot log: "[JC-OS] Kernel starting..."
โข System log: "[GDT] Loaded", "[IDT] Loaded"
โข Memory stats: "Heap Allocator Ready"
โข Panic display
โข Serial print for debugging
# Rust nightly with bare-metal target
rustup target add x86_64-unknown-none
# Bootable image creation tool
cargo install bootimage
# Required LLVM components
rustup component add llvm-tools-preview
# QEMU emulator
# Ubuntu/Debian: sudo apt install qemu-system-x86
# Arch: sudo pacman -S qemu
# macOS: brew install qemu# Debug mode (fast, with asserts)
cargo run
# Release mode (optimized, faster)
cargo run --release
# Create bootable image only
cargo bootimage
# Run bootable image with QEMU
qemu-system-x86_64 \
-drive format=raw,file=target/x86_64-jc-os/release/bootimage-jc-os.bin \
-serial stdioBy default, JC-OS v0.4 includes a secure login system:
Username: andre
Password: admin123
Role: Admin
UID: 0
Note: The first time you run JC-OS v0.4, you will be presented with a login screen. Use the default credentials above to access the shell. Administrators can create new users using the useradd command.
| Command | Description |
|---|---|
| (Login) | Enter username and password at startup |
| whoami | Display current authenticated user |
| logout | End current session |
| useradd | Create new user (Admin only) |
| userdel | Delete user (Admin only) |
| Command | Description | Usage |
|---|---|---|
look |
List directory contents | look |
open |
Change directory | open <directory> |
room |
Create directory | room <name> |
where |
Show current path | where |
note |
Create file with content | note <filename> <content> |
read |
Read file content | read <filename> |
drop |
Delete file/directory | drop <filename> |
edit |
Modify file | edit <filename> <new_content> |
type |
Interactive file editor | type <filename> |
| Command | Description |
|---|---|
/ |
Go to root directory |
.. |
Go up one directory level |
directory_name |
Enter subdirectory |
| Command | Description | Output Example |
|---|---|---|
info |
Display system info | JC-OS v0.4 - Andre Edition |
whoami |
Display current user | andre |
date |
Display current time (timezone adjusted) | Time: 14:30:45 |
stats |
Show filesystem stats | Files: 3, Memory: 256 bytes |
neofetch |
ASCII system info | Art + system details |
| Command | Description |
|---|---|
help |
Show available commands |
echo |
Print text to screen |
clear |
Clear the screen |
Enter |
Execute command |
Backspace |
Delete previous character |
Esc |
Clear buffer + reset screen |
| Shortcut | Description |
|---|---|
| Ctrl+S | Save file |
| Ctrl+Q | Quit editor |
qemu-system-x86_64 -drive format=raw,file=target/x86_64-jc-os/debug/bootimage-jc-os.bin -serial stdio
[JC-OS] Kernel starting...
[GDT] Loaded
[IDT] Interrupt Descriptor Table loaded
[PIC] Initialized - Timer and Keyboard enabled
[PS/2] Keyboard controller initialized
[KEYBOARD] Driver initialized (AZERTY layout, Set2)
[PAGING] 4-Level page tables initialized
[FRAMES] Boot info frame allocator ready
[SYSTEM] Heap Allocator Ready
[FS] RAM File System initialized (Hierarchical)
[AUTH] Authentication system initialized
[RTC] Real Time Clock initialized (Timezone: Europe/Paris)
[MOUSE] PS/2 Mouse driver initialized
[EXECUTOR] Task scheduler ready
JC-OS - BARE METAL KERNEL v0.4 - RUST EDITION
--- LOGIN REQUIRED ---
Username: andre
Password: ********
Welcome back, andre!
Digital Sovereignty System
File System: READY (Hierarchical RAMFS) | Try: look, open, room, where
Task Scheduling: READY | Async/Await supported
Authentication: ENABLED | Session active
andre@jc-os:/$ help
Commands: help, info, stats, echo, whoami, look, open, room, where, note, read, drop, type, useradd, userdel, date, neofetch
andre@jc-os:/$ date
Time: 14:30:45 (UTC+2, Summer Time)
andre@jc-os:/$ room home
Directory 'home' created.
andre@jc-os:/$ open home
andre@jc-os:/home$
andre@jc-os:/home$ room andre
Directory 'andre' created.
andre@jc-os:/home$ note welcome.txt "Welcome to JC-OS!"
File 'welcome.txt' created.
andre@jc-os:/home$ look
andre/
welcome.txt
andre@jc-os:/home$ where
/home
andre@jc-os:/home$ open andre
andre@jc-os:/home/andre$
andre@jc-os:/home/andre$ type test.txt
[TYPE: test.txt] (Ctrl+S to save, Ctrl+Q to exit)
Hello from interactive editor!
andre@jc-os:/home/andre$ useradd john secret123
[AUTH] User 'john' created with UID 1000.
[FS] Home directory /home/john created.
andre@jc-os:/home/andre$ stats
--- SYSTEM STATS ---
Files/Folders : 2
Used Space : 25 bytes
andre@jc-os:/home/andre$ neofetch
_/_/ JC-OS v0.4 - Rust Edition
_/ User : andre
_/_/_/ FS : Hierarchical RAMFS
Time : 14:30:45
andre@jc-os:/home/andre$ where
/home/andre
andre@jc-os:/home/andre$ logout
--- LOGIN REQUIRED ---
Username: andre
Password: ********
| Crate | Version | Usage |
|---|---|---|
bootloader |
0.9.23 | Kernel bootstrapping + memory map |
x86_64 |
0.14 | x86_64 CPU structures + paging |
spin |
0.9 | Lock-free synchronization |
pc-keyboard |
0.7.0 | PS/2 scancode parsing |
pic8259 |
0.10.1 | 8259 PIC controller |
uart_16550 |
0.2.0 | COM1 serial port |
lazy_static |
1.4.0 | Deferred static initialization |
volatile |
0.2.6 | VGA volatile memory access |
linked_list_allocator |
0.10 | Heap allocation algorithm |
crossbeam-queue |
0.3.12 | Lock-free queue for task scheduling |
alloc |
- | Dynamic memory allocation |
# Check installation
which qemu-system-x86_64
# Install if needed
sudo apt install qemu-system-x86 # Debian/Ubuntu# Add x86_64-unknown-none target
rustup target add x86_64-unknown-noneVerify VGA graphics mode is enabled in QEMU with -vga std.
Use -serial stdio parameter to redirect COM1 to the terminal.
Ensure enough physical memory is available (QEMU default: 128MiB).
Increase with: -m 256M
Check AZERTY layout mapping or try with US QWERTY layout.
Ensure RAMFS is initialized: check boot log for "[FS] RAM File System initialized"
- Verify RTC is properly initialized in QEMU
- Check CMOS battery status (virtual in QEMU)
- Ensure BCD conversion is working correctly
- Verify credentials: username "andre", password "admin123"
- Check that AUTH system initialized in boot log
- Ensure passwords are case-sensitive for username matching
- Try resetting credentials if persistent storage available
Verify executor is initialized and run() is called in main loop
- Mouse Integration - Full cursor rendering, click events, GUI interaction
- Page Fault Handler - Better memory error reporting and debugging
- Kernel Heap Expansion - Dynamic heap growth based on demand
- Persistent Storage - Disk driver with FAT32 reading/writing
- Advanced Shell - Tab completion, command history, environment variables
- Preemptive Scheduling - Timer-based task switching
- Multiple Executors - Multi-core task distribution
- Task Priorities - Priority-based task scheduling
- Inter-Task Communication - Channels, signals, and message passing
- Virtual File System - VFS abstraction layer for multiple file systems
- Process Management - Process creation, termination, and IPC
- System Calls - User-mode to kernel-mode transitions
- Memory Protection - User/kernel memory isolation
- Enhanced Authentication - Password hashing with bcrypt/argon2
- Multi-User Sessions - Multiple concurrent user sessions
- Audit Logging - Authentication logs, command history tracking
- Network Support - Network card driver and basic networking
- GUI Subsystem - Window manager and basic graphics
- Date Display - Full date functionality with timezone selection
- File Permissions - Permission enforcement per UID
- User Authentication: Login required before shell access
- Role-Based Access: Admin vs Standard user roles
- User Management: Admin-only user creation and deletion
- UID Tracking: Unique user identification system
- Session Management: Track current authenticated user
- Password Masking: Hide password input during login
- Credential Validation: Case-insensitive username matching
- Home Directory Isolation: Each user gets personal directory
- Password Hashing: Replace plain-text password storage with bcrypt/argon2
- Multi-Factor Authentication: Additional verification methods
- Session Timeout: Automatic logout after inactivity
- Account Lockout: Brute-force protection
- Audit Trail: Log all authentication attempts and privileged actions
- Secure Boot: Verify kernel integrity at startup
- User Isolation: Separate memory spaces per user
- Permission System: File and command access control enforcement
This project is licensed under Apache 2.0.
Issues and pull requests are welcome to improve the project!
JC-OS v0.4 - Andre Edition
A minimalist bare-metal operating system written in Rust