18 lines
446 B
C
18 lines
446 B
C
#include "uart.h"
|
|
#include "stdio.h"
|
|
#include "abi/syscalls.h"
|
|
|
|
extern void _start(void) {
|
|
uart_init(UART_COM1_PORT, 115200);
|
|
uart_puts(UART_COM1_PORT, "[RING3-UART-DRIVER] 16550 UART COM1 initialized from userspace!\n");
|
|
|
|
while (1) {
|
|
if (uart_has_data(UART_COM1_PORT)) {
|
|
char c = uart_getc(UART_COM1_PORT);
|
|
// Echo back
|
|
uart_putc(UART_COM1_PORT, c);
|
|
}
|
|
sys_yield();
|
|
}
|
|
}
|