[feat] Memory manager

This commit is contained in:
2026-05-24 19:36:50 +08:00
Unverified
parent 690782eae9
commit 4fc02d296f
9 changed files with 593 additions and 20 deletions
+12
View File
@@ -35,6 +35,18 @@ void serial_write(const char *str) {
}
}
void serial_write_hex(UINTN val) {
char buf[19];
buf[0] = '0'; buf[1] = 'x';
for (int i = 17; i >= 2; i--) {
UINTN digit = val & 0xF;
buf[i] = digit < 10 ? '0' + digit : 'A' + digit - 10;
val >>= 4;
}
buf[18] = '\0';
serial_write(buf);
}
char serial_read_char() {
// 后面可能用的上,比如远程调试?
if (!g_serial.SerialIo) return 0;