Set development environment with UART debug output for aarch64

This commit is contained in:
2019-05-30 08:44:01 +02:00
parent 8718f035a5
commit 08ffb6ee94
8 changed files with 50 additions and 63 deletions
+2 -5
View File
@@ -25,13 +25,10 @@ k_main(void)
{
uart_init();
uart_putc('L');
uart_putc('o');
uart_putc('w');
uart_putc('e');
uart_putc('\n');
uart_puts((unsigned char *) "Lowe OS\n");
for (;;) {
__asm__("WFE");
}
}
-12
View File
@@ -1,12 +0,0 @@
ENTRY(_start)
SECTIONS
{
. = 0x40000000;
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
. = ALIGN(8);
. = . + 0x1000;
stack_ptr = . ;
}
+12 -4
View File
@@ -15,7 +15,7 @@
#include "uart.h"
unsigned int *uart_base = (unsigned int *)UART_BASE;
volatile unsigned int *UART0 = (unsigned int *)UART_BASE;
void
@@ -24,10 +24,18 @@ uart_init(void)
}
void
uart_putc(unsigned char c)
{
*uart_base = c;
if(c == '\n')
*uart_base = '\r';
*UART0 = (unsigned int) c;
}
void
uart_puts(const unsigned char *s)
{
while(*s) {
*UART0 = (unsigned int) *(s++);
}
}
+3
View File
@@ -22,9 +22,12 @@
void
uart_init(void);
void
uart_putc(unsigned char c);
void
uart_puts(const unsigned char *s);
#endif /* !UART_H */