mirror of
https://github.com/danog/baremetal.git
synced 2024-11-26 12:04:42 +01:00
Cleanup
This commit is contained in:
parent
59025d1c7d
commit
c097b01176
@ -16,5 +16,5 @@ _start:
|
||||
mov sp, #LOW_MEMORY // Initialize the kernel stack pointer to +4mb, growing downwards
|
||||
bl kernel_main // kernel_main()
|
||||
|
||||
halt:
|
||||
halt: // Doesn't actually shut down the other cores for now, just makes them spin endlessly
|
||||
b halt
|
@ -36,7 +36,8 @@ void kernel_main(void)
|
||||
delay(1000);
|
||||
uart_send_string("Hello, world!\r\n");
|
||||
|
||||
/*while (1) {
|
||||
while (1) {
|
||||
// Echo back chars, the way a normal console would.
|
||||
uart_send(uart_recv());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ void uart_init(void)
|
||||
|
||||
void uart_send(char c)
|
||||
{
|
||||
while(get32(UART_FR) & (1<<5));
|
||||
while (get32(UART_FR) & (1<<5));
|
||||
put32(UART_DR, c);
|
||||
}
|
||||
char uart_recv()
|
||||
{
|
||||
while(get32(UART_FR) & (1<<4));
|
||||
while (get32(UART_FR) & (1<<4));
|
||||
return put32(UART_DR) & 0xFF;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user