Brew Kernel is a simple x86_64 kernel that demonstrates basic OS concepts. It features a custom bootloader, VGA text mode output with customizable colors, and basic interrupt handling.
Note: This screenshot may be outdated.
- 64-bit long mode support
- Multiboot2 compliant
- Custom VGA text mode driver with 16-color palette support
- Basic Interrupt Descriptor Table (IDT) implementation
- ASCII character display demo
- Integer output support with signed and unsigned number handling
- Ability to run on actual x86_64 hardware
To build the kernel, you'll need Docker installed on your system. The build environment is containerized to ensure consistency across different systems.
- First, build the Docker container for the build environment:
cd BrewKernel
docker build buildenv -t brewkernel
- Run the build script:
docker run --rm -it -v "$(pwd)":/root/env -w /root/env --platform linux/amd64 brewkernel make build-x86_64
The build process will create:
- A kernel binary at
dist/x86_64/kernel.bin
- A bootable ISO image at
dist/x86_64/kernel.iso
You can run the kernel using QEMU:
qemu-system-x86_64 -cdrom dist/x86_64/kernel.iso
Or run Brew on actual hardware.
note: This is not recommended, i am not liable if this software breaks your system, this is completely at YOUR OWN RISK. This software comes with ZERO warranty.
-
Step 1: Install BalenaEtcher on your device
From own testing this should work, if you would like to use DD, then do so. At again, your own risk. -
Step 2: Open BalenaEtcher and choose the kernel.iso, an external USB drive and flash it, this should take a second, if not less.
-
Step 3: Find a compatible x86_64 system.
Tested Hardware: HP EliteDesk 705 G4 DM 65W SBKPF CPU: AMD Ryzen 5 PRO 2400G (8) @ 3.600GHz GPU: AMD ATI Radeon Vega Series (VGA ONLY.)
-
Step 4: Enable legacy boot in your BIOS
-
Step 5: Insert the flashed USB Drive and boot using the legacy boot option NOT UEFI.
Important Notice: You can only get a display output by using a VGA port for display output, anything other than VGA is NOT supported. -
Step 6: Enjoy the Brew Kernel!
src/impl/kernel/
- Main kernel implementationsrc/impl/x86_64/
- Architecture-specific codesrc/intf/
- Header files and interfacestargets/
- Target-specific files (linker scripts, GRUB config)buildenv/
- Docker build environmentdist/
- Build output directory
- Kernel is loaded at 1MB (0x100000)
- Stack is 16KB
- Page tables are set up for identity mapping
- Resolution: 80x25 characters
- 16-color palette support
- Memory mapped at 0xB8000
- Signed integer printing with negative number handling
- Unsigned integer printing for positive numbers only
- Base-10 (decimal) output format
- Automatic buffer management for any integer size
- Numbers automatically wrapped at screen boundaries
Basic IDT setup with handlers for:
- Division by Zero (Vector 0)
- Debug Exception (Vector 1)
- Page Fault (Vector 14)
If you enjoy this project, and like what i'm doing here, consider buying me a coffee!
Copyright (C) 2024-2025 boreddevhq
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.