A modern, modular 64-bit kernel framework designed for learning operating system development. Features a complete console system, text editor, system information tools, and more!
Current Version: v0.5 - Now with Dolphin text editor, system info tools, and enhanced console features!
-
Build and Run:
cd src python3 build/gui-tk.py # Click "Full Automation" for one-click build and run
-
Try the Features:
help- See all available commandssysinfo- View system informationmem -map- See memory layoutdol -new test.txt- Create a text filels- List files and directories
-
Text Editing:
dol -open filename.txt- Open a file- Use arrow keys to navigate
- Press ESC then
wto save,qto quit
Popcorn is now a 64-bit (x86-64) kernel! This version has been fully converted from 32-bit to 64-bit architecture, featuring:
- Long mode initialization with page tables
- 64-bit GDT and IDT structures
- Support for modern x86-64 processors
- All the same features as before, now in 64-bit!
We provide a beautiful GUI build tool with modern animations:
cd src
python3 build/gui-tk.pyFeatures:
- Full Automation: One-click build and run
- Manual Mode: Individual build steps with verbose output
- Real-time Logs: See build progress in real-time
- Modern UI: Dark theme with smooth animations
- QEMU Integration: Direct kernel testing
All build tooling lives under src/build/:
| Script | Platform | Description |
|---|---|---|
build/macos.sh |
macOS | CLI + dialog menu; cross toolchain (clang/lld or x86_64-elf-gcc) |
build/linux.sh |
Linux / Fedora | CLI + dialog menu; native gcc/ld |
build/gui-macos.py |
macOS | WebView GUI (requires pywebview) |
build/gui-tk.py |
Cross-platform | Tkinter GUI with full automation |
macOS (CLI):
cd src
./build/macos.sh build # build kernel
./build/macos.sh iso # create bootable ISO
./build/macos.sh run # boot in QEMULinux / Fedora (CLI):
cd src
./build/linux.sh # interactive dialog menuFor verbose compile errors without the dialog UI, use ./build/macos.sh build from a terminal (macOS) or the Tkinter GUI’s verbose build mode.
Note: Direct kernel loading with -kernel may not work with all QEMU versions for 64-bit multiboot kernels. The ISO method is highly recommended.
Required tools for 64-bit build:
nasm(for 64-bit assembly)gccwith 64-bit support (-m64)ldwith x86-64 supportqemu-system-x86_64(64-bit QEMU)grub-mkrescue,grub-pc-bin,xorriso(for creating bootable ISO)
Install all dependencies:
Fedora/RHEL:
sudo dnf install nasm gcc qemu-system-x86 grub2-tools-extra grub2-pc-modules xorriso mtoolsUbuntu/Debian:
sudo apt-get install nasm gcc qemu-system-x86 grub-pc-bin grub-common xorrisoPlease note, the shell build scripts are Unix-only tools. They auto-detect dependencies and can install missing packages on macOS (Homebrew) or Linux (dnf/apt/pacman). For detailed compiler output, use the CLI commands or the Tkinter GUI verbose build mode.
If you are on Windows without WSL, use the Tkinter GUI (build/gui-tk.py) where possible.
Popcorn is a simple kernel framework designed to help you understand the basics of operating system development. The project includes a minimal bootloader, a kernel written in C, and some basic assembly code to get things started.
ROOT
└── Popcorn/
├── readme.md
├── LICENSE
├── pop.md
├── roadmap.md
└── src/
├── build/ (All build scripts and tooling)
│ ├── macos.sh (macOS CLI build system)
│ ├── linux.sh (Linux/Fedora CLI build system)
│ ├── gui-macos.py (macOS WebView GUI builder)
│ ├── gui-tk.py (Tkinter GUI builder)
│ └── popcorn_build/ (Python build library + UI assets)
├── core/ (Kernel core: boot, scheduler, memory, …)
├── pops/ (Pop modules: console commands, Dolphin, …)
├── includes/ (Shared headers)
├── link.ld (Linker script)
├── buildbase/ (Build logs and saved config; generated)
└── obj/ (Compiled objects; generated)
To build the project, follow the assembly and compilation instructions provided above. Ensure you have the necessary tools like nasm, gcc, and ld installed on your system.
After building the project, you can run the kernel using QEMU with the command provided above. This will start the system and display the kernel messages on the screen. "Pops" are modular components that extend kernel functionality without modifying the core kernel.c file.
- 64-bit x86-64 Architecture: Modern long mode with proper page tables
- Multiboot2 Support: Full bootloader specification compliance
- Hardware Cursor: Synchronized VGA hardware cursor positioning
- Scrollback Buffer: Page Up/Down to view command history
- Command History: Arrow keys for command navigation
- Autocomplete: Tab completion for all commands
sysinfo: Complete system overview (kernel, CPU, memory, bootloader)mem -map: Extended memory map from Multiboot2mem -use: Memory usage statisticsmem -stats: Detailed memory informationcpu -hz: CPU frequency detection using RDTSCcpu -info: Detailed CPU information (vendor, features, brand string)
- Complete Filesystem: In-memory file system with directories
- File Operations: Create, read, write, delete, copy, search
- Directory Management: Create directories, navigate, list hierarchy
- Path Support: Full path resolution and navigation
- Full-featured Editor: Line-based text editing with cursor navigation
- File Management: Create, open, save, close text files
- Navigation: Arrow keys, Enter, Backspace with proper line handling
- Command Mode: ESC commands (w, q, wq, q!) like vim
- Visual Feedback: Line numbers, cursor position, modification status
- Modern UI: Color-coded output with themes
- Status Bar: Real-time system information
- Error Handling: Standardized error messages
- Double Buffering: Smooth screen updates
- Scrollback: View previous output with Page Up/Down
- GUI Builder: Modern Python GUI with animations
- Automated Builds: One-click compilation and ISO creation
- Dependency Management: Auto-installation of required tools
- Cross-platform: Works on Linux, WSL, and Windows
The project is still in its early stages and marked as unstable. Future updates will include more features and improvements to the kernel framework.
Thank you to Swarnim A for showing me this intel book that made inputs possible for this kernel.