Compare commits

..

No commits in common. "e30cc4c3d06a69c402874a3c08a9cf22384bb132" and "f5a32db7a38115f56916cfb61ca19c0813d5c786" have entirely different histories.

View file

@ -1,23 +1,16 @@
#include <uart.h>
#include <mini-printf.h>
#include <stddef.h>
#include <uart.h>
/** Helper routine to put characters into our uart device */
static int stdout_puts(char *s, int len, void *unused) {
int stdout_puts(char *s, int len, void *unused) {
(void)unused;
for (int i = 0; i < len; i++) uart_putc(s[i]);
// Example: UART write loop
for (int i = 0; i < len; i++) {
uart_putc(s[i]); // <-- your low-level "put char" routine
}
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);