blob: 753f4a5f8cdcde23e9ac5a0f76c79d9e3bd26690 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#define UART_BASE 0x10000000 // Example UART address
static inline void putchar(char c) {
volatile char *uart = (volatile char *)UART_BASE;
*uart = c;
}
static void print_string(const char *str) {
while (*str) {
putchar(*str++);
}
}
void kernel_main(void) {
print_string("Hello from RISC-V kernel!\n");
while (1) {
// Wait
}
}
|