An extraordinary 2D Space Shooter implemented at the Kernel Level. Built within the Basekernel research operating system, this project replaces the standard OS shell with a high-speed arcade game loop, utilizing custom low-level drivers for VESA BIOS graphics and direct hardware interrupts.
Unlike standard games that run as user-space applications, this version is baked directly into the Operating System Kernel, providing zero-latency hardware access:
- Monolithic Game Loop: The game logic is integrated into
kernel_main(), executing immediately after system initialization (interrupts, memory paging, and RTC setup). - Hardware Level Input: Bypasses traditional OS APIs by using
keyboard_read(1)to poll the hardware interrupt controller for real-time key states. - VESA Framebuffer Pipeline: Renders directly to the video memory using the kernel's
graphics_create_root()driver, supporting primitives likegraphics_lineandgraphics_rect. - Deterministic Timing: Implements a custom busy-wait
delay()system to ensure consistent gameplay speed across different processor clock frequencies in a non-preemptive environment.
ArcadeSpaceShooter_Basekernel/
├── LICENSE # MIT License
├── README.md # Project documentation
│
├── basekernel/ # Core Operating System Source
│ ├── kernel/
│ │ ├── main.c # Integrated Game Logic & OS Entry
│ │ ├── graphics.c # VESA Driver Implementation
│ │ └── interrupt.c # Low-level IRQ Management
│ ├── library/ # Kernel common utilities
│ ├── include/ # System headers (VESA, RTC, ATA)
│ ├── Makefile # Kernel build system
│ └── basekernel.iso # Bootable OS Image
│
└── Screenshots/ # QEMU Gameplay Previews
├── basekernel_v1.PNG
├── basekernel_v2.PNG
└── basekernel_v3.PNG
- Triangle-Mesh Spaceship: A custom-drawn white triangle entity rendered using iterative line primitives.
- AABB Collision Grid: Kernel-side intersection logic for bullet-to-enemy and enemy-to-player detection.
- Pseudo-Random Spawning: Utilizes a 32-bit linear congruential generator (LCG) for deterministic enemy placement.
- 1020x700 Viewport: Utilizes high-resolution VESA graphics modes for a crisp, hardware-accelerated interface.
- Binary HUD: Real-time score rendering via a custom
printIntroutine that parses integers directly to the framebuffer.
| Command | Physical Key |
|---|---|
| Coordinate Increment (UP) | W |
| Coordinate Decrement (DOWN) | S |
| Initialize Projectile | Space |
| Layer | Specification |
|---|---|
| Operating Mode | 32-bit Protected Mode (x86) |
| Graphics Mode | VESA Linear Frame Buffer |
| Memory Layout | Custom Paged Memory Model |
| Executable Format | ELF (Internal) / Bootable ISO |
| Target Emulator | QEMU / VirtualBox |
You will need a cross-compiler setup for i386-elf if you are not running on a native 32-bit Linux host.
git clone https://github.com/Zer0-Bug/ArcadeSpaceShooter_Basekernel.gitcd ArcadeSpaceShooter_Basekernel/basekernelBuild the bootable kernel image using the provided Makefile:
makeLaunch the game image directly in QEMU:
qemu-system-i386 -cdrom basekernel.isoContributions are always appreciated. Open-source projects grow through collaboration, and any improvement—whether a bug fix, new feature, documentation update, or suggestion—is valuable.
To contribute, please follow the steps below:
- Fork the repository.
- Create a new branch for your change:
git checkout -b feature/your-feature-name - Commit your changes with a clear and descriptive message:
git commit -m "Add: brief description of the change" - Push your branch to your fork:
git push origin feature/your-feature-name - Open a Pull Request describing the changes made.
All contributions are reviewed before being merged. Please ensure that your changes follow the existing code style and include relevant documentation or tests where applicable.
∞