#include #include #include /** Helper routine to put characters into our uart device */ static int stdout_puts(char *s, int len, void *unused) { (void)unused; for (int i = 0; i < len; i++) uart_putc(s[i]); return len; } /** * Printf-like functionality for the kernel. * * %% - print '%', * %c - character, * %s - string, * %d, %u - decimal integer, * %x, %X - hex integer, */ int kprintf(const char *restrict fmt, ...) { va_list ap; va_start(ap, fmt); int ret = mini_vpprintf(stdout_puts, NULL, fmt, ap); va_end(ap); return ret; }