summaryrefslogtreecommitdiff
path: root/kernel/terminal.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
committerBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
commit4130562b1555cabe441efe9420cebe12e7ed8d39 (patch)
treebeaf0012373aab2c3a13fe0147a5cda4af28ef78 /kernel/terminal.cpp
parent882e74b2191c059a9226cbd8bcb51c97da36247c (diff)
downloadhilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz
application loading
Diffstat (limited to 'kernel/terminal.cpp')
-rw-r--r--kernel/terminal.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/terminal.cpp b/kernel/terminal.cpp
index 59e1ee5..1074fe7 100644
--- a/kernel/terminal.cpp
+++ b/kernel/terminal.cpp
@@ -108,4 +108,14 @@ namespace mercury::kernel::terminal {
}
+ static char hex_digits[] = "0123456789abcdef";
+
+ void put_int_hex(uint64_t n, int digits, bool with_dots) {
+ for (int digit = digits - 1; digit >= 0; --digit) {
+ put_char(hex_digits[(n >> (digit * 4)) & 0xf]);
+ if (with_dots && digit % 4 == 0 && digit != 0)
+ put_char('.');
+ }
+ }
+
}