Untitled_Bootloader/Makefile
lordtet 7266661097 Boilerplate + Protected mode
Added make debug to Makefile
Added the gdb script from the kernel for easy debugging
now makes it to protected mode and shows a green box when done
Added a gdt (of course)
2025-07-30 17:17:12 -04:00

27 lines
530 B
Makefile

# Makefile
SRC_DIR = src
BUILD_DIR = build
BOOTLOADER_SRC = $(SRC_DIR)/boot.s
BOOTLOADER_IMG = $(BUILD_DIR)/boot.img
QEMU = qemu-system-i386
all: $(BOOTLOADER_IMG)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BOOTLOADER_IMG): $(BOOTLOADER_SRC) | $(BUILD_DIR)
nasm -f bin $(BOOTLOADER_SRC) -i $(SRC_DIR) -o $(BOOTLOADER_IMG)
.PHONY: debug
debug:
$(QEMU) $(QEMU_FLAGS) -s -S -drive format=raw,file=$(BOOTLOADER_IMG)
.PHONY: run
run: all
$(QEMU) -drive format=raw,file=$(BOOTLOADER_IMG) -display gtk
clean:
rm -rf $(BUILD_DIR)