9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b2bac4db48177849d0e60e4201d7fa4c3f536a0a
parent 9bae75d2f7e86454b549bed34f2fefd59fba0911
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun,  4 Oct 2020 01:38:55 +0200

os9/arm64: Improve early console

The previous code was too clumsy.

Change-Id: I0902657c4450f97bb0166bb3463881227b2bc02e

Diffstat:
Msrc/os9/arch/arm64/fvp.c | 19++++++++++---------
Msrc/os9/arch/arm64/main.c | 2++
2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/os9/arch/arm64/fvp.c b/src/os9/arch/arm64/fvp.c @@ -2,6 +2,8 @@ #include "arch.h" +static uint32_t *early = (uint32_t *) 0x1C090000; + Mach mach = { .phystack = 0x80080000, .phytext = 0x80000000, @@ -16,12 +18,10 @@ getch(void) { char ch; - if (console) { - devread(console, &ch, 1); - return ch; - } else { - return *(char *) 0x1C090000; - } + if (!console) + panic("getch out of sync"); + devread(console, &ch, 1); + return ch; } void @@ -33,12 +33,13 @@ putch(int c) ch = c; devwrite(console, &ch, 1); } else { - while (inm32((void *) 0x1C090000 + 6*4) & 1<<5) + while (inm32(early+ 6) & 1<<5) ; - outm32(c, (void *) 0x1C090000); + outm32(c, early); if (c == '\n') putch('\r'); } - barrier(ISB); + barrier(DSB_SY); + barrier(ISB); } diff --git a/src/os9/arch/arm64/main.c b/src/os9/arch/arm64/main.c @@ -84,6 +84,8 @@ icons(Mach *m) void main(Mach *m) { + kprint("Booting os9\n"); + iarch(m); icache(m); imach(m);