From 3f3f9a806dc63ad827fe28724dabe694f6e67f1e Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Fri, 27 Dec 2019 11:10:56 -0500 Subject: apm and smbios stubs, get_char can now wait for printable --- src/kernel/vga.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/kernel/vga.c') diff --git a/src/kernel/vga.c b/src/kernel/vga.c index cf95bc2..f83a2cf 100644 --- a/src/kernel/vga.c +++ b/src/kernel/vga.c @@ -109,6 +109,20 @@ void put_32_dec(uint32_t n) { put_char('0'); } +void put_16_dec(uint16_t n) { + if (n) { + bool sig = false; + for (uint16_t m = 10000; m; m /= 10) { + if (((n / m) % 10) || sig) { + sig = true; + put_char((uint8_t)'0' + (n / m) % 10); + } + } + } + else + put_char('0'); +} + void put_8_dec(uint8_t n) { if (n) { bool sig = false; -- cgit v1.2.3