Brew Kernel ASCII Art

|

A X86_64 kernel from scratch made by just one person.

Scroll Down

Features

64-bit Support

Full long mode support with multiboot2 compliance

VGA Text Mode

Custom driver with 16-color palette support

Interrupt Handling

Basic IDT implementation with essential handlers

Hardware Ready

Runs on actual x86_64 hardware

Quick Start

# Build the Docker environment
cd buildenv
docker build -t brewkernel-buildenv .

# Build the kernel
cd ..
docker run --rm -it -v "$(pwd)":/root/env --platform linux/amd64 voidkernel make build-x86_64

This will create a bootable ISO at dist/x86_64/kernel.iso

Running Brew Kernel

VM Installation

  • Run with QEMU: qemu-system-x86_64 -cdrom dist/x86_64/kernel.iso
  • If you were to use VirtualBox for example, make sure you use a VGA display and the recommended ram would be around 24mb (as long as it is higher than the size of the ISO file)

Hardware Installation

  • Install BalenaEtcher on your device
  • Flash kernel.iso to a USB drive
  • Enable legacy boot in BIOS
  • Boot using legacy option (not UEFI)
  • Connect display via VGA port only

Tested Hardware

  • HP EliteDesk 705 G4 DM 65W SBKPF
  • AMD Ryzen 5 PRO 2400G
  • AMD ATI Radeon Vega Series (VGA only)

Important: Running on actual hardware is not recommended. This software comes with NO warranty and is used at YOUR OWN RISK.

Technical Details

Memory Map

  • Kernel loaded at 1MB (0x100000)
  • 16KB Stack size
  • Identity-mapped page tables

VGA Output

  • 80x25 character resolution
  • 16-color palette support
  • Memory mapped at 0xB8000
  • Text mode with customizable colors

Integer Support

  • Signed integer printing with negative handling
  • Unsigned integer printing
  • Base-10 (decimal) output format
  • Automatic buffer management
  • Numbers automatically wrapped at screen boundaries

Interrupt Handlers

  • Division by Zero (Vector 0)
  • Debug Exception (Vector 1)
  • Page Fault (Vector 14)
  • Basic IDT implementation

Project Structure

Directory Layout

  • src/impl/kernel/ - Main kernel implementation
  • src/impl/x86_64/ - Architecture-specific code
  • src/intf/ - Header files and interfaces
  • targets/ - Target-specific files
  • buildenv/ - Docker build environment
  • dist/ - Build output directory

Build Outputs

  • Kernel binary: dist/x86_64/kernel.bin
  • Bootable ISO: dist/x86_64/kernel.iso
  • Multiboot2 compliant bootloader
  • Custom linker scripts in targets/ directory

Prerequisites

Development Tools

  • Docker (for containerized build environment)
  • QEMU (To test in Virtual Enviroments)

Help me brew some coffee! ☕️

If you enjoy this project and like what I'm doing here, consider buying me a coffee!

Buy Me A Coffee