From 4761724dcade44a1fdbf8030b0a6896e90d7cde2 Mon Sep 17 00:00:00 2001 From: catfood Date: Wed, 22 Nov 2023 22:07:31 +0800 Subject: [PATCH] enable uart output --- Makefile | 3 +++ include/proto.h | 1 + 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 1a64f96..b89027e 100644 --- a/Makefile +++ b/Makefile @@ -145,11 +145,13 @@ run: $(IMAGE) @qemu-system-i386 \ -boot order=a \ -drive file=$<,format=raw \ + -serial stdio \ gdb: $(IMAGE) @qemu-system-i386 \ -boot order=a \ -drive file=$<,format=raw \ + -serial stdio \ -s -S \ gdb-no-graphic: $(IMAGE) @@ -157,6 +159,7 @@ gdb-no-graphic: $(IMAGE) -nographic \ -boot order=a \ -drive file=$<,format=raw \ + -serial stdio \ -s -S \ # 调试的内核代码elf diff --git a/include/proto.h b/include/proto.h index 6d03253..0295714 100644 --- a/include/proto.h +++ b/include/proto.h @@ -12,6 +12,7 @@ int vga_get_disppos(); void vga_write_char(const char ch, u8 color); void vga_write_str(const char * str); void vga_write_str_color(const char * str, u8 color); +int uart_kprintf(const char *fmt, ...); //added by zcr void disable_irq(int irq);