diff --git a/Makefile b/Makefile index 390f4fc..579742e 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,15 @@ AS = nasm CFLAGS = -std=c17 -ffreestanding -fno-builtin -fno-stack-protector -fno-pie \ -Os -nostdinc -mgeneral-regs-only -m32 -march=i386 -Wall -Iinclude/c LDFLAGS = -z notext -melf_i386 +ASFLAGS = SRC = ./src BIN = ./bin C_FILES = calc edit FONTS = testfont term16n +include make.config + .PHONY: os clean run # Main compilation target @@ -27,9 +30,9 @@ $(BIN): # Bootloader: This target is responsible for creating stage?.bin (1,2,3) bootloader: $(SRC)/stage1.asm $(SRC)/stage2.asm @echo "Assembling $(SRC)/stage1.asm..." - @$(AS) -fbin -o $(BIN)/stage1.bin $(SRC)/stage1.asm + @$(AS) $(ASFLAGS) -fbin -o $(BIN)/stage1.bin $(SRC)/stage1.asm @echo "Assembling $(SRC)/stage2.asm..." - @$(AS) -fbin -o $(BIN)/stage2.bin $(SRC)/stage2.asm + @$(AS) $(ASFLAGS) -fbin -o $(BIN)/stage2.bin $(SRC)/stage2.asm @echo "Compiling $(SRC)/stage3.c..." @$(CC) $(CFLAGS) -Iinclude -o $(BIN)/stage3.o -c $(SRC)/stage3.c @$(LD) $(LDFLAGS) -T$(SRC)/stage3.ld --oformat binary -o $(BIN)/stage3.bin $(BIN)/stage3.o diff --git a/kern.iso b/kern.iso index 4683e04..47e0c87 100644 Binary files a/kern.iso and b/kern.iso differ diff --git a/make.config b/make.config new file mode 100644 index 0000000..7a33ee7 --- /dev/null +++ b/make.config @@ -0,0 +1,2 @@ +# Use a default resolution of 1920x1080 32bpp +# ASFLAGS := $(ASFLAGS) -DDEF_RES diff --git a/src/stage2.asm b/src/stage2.asm index 660e5b6..03706f4 100644 --- a/src/stage2.asm +++ b/src/stage2.asm @@ -369,9 +369,11 @@ DATA_SEG equ GDT.dataDescriptor - GDT.start ;; VBE Stuff ;; XXX IF YOU WANT TO SELECT ANY VALUE IN THE SETUP, SET THESE TO ZERO XXX -width: dw 0 -height: dw 0 -bpp: db 0 +%ifdef DEF_RES +width: dw 1920 +%endif +height: dw 1080 +bpp: db 32 offset: dw 0 _segment: dw 0 ; segment is a keyword