From 878ca00f188a9929df6bd3d34224d654bbca092a Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 17 Sep 2023 23:16:50 -0500 Subject: [PATCH] Update --- GNUmakefile | 17 +++++++++++++++-- kernel/kernel.c | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index bfed9bf..8020942 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,9 +13,17 @@ define DEFAULT_VAR = endif endef -# Compiler for building the 'limine' executable for the host. +# Toolchain for building the 'limine' executable for the host. override DEFAULT_HOST_CC := cc $(eval $(call DEFAULT_VAR,HOST_CC,$(DEFAULT_HOST_CC))) +override DEFAULT_HOST_CFLAGS := -g -O2 -pipe +$(eval $(call DEFAULT_VAR,HOST_CFLAGS,$(DEFAULT_HOST_CFLAGS))) +override DEFAULT_HOST_CPPFLAGS := +$(eval $(call DEFAULT_VAR,HOST_CPPFLAGS,$(DEFAULT_HOST_CPPFLAGS))) +override DEFAULT_HOST_LDFLAGS := +$(eval $(call DEFAULT_VAR,HOST_LDFLAGS,$(DEFAULT_HOST_LDFLAGS))) +override DEFAULT_HOST_LIBS := +$(eval $(call DEFAULT_VAR,HOST_LIBS,$(DEFAULT_HOST_LIBS))) .PHONY: all all: $(IMAGE_NAME).iso @@ -45,7 +53,12 @@ ovmf: limine: git clone https://github.com/limine-bootloader/limine.git --branch=v5.x-branch-binary --depth=1 - unset CC; unset CFLAGS; unset CPPFLAGS; unset LDFLAGS; unset LIBS; $(MAKE) -C limine CC="$(HOST_CC)" + $(MAKE) -C limine \ + CC="$(HOST_CC)" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" \ + LIBS="$(HOST_LIBS)" .PHONY: kernel kernel: diff --git a/kernel/kernel.c b/kernel/kernel.c index 3ae1576..4d5fc7c 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -91,7 +91,7 @@ void _start(void) { // Note: we assume the framebuffer model is RGB with 32-bit pixels. for (size_t i = 0; i < 100; i++) { - uint32_t *fb_ptr = framebuffer->address; + volatile uint32_t *fb_ptr = framebuffer->address; fb_ptr[i * (framebuffer->pitch / 4) + i] = 0xffffff; }