+}
+
+void
+kprint_dbg(const char* fmt, ...)
+{
+ char buf[MAX_KPRINTF_BUF_SIZE];
+ va_list args;
+ va_start(args, fmt);
+
+ tty_set_theme(VGA_COLOR_WHITE, VGA_COLOR_MAGENTA);
+ tty_clear_line(24);
+
+ __ksprintf_internal(buf, fmt, MAX_KPRINTF_BUF_SIZE, args);
+ tty_put_str_at(buf, 0, 24);
+
+ va_end(args);
+
+ tty_set_theme(VGA_COLOR_WHITE, VGA_COLOR_BLACK);
+}
+
+void
+kprint_hex(const void* buffer, unsigned int size)
+{
+ unsigned char* data = (unsigned char*)buffer;
+ char buf[16];
+ char ch_cache[16];
+ unsigned int ptr = 0;
+ int i;
+
+ ch_cache[0] = '|';
+ ch_cache[1] = ' ';
+ while (size) {
+ ksnprintf(buf, 64, " %.4p: ", ptr);
+ console_write_str(buf);
+ for (i = 0; i < 8 && size; i++, size--, ptr++) {
+ unsigned char c = *(data + ptr) & 0xff;
+ ch_cache[2 + i] = (32 <= c && c < 127) ? c : '.';
+ ksnprintf(buf, 64, "%.2x ", c);
+ console_write_str(buf);
+ }
+ ch_cache[2 + i] = '\0';
+ console_write_str(ch_cache);
+ console_write_char('\n');
+ }
+}
+
+__DEFINE_LXSYSCALL3(void, syslog, int, level, const char*, fmt, va_list, args)
+{
+ __kprintf_internal("syslog", level, fmt, args);