Skip to content

Zer0-Bug/ArcadeSpaceShooter_Basekernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Shooter: Kernel-Integrated Arcade

C Basekernel QEMU VESA License

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.

° ° ° °



Kernel Architecture

Unlike standard games that run as user-space applications, this version is baked directly into the Operating System Kernel, providing zero-latency hardware access:

  1. Monolithic Game Loop: The game logic is integrated into kernel_main(), executing immediately after system initialization (interrupts, memory paging, and RTC setup).
  2. Hardware Level Input: Bypasses traditional OS APIs by using keyboard_read(1) to poll the hardware interrupt controller for real-time key states.
  3. VESA Framebuffer Pipeline: Renders directly to the video memory using the kernel's graphics_create_root() driver, supporting primitives like graphics_line and graphics_rect.
  4. Deterministic Timing: Implements a custom busy-wait delay() system to ensure consistent gameplay speed across different processor clock frequencies in a non-preemptive environment.


Project Structure

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


System Mechanics

  • 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 printInt routine that parses integers directly to the framebuffer.

Operating Controls

Command Physical Key
Coordinate Increment (UP) W
Coordinate Decrement (DOWN) S
Initialize Projectile Space


Technical Specifications

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


Deployment & Installation

1. Build Requirements

You will need a cross-compiler setup for i386-elf if you are not running on a native 32-bit Linux host.

2. Acquisition

git clone https://github.com/Zer0-Bug/ArcadeSpaceShooter_Basekernel.git
cd ArcadeSpaceShooter_Basekernel/basekernel

3. Compilation

Build the bootable kernel image using the provided Makefile:

make

4. Running the OS

Launch the game image directly in QEMU:

qemu-system-i386 -cdrom basekernel.iso


Contribution

Contributions 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:

  1. Fork the repository.
  2. Create a new branch for your change:
    git checkout -b feature/your-feature-name
  3. Commit your changes with a clear and descriptive message:
    git commit -m "Add: brief description of the change"
  4. Push your branch to your fork:
    git push origin feature/your-feature-name
  5. 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.

Email × LinkedIn


Releases

No releases published

Packages

 
 
 

Contributors

Languages