Skip to content

MAliffadlan/Mectov_OS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mectov OS v25.0 — The IntelliMouse, SB16 Audio & Shared Library Update

The Mectov Kernel — an operating system kernel written from scratch in C and Assembly. No external libraries, no libc, no POSIX — every byte runs directly on hardware.

About

Mectov OS is a hobby operating system designed as a learning project and technical showcase. It boots via GRUB Multiboot, sets up protected mode with paging, and provides a fully graphical desktop environment with floating windows, custom static wallpapers, persistent draggable icons, hardware detection, standalone Ring 3 user applications, and real internet connectivity.

The v25.0 release delivers a massive ergonomics, audio, and architectural upgrade:

  1. Physical Mouse Scroll Support: IntelliMouse 4-byte protocol driver with custom rate-negotiation, kernel event loop propagation, and scroll events delivered directly to Ring 3 user-space applications (Browser, Explorer, PCI Manager, Volume Control).
  2. Dynamic Sound & Music (SB16): Upgraded kernel audio sub-system to drive Sound Blaster 16 ISA registers, playing and rendering .wav audio files smoothly in the new Graphical Music Player (mplayer.mct).
  3. Homegrown Shared Library System (libc.mct): Homegrown dynamic linking DLL-style loader that lets Ring 3 user applications share a single runtime libc.mct library in the virtual file system, shrinking application sizes down to ~1KB.
  4. Enhanced Kernel Stability & Network: Increased user stack size to 64KB (from 8KB) to fully isolate heavy network and DNS payload buffers, and updated DNS querying to route over QEMU's virtual gateway (10.0.2.3).
  5. TCP Real-time Debugging: Replaced files-only logging with a real-time TCP serial logging bridge over port 45454, paired with interactive python tools (debug.py).
  6. Secondary ext2 Partition: Multi-drive ATA support mounting a secondary 2MB virtual disk (ext2.img) automatically formatted as ext2 filesystem partition under QEMU index 1.
  7. Enhanced GUI Terminal Emulator: Re-engineered Ring 3 Terminal (terminal.c) with a 16-command circular history buffer (navigated using Up/Down arrow keys) and an active, dynamic VFS-based Tab autocomplete system for shell commands and filenames.
  8. Private Gitea Migration: Configured personal Gitea repository hosting remote (gitea) pointing to the home server at https://git.mectov.my.id/maliffadlan/Mectov-OS.git to migrate from GitHub to a private self-hosted Git repository server.

Created by M Alif Fadlan.


Architecture

+--------------------------------------------------------------------+
|                       GRUB Multiboot (VBE)                         |
+--------------------------------------------------------------------+
|  boot.asm  -->  kernel.c  (kernel_main entry point)                |
+--------------------------------------------------------------------+
|  GDT (Ring 0+3)  |  IDT (ISR+IRQ)  |  TSS  |  Syscall (int 0x80)   |
+--------------------------------------------------------------------+
|  PIT Timer (1kHz) |  Keyboard (PS/2) |  Mouse (PS/2) |  Serial     |
+--------------------------------------------------------------------+
|  Memory Manager   |  VMM (Virtual Mem)|  IPC Message Queues        |
+--------------------------------------------------------------------+
|  Priority Thread   |  VFS + ATA PIO   |  PCI Scanner               |
+--------------------------------------------------------------------+
|  VGA/VESA Driver   |  Window Manager   |  RTL8139 NIC              |
+--------------------------------------------------------------------+
|  Network Stack (Ethernet/ARP/IPv4/ICMP/UDP/DNS)                    |
+--------------------------------------------------------------------+
|  MCT App Loader   |  Ring 3 User Tasks|  Display List Renderer     |
+--------------------------------------------------------------------+
|  Desktop (Squircle Icons) |  Taskbar (Glossy) |  Start Menu        |
+--------------------------------------------------------------------+
|  File Descriptors    |  UNIX Pipe           |  Login Screen         |
+--------------------------------------------------------------------+

Target Platform

  • Architecture: i386 (32-bit x86), Monolithic Kernel
  • Ring Levels: Ring 0 (Kernel) + Ring 3 (User Mode) — ACTIVE and Stable
  • Scheduler: Preemptive Priority Round-Robin, Ring-Aware Context Switching
  • Display: VESA VBE Linear Framebuffer, 1024x768, 32-bit color
  • Storage: ATA PIO (IDE), 1MB virtual disk
  • Audio: PC Speaker via PIT Channel 2
  • Bus: PCI Configuration Space (ports 0xCF8/0xCFC)
  • Network: RTL8139 NIC (virtual, via QEMU)
  • Serial: COM1/COM2 UART 16550A (38400 baud, 8N1)

Core Subsystems

1. Modern Mouse Cursor (src/drivers/vga.c)

  • High-Resolution Bitmap: Upgraded from 8x16 to a sleek 16x24 design.
  • Premium Contrast: Black inner fill with a crisp white outline for maximum visibility on any background.
  • Dynamic Drop Shadow: A real-time 50% alpha-blended shadow cast beneath the cursor for a depth effect.
  • Zero Lag: Optimized drawing logic with dirty-region tracking.

2. Window Manager (src/gui/wm.c)

  • Double-buffered rendering using fast memcpy with dirty region tracking.
  • Z-ordered floating windows with proper overlap handling.
  • Rounded corners (radius 8) on all windows for a modern look.
  • Vibrant macOS-style "traffic light" control buttons with indicator symbols:
    • Close (vibrant red circle with 'X' symbol)
    • Minimize (vibrant yellow circle with '-' symbol)
    • Maximize (vibrant green circle with '+' symbol)
  • Aero Snap: Drag windows to screen edges for automatic half-screen (left/right) or full-screen (top) snapping with saved geometry restore.
  • Window Resizing: Drag any window edge or corner to resize. 8-directional edge detection with minimum size constraints (220×150).
  • Window Close Callback: wm_close now notifies the terminal to kill child processes and reset state.
  • Clean Flat Aesthetic: Removed heavy shadows around windows to focus on a crisp, modern UI.

3. Taskbar & System Tray (src/gui/taskbar.c)

  • WiFi Status Indicator: Replaced the RAM bar with a classic 3-arc WiFi icon, representing the OS's network capability.
  • "Mectov OS" Start button with vertical separator line for distinct UI partitioning.
  • Glossy dark background with Catppuccin Mocha accent border.
  • Icon-only window buttons: each open app shown as a 16x16 squircle icon matching the desktop style.
  • System tray with:
    • CAPS indicator (vibrant red when active)
    • HDD activity LED (red flash on disk I/O)
    • Digital clock with day of week, adjusted for UTC+7 (WIB) timezone.

4. Real-time Rendering (kernel.c + src/drivers/vga.c)

  • Shadow Framebuffer: Triple-buffer architecture (back_buffer → front_buffer_copy → VGA MMIO). Only pixels that actually changed are written to hardware, eliminating thousands of expensive KVM VM-Exits per frame.
  • VSync Disabled: Removed VGA port 0x3DA polling which caused massive latency spikes under KVM virtualization.
  • Forced 60Hz Loop: Constant 16ms redraw cycle with ultra-low render times (~4ms) thanks to delta-only copying.
  • Microsecond Timing: Real-time FPS and render time measurement using PIT hardware counters.

5. Desktop Environment (src/gui/desktop.c)

  • Custom Baked Wallpaper: Full-color 1024x768 image processed via Python build script.
  • Professional Squircle Icons: High-end rounded-rect icons with minimalist glyphs and curated color palettes.
  • Draggable Persistent Icons: Icon positions are saved to icons.cfg on the VFS and persist across system reboots.
  • Application Double-Click Launcher: Desktop icons are fully interactive and support double-clicking to launch their respective .mct executable.

6. Login Screen (src/gui/login.c)

  • Graphical login with wallpaper backdrop and semi-transparent overlay.
  • Password input field with masked characters (●) and shake animation on wrong password.
  • CAPS LOCK indicator warning.
  • Sound feedback (beep) on login events.

7. Virtual Memory Manager (src/sys/vmm.c + src/include/vmm.h)

  • Frame Bitmap Allocator: Tracks 128MB of physical memory (32768 pages) with a compact bitmap for O(1) allocation/free.
  • Per-Process Address Spaces: vmm_create_page_dir() creates new page directories, vmm_clone_page_dir() copies kernel mappings for fork-like scenarios, vmm_free_page_dir() tears down an address space.
  • Page Mapping: vmm_map_page() / vmm_map_pages() / vmm_unmap_page() with automatic TLB invalidation on CR3 reload.
  • Region Allocator: vmm_find_free_region() locates free virtual address ranges starting at 0x08000000.
  • Foundation for future demand paging and Copy-on-Write (COW) for Ring 3 process isolation.

8. IPC — Inter-Process Communication (src/sys/ipc.c + src/include/ipc.h)

  • Named Message Queues: Fixed-size 64-byte messages with a 16-deep circular buffer per queue.
  • Create & Connect: ipc_create_queue(name) for server processes, ipc_connect_queue(name) for clients.
  • Blocking Receive: ipc_receive() blocks the calling task until a message arrives, with tick-based timeout support.
  • Non-blocking Send: ipc_send() returns -1 immediately if the queue is full.
  • Enables service-oriented architecture and clean multitasking app ecosystem.

9. Priority Thread Scheduler (src/sys/task.c + src/include/task.h)

  • 4-Level Priority Round-Robin: IDLE(0) < LOW(1) < NORMAL(2) < HIGH(3). Higher priority runnable tasks always run first; round-robin scheduling within the same priority level.
  • Thread API: task_create_thread() spawns a thread within the same process (shared address space) using a pid/tid model. task_exit_thread() terminates the current thread.
  • Sleep/Wake: task_sleep(ticks) suspends a task for a specified duration; task_wake() resumes it. Used for efficient blocking I/O and timing.
  • Process Lifecycle: task_kill(tid) for external termination (used by Ctrl+C). Zombie process detection in SYS_GET_EVENT auto-kills orphaned tasks.
  • True CPU Yielding: SYS_YIELD now executes sti;hlt;cli to properly surrender the CPU until the next scheduler tick.
  • Full context switching: general-purpose registers, EFLAGS, ESP, and per-task page_dir pointer for VMM integration.
  • Per-task dual stacks: 16KB kernel stack + upgraded 64KB user stack to fully isolate memory under intensive network socket, file parsing, and DNS payload operations.
  • IRQ0-driven scheduler tick (1000Hz) with cooperative yield.

10. Network Stack (src/drivers/net.c + src/drivers/rtl8139.c)

  • RTL8139 NIC Driver: Full driver with PCI bus mastering.
  • Ethernet/ARP/IPv4/ICMP/UDP/DNS: Complete local stack built directly into the kernel space.
  • Reliable DNS Resolution: Upgraded DNS queries to point to QEMU's virtual gateway DNS server at 10.0.2.3 (switching from hardcoded 8.8.8.8) for robust internet routing.
  • Background Net Poller: Embedded packet listening into the timer-based process scheduler to handle asynchronous inbound packets gracefully.
  • Terminal commands: ping [ip] and host [domain].

11. Persistent File System (src/sys/vfs.c)

  • Virtual File System (16 file slots) with auto-save to disk.img via ATA PIO.
  • Persistence Fix: Reliable saving for configuration files like icons.cfg.

12. File Descriptor Layer (src/sys/fd.c + src/include/fd.h)

  • UNIX-style FD abstraction: Per-task file descriptor table (16 FDs per task, 128 global) wrapping VFS nodes.
  • Typed descriptors: FD_TYPE_FILE, FD_TYPE_PIPE_READ, FD_TYPE_PIPE_WRITE, FD_TYPE_DEV.
  • Reference counting: Global FD entries with ref_count for safe sharing between threads.
  • UNIX Pipe support: do_sys_pipe() creates a unidirectional pipe pair for inter-process data streaming.
  • Full syscall integration: sys_open, sys_read, sys_write, sys_close, sys_pipe all route through the FD layer.

13. MCT Application Runtime (.mct)

  • Custom Binary Format: 16-byte header with magic number verification and entry point specification.
  • Fixed-Base Mapping: Applications are mapped at virtual address 0x02000000 within their own isolated page directory.
  • Privilege Isolation: Clean transition from Ring 0 to Ring 3 via iret, ensuring user apps cannot execute privileged instructions.
  • Launch Arguments: The kernel can pass arguments (like filenames) to newly launched Ring 3 tasks, retrievable via SYS_GET_LAUNCH_ARG.
  • Independent Stacks: Each Ring 3 task maintains separate 16KB kernel and 64KB user stacks to avoid stack pointer overflows during large buffer parses.

14. User-Mode GUI API

  • Direct Window Management: Ring 3 applications can now create, raise, and close their own GUI windows via syscalls.
  • Graphics Primitive Syscalls: Accelerated SYS_DRAW_RECT and SYS_DRAW_TEXT for rendering directly into the application's window buffer.
  • Event Polling & Persistence: SYS_GET_EVENT allows user apps to respond to window-specific mouse and keyboard input. It implements a two-phase close signal, giving apps a chance to safely save data to the VFS before terminating.
  • Flicker-Free Updates: SYS_UPDATE_WINDOW ensures changes are committed to the display list and rendered during the next 60Hz frame sync.

15. Security & Pointer Validation (src/sys/syscall.c)

  • Safe Syscall Entry: Every pointer passed from Ring 3 is validated via validate_user_ptr to prevent kernel memory corruption or unauthorized data access.
  • Address Boundary Checks: Enforces strict memory boundaries (USER_MEM_LIMIT) for all syscall parameters.
  • Zombie Cleanup: The kernel automatically detects and terminates Ring 3 processes whose GUI windows have been closed (if they refuse to exit voluntarily), preventing orphaned tasks and resource leaks.
  • Privilege Separation: Use of Global Descriptor Table (GDT) and Task State Segment (TSS) to strictly enforce CPU privilege levels (Ring 0 vs Ring 3).

16. PS/2 IntelliMouse Scroll Wheel Support (src/drivers/mouse.c & src/gui/wm.c)

  • Driver Upgrade: Upgraded PS/2 mouse driver to the 4-byte IntelliMouse protocol, using a custom rate-negotiation sequence (200 -> 100 -> 80) to detect scroll-capable hardware.
  • Kernel Event Routing: The main kernel loop catches scroll deltas and dispatches them via wm_handle_scroll() to targeted windows, encoding up/down ticks as custom button events (0x10 and 0x20).
  • Ring 3 Event Propagation: Emits standard event type 4 (Scroll Event) containing scroll direction delta (+1 for up, -1 for down) to Ring 3 apps via the SYS_GET_EVENT syscall.
  • Full Application Integration: Native vertical scrolling integrated seamlessly across standard user-space applications:
    • Mini Browser: Scrolls active web page contents effortlessly (3 lines per tick).
    • File Explorer: Easy navigation through folder list structures.
    • PCI Manager: Smooth scrolling through the system hardware list.
    • Volume Manager: Intuitive scroll-to-adjust volume control (adjusts volume by ±5 per notch).

17. Sound Blaster 16 (SB16) Audio System (src/drivers/sb16.c)

  • Sound Blaster Hardware Driver: Native ISA direct-register programming for Sound Blaster 16 compatibility.
  • Dynamic WAV Playback: Supports loading and decoding dynamic 8-bit/16-bit mono/stereo .wav files via VFS and streaming audio through the virtual DSP.
  • Sound Synthesis: Support for playing discrete frequencies (beeps) with programmable duration directly through Sound Blaster or PC Speaker hardware.
  • Volume Controller Integration: Mapped to QEMU's PA sound engine (-device sb16,audiodev=snd0) for clear real-time system audio feedback.

18. Homegrown Dynamic Shared Library System (apps/lib/libc.c & libc.h)

  • Dynamic Runtime Linking (libc.mct): Built a homegrown dynamic linking and loading subsystem. The dynamic loader (SYS_LOAD_LIBRARY / mct_load_library) retrieves the memory base of the export table for a library in memory.
  • Extremely Slim Binaries: Ring 3 application executables (like browser.mct, explorer.mct, notepad.mct) no longer statically compile common functions, shrinking binary file sizes from 30KB+ to under 2KB.
  • Standard Lib Wrappers: Full resolution of standard library functions at runtime via export table pointer indexes (__mct_lib_ptr):
    • String Handling: strlen, strcpy, strcat, atoi, itoa, itoa_pad
    • Formatting & Output: printf, sprintf
    • POSIX Wrappers: open, read, write, close, malloc, free, exit, sleep

19. Multi-Drive & Secondary ext2 Partition Support (src/sys/vfs.c & run.sh)

  • ATA Dual Drive Support: Kernel ATA driver upgraded to detect and mount secondary IDE/ATA devices.
  • Secondary ext2 Disk: Automatically creates and mounts a secondary 2MB virtual disk (ext2.img) initialized via mkfs.ext2 at index 1 in QEMU.
  • Web Gateway Proxy Integration (gateway.py): Background gateway process running on the host that translates QEMU network queries and streams live data between the guest OS and the real internet.
  • TCP Real-time Debugging Socket: Serial port debugging upgraded to a TCP socket server on port 45454 (replacing files-only logging), allowing real-time, zero-lag log streaming into our python interactive debugger (debug.py).

20. User-Space Terminal Emulator Enhancements (terminal.c)

  • Arrow-Key Command History: Tracks up to 16 commands in a local circular history buffer. Intercepts non-ASCII Up Arrow (0xE048) and Down Arrow (0xE050) key events, visually clearing the input line using backspaces and replacing it with the history entry.
  • Dynamic VFS Tab Completion: Intercepts Tab (\t) key events, parses the current word prefix, and dynamically queries the VFS via sys_stat_file and sys_list_dir to autocomplete both built-in shell commands and active directory files/folders.

21. Self-Hosted Gitea Integration (Git Hosting Migration)

  • Home Server Remote Tracking: Added a dedicated gitea Git remote tracking the repository at https://git.mectov.my.id/maliffadlan/Mectov-OS.git.
  • Infrastructure Autonomy: Seamlessly routes all future feature branch pushes, commit tracking, and code releases directly onto the self-hosted Gitea home server, operating as the primary remote alongside GitHub.

Syscall API Reference

All syscalls are invoked via int 0x80. Register conventions: EAX=syscall number, EBX/ECX/EDX/ESI/EDI=arguments.

Core Syscalls (1–10)

# Name Description
1 SYS_PRINT Print string. EBX=str_ptr, ECX=color
2 SYS_OPEN Open/create VFS file. EBX=filename → return fd
3 SYS_READ Read file. EBX=fd, ECX=buf, EDX=size → bytes read
4 SYS_WRITE Write file. EBX=fd, ECX=buf, EDX=size → bytes written
5 SYS_CLOSE Close file descriptor. EBX=fd
6 SYS_MALLOC Allocate memory (Identity-mapped heap)
7 SYS_FREE Free allocated memory
8 SYS_GET_TICKS Get PIT timer tick count
9 SYS_YIELD Yield CPU (sti;hlt;cli for true CPU surrender)
10 SYS_EXIT Terminate current task

GUI Syscalls (11–17)

# Name Description
11 SYS_DRAW_RECT Draw rectangle. EBX=win_id, ECX=x, EDX=y, ESI=(w<<16)|h, EDI=color
12 SYS_DRAW_TEXT Draw text. EBX=win_id, ECX=x, EDX=y, ESI=str_ptr, EDI=color
13 SYS_GET_KEY Get keyboard char (non-blocking) → char or 0
14 SYS_GET_MOUSE Get mouse state → EAX=x, EBX=y, ECX=buttons
15 SYS_CREATE_WINDOW Create window. EBX=x, ECX=y, EDX=w, ESI=h, EDI=title → win_id
16 SYS_GET_EVENT Get window event. EBX=win_id, ECX=event_ptr (auto-kills zombie tasks)
17 SYS_UPDATE_WINDOW Commit draw commands. EBX=win_id

Thread & Process Management (18–22)

# Name Description
18 SYS_THREAD_CREATE Create thread. EBX=entry, ECX=priority, EDX=page_dir → TID
19 SYS_SLEEP Sleep current task. EBX=ticks
20 SYS_GET_PID Get current task ID / TID
21 SYS_SET_PRIORITY Set task priority. EBX=tid, ECX=priority
22 SYS_GET_PRIORITY Get task priority. EBX=tid → priority

IPC — Inter-Process Communication (23–28)

# Name Description
23 SYS_IPC_CREATE Create message queue. EBX=key → queue ID
24 SYS_IPC_SEND Send message (blocking). EBX=qid, ECX=type, EDX=data, ESI=len
25 SYS_IPC_RECV Receive message (blocking). EBX=qid, ECX=type_out, EDX=data_out, ESI=len_out
26 SYS_IPC_DESTROY Destroy queue. EBX=qid
27 SYS_IPC_TRY_SEND Non-blocking send. Returns 0/-1
28 SYS_IPC_TRY_RECV Non-blocking receive. Returns 0/-1

Virtual Memory (29–31)

# Name Description
29 SYS_VMM_MAP Map page. EBX=vaddr, ECX=paddr, EDX=flags
30 SYS_VMM_ALLOC Allocate virtual page. EBX=vaddr, ECX=flags → vaddr or 0
31 SYS_VMM_FREE Free virtual page. EBX=vaddr

UNIX Compatibility & Hardware Interface (32–38)

# Name Description
32 SYS_PIPE Create pipe pair. EBX=pipefd[2] → return 0/-1
33 SYS_GET_TIME Get RTC clock time. EBX=rtc_time_t* ptr
34 SYS_PLAY_SOUND Play PIT / Sound Blaster sound frequency. EBX=freq, ECX=duration_ms
35 SYS_GET_SYSINFO Get hardware and kernel statistics. EBX=sysinfo_t* ptr
36 SYS_GET_PCI_INFO Get list of detected PCI devices. EBX=pci_device_t* array, ECX=max
37 SYS_LIST_DIR List VFS directory contents. EBX=dir_entry_t* array, ECX=max, EDX=parent_node
38 SYS_STAT_FILE Get file attributes and node index. EBX=path_ptr

Network Stack (39–43)

# Name Description
39 SYS_DNS_RESOLVE Asynchronously resolve domain to IP. EBX=domain_ptr
40 SYS_TCP_CONNECT Open TCP socket connection. EBX=ip_ptr, ECX=port
41 SYS_TCP_SEND Send raw TCP packet payload. EBX=data_ptr, ECX=len
42 SYS_TCP_RECV Read TCP socket stream. EBX=buf_ptr, ECX=max_len → bytes read / state
43 SYS_NET_STATUS Get packed network state (DNS resolved, TCP state)

Terminal & Extended Execution (44–51)

# Name Description
44 SYS_SET_STDOUT_IPC Set process stdout redirection queue. EBX=qid (0 to disable)
45 SYS_EXEC_CMD Run shell command program. EBX=cmd_string_ptr
46 SYS_GET_TASKS Get list of running tasks. EBX=sys_task_info_t* array, ECX=max
47 SYS_GET_WINDOWS Get list of open windows. EBX=sys_win_info_t* array, ECX=max
48 SYS_KILL_TASK Force kill a task. EBX=tid
49 SYS_GET_LAUNCH_ARG Get launch argument string. EBX=buf, ECX=max_len
50 SYS_CREATE_FILE Directly create an empty file in VFS. EBX=filename
51 SYS_LOAD_LIBRARY Dynamically load a shared library base. EBX=lib_name_ptr → base address

Applications

Application Type Description
Terminal Ring 3 (.mct) Full terminal emulator with 16-command circular history (Up/Down arrows) and VFS tab autocomplete
Nano Editor Ring 3 (.mct) Windowed text editor for VFS files with stable auto-save
Notepad Ring 3 (.mct) Sleek text editor with menu bar options, Save As dialog, and dirty-state tracking
File Explorer Ring 3 (.mct) Browse and open stored files
System Info Ring 3 (.mct) Live RAM, CPU, resolution, uptime, and MAC address
Task Manager Ring 3 (.mct) Monitor CPU, RAM, and kill active user processes
PCI Manager Ring 3 (.mct) Scrollable table of detected PCI hardware with scroll wheel support
Music Player Ring 3 (.mct) Graphical audio player to stream and play mono/stereo dynamic .wav files via SB16
Volume Control Ring 3 (.mct) Slider utility to adjust system sound level, now supporting wheel scrolling
Clock Ring 3 (.mct) Digital clock with WIB timezone
Snake Ring 3 (.mct) Modern grid-based snake game in WM window with gradient body, score, speed scaling
Mini Browser Ring 3 (.mct) Text-mode web browser navigating via host proxy gateway with scroll support
Hello Ring 3 Ring 3 (.mct) Demo user-space app with isolated memory and GUI window
GUI Calculator Ring 3 (.mct) Standalone external GUI calculator
Power Options Ring 0 Shut Down, Restart, and Log Out dialog with accurate button hit-zones
DOOM Engine Ring 0 (Port) Full integration of the legendary 1993 DOOM engine with graceful exit to desktop

Build and Run

Requirements

  • gcc (with -m32 support)
  • nasm
  • make
  • qemu-system-i386
  • python3 + Pillow

Commands

# Clean and build the OS
make clean && make

# Run in QEMU
./run.sh

Building User Applications (.mct)

User mode applications are written in C, compiled with gcc -m32, and processed into the .mct format:

  1. Compile: gcc -m32 -march=i386 -fno-pie -ffreestanding -c app.c -o app.o
  2. Link: ld -m elf_i386 -T apps/app.ld app.o -o app.elf
  3. Format: python3 build_mct.py app.elf app.mct
  4. Deploy: The Makefile automatically handles this and uses inject_vfs.py to bake the .mct binaries into disk.img.


Version History

Version Highlights
v25.0 IntelliMouse, Audio, Shell & Git Enhancements: Upgraded mouse driver to 4-byte IntelliMouse protocol supporting smooth scrolling in Browser, Explorer, PCI, and Volume Manager. Upgraded kernel audio to Sound Blaster 16 supporting dynamic WAV music stream playback. Built a dynamic shared library system (libc.mct) with a dynamic loading subsystem, reducing app binary sizes to ~1KB. Increased user stacks to 64KB and updated DNS to route over virtual gateway. Enhanced GUI Terminal with 16-command history buffer (Up/Down arrow navigation) and dynamic client-side VFS Tab completion. Gitea Migration: Added self-hosted home server remote gitea for private repository tracking.
v24.0 DOOM Engine Port: Fully playable port of the classic 1993 DOOM engine integrated directly into the kernel. Features keyboard polling, double buffer to MMIO front buffer translation, graceful OS exiting (vga_force_sync), and proper process teardown.
v23.0 Performance & Stability: Shadow Framebuffer (delta-only MMIO), VSync removal, zombie process detection + auto-kill, task_kill() API, Ctrl+C signal, Ctrl key tracking, Snake rewritten as WM app, terminal prompt protection, smart tab-completion with trailing space/slash, carriage return support, history display fix, power menu restart fix, -no-reboot removal.
v22.0 Kernel Modernization: Virtual Memory Manager (per-process address spaces, page mapping, region allocator), IPC named message queues (non-blocking send, blocking receive with timeout), 4-level priority thread scheduling with sleep/wake API, and 14 new syscalls (VMM/thread/IPC).
v21.0 Premium UI Refinement: High-res sleek mouse cursor with dynamic shadow, classic 3-arc WiFi indicator in system tray, and return to forced 60Hz real-time rendering loop.
v20.0 Modern UI Modernization: Professional squircle icons, vibrant macOS buttons with symbols (X, -, +), taskbar separator, flat design removal of shadows.
v19.0 Modern UI Redesign: Glass-morphism icons, Catppuccin theme, rounded corners, glossy taskbar.
v18.0 External App Ecosystem: .mct format, syscalls, Ring 3 apps (Calculator).
v17.0 Terminus Bold font, Draggable icons, VFS persistence.

License

MIT License

Created by M Alif Fadlan.

Salah satu proyek OS hobi buatan Indonesia yang paling lengkap dan terdokumentasi dengan baik di GitHub saat ini

About

Sistem operasi 32-bit (x86) buatan mahasiswa Indonesia dari nol. GUI, Multitasking, Networking, dan User Mode (Ring 3) tanpa pustaka eksternal. credit M Alif fadlan

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors