diff --git a/examples/kernel-grub-multiboot2/Makefile b/examples/kernel-grub-multiboot2/Makefile index f253800..1d3aee9 100644 --- a/examples/kernel-grub-multiboot2/Makefile +++ b/examples/kernel-grub-multiboot2/Makefile @@ -1,3 +1,5 @@ +all: run + CCPREFIX = i386-elftailix- AS = $(CCPREFIX)as @@ -23,14 +25,9 @@ CFLAGS = \ OBJS = main.c.o start.S.o -all: run0 - -run0: $(IMAGE) +run: $(IMAGE) qemu-system-i386 -cdrom $< -serial stdio -display none -run1: $(IMAGE) - qemu-system-i386 -cdrom $< -serial stdio - clean: rm -f $(IMAGE) $(KERNEL) $(OBJS) diff --git a/examples/kernel-grub-multiboot2/main.c b/examples/kernel-grub-multiboot2/main.c index fc19b45..db7429a 100644 --- a/examples/kernel-grub-multiboot2/main.c +++ b/examples/kernel-grub-multiboot2/main.c @@ -4,12 +4,10 @@ #include #include #include -#include void halt(); static void panic(const char *str); -static void printf(const char *format, ...); void main( const uint32_t multiboot2_magic, @@ -23,7 +21,7 @@ void main( panic("Multiboot 2 info is invalid"); } - KernAux_Multiboot2_print(multiboot2_info, printf); + KernAux_Multiboot2_print(multiboot2_info, kernaux_console_printf); } void halt() @@ -33,15 +31,6 @@ void halt() void panic(const char *const str) { - printf("panic: %s\n", str); + kernaux_console_printf("panic: %s\n", str); kernaux_asm_i386_hang(); } - -void printf(const char *const format, ...) -{ - va_list va; - - va_start(va, format); - kernaux_printf_va(kernaux_console_putc, format, va); - va_end(va); -}