From 7b9a5e0ef7fea0af8ea4bb6fe6bb6b237f8e426e Mon Sep 17 00:00:00 2001 From: 0x35c Date: Sat, 7 Sep 2024 12:11:38 +0200 Subject: [PATCH] fix: kprintf now works with multiple arguments --- .gitignore | 1 + Makefile | 2 +- src/kernel.c | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a799c93..aa51d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build obj +.* diff --git a/Makefile b/Makefile index 4989f01..f82adf2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ AS := i386-elf-as ASFLAGS := CC := i386-elf-gcc -CCFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -iquotelibbozo/headers +CCFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -iquotelibbozo/headers -g LD := $(CC) LDFLAGS := -T boot/linker.ld -ffreestanding -O2 -nostdlib LIBS := ./libbozo/build/libbozo.a -lgcc diff --git a/src/kernel.c b/src/kernel.c index 5e79702..338468e 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -1,5 +1,5 @@ -#include "terminal.h" #include "kprintf.h" +#include "terminal.h" #include #include @@ -16,10 +16,11 @@ #error "This tutorial needs to be compiled with a ix86-elf compiler" #endif -void kernel_main(void) { - /* Initialize terminal interface */ - terminal_initialize(); +void kernel_main(void) +{ + /* Initialize terminal interface */ + terminal_initialize(); - /* Newline support is left as an exercise. */ - kprintf(0, "Hello world!"); + /* Newline support is left as an exercise. */ + kprintf(0, "test %d a %d b %d\n", 10, 2, 3); }