diff options
author | Benji Dial <Benji3.141@gmail.com> | 2019-12-27 11:10:56 -0500 |
---|---|---|
committer | Benji Dial <Benji3.141@gmail.com> | 2019-12-27 11:10:56 -0500 |
commit | 3f3f9a806dc63ad827fe28724dabe694f6e67f1e (patch) | |
tree | 441ff1f1617086e200af097575889735dc08b0ad /src/kernel/vga.c | |
parent | 1f309e75b808f7f9576a3f60dbbe925d1e43a714 (diff) | |
download | portland-os-3f3f9a806dc63ad827fe28724dabe694f6e67f1e.tar.gz |
apm and smbios stubs, get_char can now wait for printable
Diffstat (limited to 'src/kernel/vga.c')
-rw-r--r-- | src/kernel/vga.c | 14 |
1 files changed, 14 insertions, 0 deletions
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; |