aboutsummaryrefslogtreecommitdiff
path: root/loader_stage2.c
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-30 17:34:23 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-30 17:34:23 +0100
commitc9e045dc2170a99c9f32386e3e53aee9e01a8e7c (patch)
treefaa57aef89cd1a03efc665c1e5809cf4f0304269 /loader_stage2.c
parenteae54c24e2e2b89f399bc2d3be195468c2e462a5 (diff)
downloadrpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.tar.gz
rpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.zip
io api rework
Diffstat (limited to 'loader_stage2.c')
-rw-r--r--loader_stage2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/loader_stage2.c b/loader_stage2.c
index f49d94c..e05de51 100644
--- a/loader_stage2.c
+++ b/loader_stage2.c
@@ -1,6 +1,7 @@
#include <stddef.h>
#include <stdint.h>
#include <uart.h>
+#include <io.h>
#include <global.h>
void *const kernel_load_addr = ((void*) 0x8000);
@@ -17,10 +18,10 @@ void _stage2_main(uint32_t r0, uint32_t r1, uint32_t atags)
// get kernel size via uart (little endian)
uint32_t b0, b1, b2, b3;
- b0 = uart_getc();
- b1 = uart_getc();
- b2 = uart_getc();
- b3 = uart_getc();
+ b0 = getchar();
+ b1 = getchar();
+ b2 = getchar();
+ b3 = getchar();
uint32_t kernel_size = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
@@ -28,7 +29,7 @@ void _stage2_main(uint32_t r0, uint32_t r1, uint32_t atags)
char *dst = kernel_load_addr, *end = dst + kernel_size;
while (dst < end)
- *(dst++) = uart_getc();
+ *(dst++) = getchar();
// jump to kernel
((void(*)(uint32_t, uint32_t, uint32_t)) kernel_load_addr)