About Popcorn

Interactive hierarchy, boot chain, and Mermaid flow diagrams derived from the v0.5 tree—same names as core/ and pops/. The source catalog lists every file with a connection graph.

What is Popcorn?

Target: x86-64 ELF linked at 0x100000 with a Multiboot2 header (link.ld, kernel.asm entry start → long mode → kmain). Runtime: ring-0 VGA text surface at 0xB8000, PIC + IDT (timer 0x20, keyboard 0x21, syscall gate 0x80), PIT-driven ticks, kmalloc path, scheduler skeleton with static task stacks, syscall table (~21 entries), and nine registered pops before the shell loop. Host loop: toolchain produces kernel + ISO; qemu-system-x86_64 boots GRUB → your image. Version 0.5 is pre-1.0 and intentionally educational—not a production OS.

Key Features

Console System

VGA text-mode console with cursor management, color styling, scrolling, status regions, scrollback-oriented structures, command history, and tab completion—with ongoing hardening for input edge cases and consistent error reporting.

Pop Modules

Extend kernel functionality through modular “pops” that register with the kernel and use shared console utilities for consistent behavior and less duplication.

Utilities Framework

Shared helpers across modules and refactors toward constants and consolidated utilities (0.5 includes a focused cleanup pass alongside feature work).

Minimal Assembly

Written primarily in C with only essential assembly (boot, IDT/ISR plumbing, context switch paths), keeping the project approachable while still teaching real low-level mechanics.

Cross-platform dev (Linux / WSL / macOS)

WSL and native Linux remain first-class paths. For macOS, 0.5-era tooling expects a real ELF cross toolchain (for example Homebrew x86_64-elf-gcc / x86_64-elf-ld) plus ISO tooling (commonly i686-elf-grub-mkrescue for BIOS-bootable images under SeaBIOS/QEMU).

Keyboard Input

Interrupt-driven keyboard handling with IDT setup, including fixes for edge cases like double-processing during interrupt handling.

Timers, scheduling & syscalls (0.5)

Interrupt-driven architecture work, timer interrupts, scheduler foundations, task switching milestones, and syscall interface expansion (including fork/wait/mmap/munmap/stat/ioctl style bring-up with error handling emphasis).

Hardware introspection

Extended memory map handling, CPUID-based CPU reporting, frequency detection, multiboot information persistence, and sysinfo-style surfacing through pops and kernel paths.

ISO + QEMU workflow

Kernel is linked into a bootable ISO and run under QEMU separately from compilation, with Python-oriented builder support (Fedora-oriented) and shell build helpers aligned with the project’s build monitor tooling.

Pop Module System

The core of Popcorn's extensibility lies in its Pop Module system. Each "pop" is a self-contained module that can register itself with the kernel and uses the console system for consistent behavior:

typedef struct {
    const char* name;       /* module id */
    const char* message;    /* banner / HUD text */
    void (*pop_function)(unsigned int start_pos);
} PopModule;

All pop modules must save and restore console state (cursor position and color) to prevent interference with user input. The system maintains a registry of modules and executes them in registration order.

Current Pop Modules

Spinner Pop

Animated loading indicator displaying "Running... |/-\" with rotating animation in the top-right corner.

Uptime Pop

Real-time system tick counter showing "Ticks: XXXXXX" in the top-left corner.

Filesystem Pop

In-memory filesystem with commands: create, write, read, delete, mkdir, go, back, listsys.

Halt Pop

Visual halt screen with green screen effect, rainbow colors, and fade to black animations.

Shimjapii Pop

Example pop module for developers, displaying in the bottom right corner.

Sysinfo Pop

Surfaces hardware and boot information (memory map / CPU / frequency style details), complementing the 0.5 hardware introspection work.

Memory Pop

Memory-oriented reporting and interaction aligned with the kernel’s memory-management bring-up.

CPU Pop

CPU-oriented reporting built around CPUID-backed detection work in the 0.5 timeframe.

Dolphin Pop

In-kernel text editor experience (“Dolphin”) with navigation improvements during 0.5 development.

Building and Running

Popcorn provides multiple build system options for different environments:

  • ✦ Interactive build using build.sh (Unix / WSL / native Linux; macOS with cross toolchain)
  • ✦ PowerShell build script (build.ps1) for Windows users
  • ✦ Python build monitor / builder tooling (buildmon.py) used alongside shell workflows (0.5 aligned build.sh structure with this system)
  • ✦ Optional macOS GUI launcher (mac-build.py) layered on the same build steps (WebView UI + modular backend)
  • ✦ QEMU system emulation support (x86-64; CD/ISO boot)
  • ✦ Customizable memory and core allocation (where exposed by your launcher / scripts)

Note: All build systems are provided AS-IS without warranties. Use at your own risk. Versions below v1.0 are considered trial versions.

Technical Requirements

To build and run Popcorn, you'll need:

  • ✦ NASM (Netwide Assembler)
  • ✦ A working C toolchain that produces a 64-bit ELF kernel (commonly gcc + GNU ld on Linux/WSL; on macOS use a cross compiler such as x86_64-elf-gcc + x86_64-elf-ld)
  • ✦ QEMU for system emulation (qemu-system-x86_64)
  • ✦ ISO creation tooling (for example xorriso / mtools plus a GRUB mkrescue tool appropriate to your platform; BIOS boot under QEMU often uses an i686-elf-grub-mkrescue-style workflow on macOS Homebrew)
  • ✦ WSL or Linux strongly recommended for the historical Fedora-oriented Python builder path; macOS is supported with the cross toolchain + ISO tooling above

Computer Prerequisites

To work on Popcorn at a fluid level, you'll need:

  • ✦ 16GB RAM recommended (8GB RAM minimum)
  • ✦ 8th Gen i5 or higher with at least 4 cores, recommended 6
  • ✦ No graphics requirements
  • ✦ 1GB free space assuming WSL installed

WSL is strongly recommended for Windows developers. Native Linux is fully viable. macOS is supported for development in 0.5 when using Homebrew-provided cross compilers and BIOS-capable ISO tooling; QEMU behavior may differ by build (for example accelerator availability). Windows 11 and WSL 2.0 remain the recommended Windows stack.

Current Status & Limitations

Popcorn is currently in version 0.5 and marked as unstable with all versions being pre-releases. The project includes:

  • ✦ Modern console system with VGA text mode management (including scrollback/history/autocomplete foundations)
  • ✦ Modular pop system with the pops listed above
  • ✦ Keyboard input handling with interrupt support (including real-world edge-case fixes)
  • ✦ Shared utilities framework and refactors toward consistency
  • ✦ Interrupt-driven bring-up, timers, scheduler foundations, and task switching milestones
  • ✦ Expanded syscall work (fork/wait/mmap/munmap/stat/ioctl style interfaces) with integration-focused error handling
  • ✦ Boot-time hardware introspection (memmap/CPUID/frequency/multiboot persistence)
  • ✦ A working ISO → QEMU iteration loop for x86-64 (platform-specific toolchain caveats apply)

Work in Progress: The project remains actively developed. Even with a working ISO/QEMU loop in 0.5, many OS facilities are still experimental: syscall semantics evolve, scheduling is still maturing, and platform packaging (Linux vs macOS vs Windows) continues to tighten.

Contributions: Special thanks to Swarnim A for the Intel book reference that made keyboard inputs possible for this kernel.