aboutsummaryrefslogtreecommitdiff
path: root/loader_stage2.c
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2020-01-04 19:37:32 +0100
committervetch <vetch97@gmail.com>2020-01-04 19:37:32 +0100
commit615e3302c9dd358bb64cd56d1f3814ad8d5df84d (patch)
tree07b0469807eb3bff7ff7d3f3576858642bc66675 /loader_stage2.c
parent885a097da42317f48cead2d91c0e0240066943a8 (diff)
downloadrpi-MMU-example-615e3302c9dd358bb64cd56d1f3814ad8d5df84d.tar.gz
rpi-MMU-example-615e3302c9dd358bb64cd56d1f3814ad8d5df84d.zip
rearranged files, updated makefile
Diffstat (limited to 'loader_stage2.c')
-rw-r--r--loader_stage2.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/loader_stage2.c b/loader_stage2.c
deleted file mode 100644
index 15d2003..0000000
--- a/loader_stage2.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stddef.h>
-#include <stdint.h>
-#include <uart.h>
-#include <io.h>
-#include <global.h>
-
-void *const kernel_load_addr = ((void*) 0x8000);
-
-void _stage2_main(uint32_t r0, uint32_t r1, uint32_t atags)
-{
- uart_init();
-
- // get kernel size via uart (little endian)
- uint32_t b0, b1, b2, b3;
-
- b0 = getchar();
- b1 = getchar();
- b2 = getchar();
- b3 = getchar();
-
- uint32_t kernel_size = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
-
- // load kernel at kernel_load_addr
- char *dst = kernel_load_addr, *end = dst + kernel_size;
-
- while (dst < end)
- *(dst++) = getchar();
-
- // jump to kernel
- ((void(*)(uint32_t, uint32_t, uint32_t)) kernel_load_addr)
- (r0, r1, atags);
-}
-