diff --git a/README.md b/README.md index a974b4b..cb47ca1 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ - `make` - `grub` - `mtools` -- `x86_64-elf-gcc` -- `x86_64-elf-ld` +- `gcc` +- `ld` ## Building diff --git a/makefile b/makefile index 2efd707..4bfb7b1 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,8 @@ -CC = i386-elf-gcc -LD = i386-elf-ld +CC = gcc +LD = ld -CFLAGS = -Werror -Wall -pedantic -std=c23 -ffreestanding -m32 +CFLAGS = -m32 -ffreestanding -fno-pie -fno-stack-protector -fno-builtin -Wall -Wextra -Werror -Wshadow -std=c23 +LDFLAGS = -m elf_i386 -Ttext 0x100000 -nostdlib all: .build/nub-os.iso @@ -18,7 +19,7 @@ build-dir: grub-mkrescue -o .build/nub-os.iso .build/iso/ .build/kernel: build-dir .build/boot.o .build/kernel.o .build/vga.o - $(LD) -Ttext 0x100000 -o .build/kernel .build/boot.o .build/kernel.o .build/vga.o + $(LD) $(LDFLAGS) -Ttext 0x100000 -o .build/kernel .build/boot.o .build/kernel.o .build/vga.o .build/kernel.o: build-dir src/kernel.c $(CC) $(CFLAGS) -c -o .build/kernel.o src/kernel.c diff --git a/src/vga.c b/src/vga.c index 48b9168..5329925 100644 --- a/src/vga.c +++ b/src/vga.c @@ -89,8 +89,8 @@ void vga_print_char(char character, vga_color_t color) for (uint8_t col = 0; col < COLUMNS; col++) { - vga_char character = { .character = ' ', .color = vga_default_color() }; - vga_set_char(ROWS - 1, col, character); + vga_char c = { .character = ' ', .color = vga_default_color() }; + vga_set_char(ROWS - 1, col, c); }; cursor_row = ROWS - 1;