Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
iso/boot/kernel.bin
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Compiler configuration
ASM = nasm -f elf32
GCC = gcc -m32 -ffreestanding -fno-stack-protector -fno-pie -Wall -Wextra -nostdlib -Iinclude -c
LD = ld -m elf_i386 -T linker.ld -o iso/boot/kernel.bin

# Kernel configuration
KERNEL_NAME = x32_KERNEL

# Main Logic
# DISCLAIMER:
# Do not touch this unless you REALLY know what you are doing
# Only touch this when fixing a bug or adding a feature/folder/file(we should get dynamic file handling)

# Also someone PLEASE add dynamic file handling... - HashedVsy 19:56 17.02.2026
# American format:
# HashedVsy 7:56PM 02.17.2026
all:
$(ASM) src/asm/multiboot.asm -o build/multiboot.o
$(ASM) src/asm/boot.asm -o build/boot.o
Expand All @@ -16,4 +28,4 @@ all:
build/panic.o \
build/kernel.o

grub-mkrescue -o os.iso iso
grub-mkrescue -o $(KERNEL_NAME).iso iso
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ I strongly recommend reading the Multiboot2 spec to understand what you are doin

###### https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html

Also, read the OSDev wiki for a better learning experience.
###### https://wiki.osdev.org/


### FILES
multiboot.asm
> - Multiboot2 compliant header, 8 byte aligned, contains:
> - Magic Number
Expand Down Expand Up @@ -36,11 +41,27 @@ linker.ld
Makefile
> - Convenience script. I strongly recommend you use Makefile / CMake during your development process of this OS or any of your projects

Required tools:
> - make
> - gcc
> - ld (comes with gcc)
> - nasm
> - grub
### Setup Docker
1. Install Docker
2. Run the following command if you havent built the image(besure Docker engine is on or else itll error!)
``
docker build dockerenv -t kernel-buildenv
``
3. Enter build environment:

- Linux or MacOS: `docker run --rm -it -v "$(pwd)":/root/env kernel-buildenv`
- Windows (CMD): `docker run --rm -it -v "%cd%":/root/env kernel-buildenv`
- Windows (PowerShell): `docker run --rm -it -v "${pwd}:/root/env" kernel-buildenv`
- Please use the linux command if you are using WSL, msys2 or git bash
-> NOTE: If you are having trouble with an unshared drive, ensure your docker daemon -> has access to the drive you're development environment is in. For Docker Desktop, -> this is in "Settings > Shared Drives" or "Settings > Resources > File Sharing".


### Required tools
> - make - use Makefile to automatically run compile commands (not needed, but HEAVILY recommended for organizing.)
> - gcc - compile .c files
> - ld (comes with gcc) - link files to make them work
> - nasm - Make .asm files into .o
> - grub - Make ISO
> - docker(not needed, but HEAVILY recommended for organizing.)

I recommend you have an emulator like qemu and run this with qemu-system-i386
Binary file modified build/initalltags.o
Binary file not shown.
Binary file modified build/kernel.o
Binary file not shown.
Binary file modified build/panic.o
Binary file not shown.
10 changes: 10 additions & 0 deletions dockerenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM debian:12

# Setup enviroment
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y gcc make nasm xorriso grub-pc-bin grub-common && \
rm -rf /var/lib/apt/lists/*

VOLUME /root/env
WORKDIR /root/env
Binary file modified iso/boot/kernel.bin
Binary file not shown.
Binary file added x32_KERNEL.iso
Binary file not shown.