Compare commits
No commits in common. "e30cc4c3d06a69c402874a3c08a9cf22384bb132" and "f5a32db7a38115f56916cfb61ca19c0813d5c786" have entirely different histories.
e30cc4c3d0
...
f5a32db7a3
1 changed files with 6 additions and 13 deletions
|
|
@ -1,23 +1,16 @@
|
||||||
|
#include <uart.h>
|
||||||
#include <mini-printf.h>
|
#include <mini-printf.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <uart.h>
|
|
||||||
|
|
||||||
/** Helper routine to put characters into our uart device */
|
int stdout_puts(char *s, int len, void *unused) {
|
||||||
static int stdout_puts(char *s, int len, void *unused) {
|
|
||||||
(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;
|
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, ...) {
|
int kprintf(const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue