diff options
author | vetch <vetch97@gmail.com> | 2020-01-02 17:54:31 +0100 |
---|---|---|
committer | vetch <vetch97@gmail.com> | 2020-01-02 17:54:31 +0100 |
commit | ab7b754bb32022336527c1a2d5d710b95a589d0e (patch) | |
tree | 19f508f06c72efcbdd2cfad46949ed6f1ae45a3c /loader_stage1.c | |
parent | 5e1e6796109c892c4300c3da17c35e7874a40107 (diff) | |
parent | 6bf5a3b8c6e8a5d1cb3fb4880a5d9688ab094c62 (diff) | |
download | rpi-MMU-example-ab7b754bb32022336527c1a2d5d710b95a589d0e.tar.gz rpi-MMU-example-ab7b754bb32022336527c1a2d5d710b95a589d0e.zip |
Merge branch 'bob' of https://repo.or.cz/RPi-MMU-example into alice
# Conflicts:
# .gitignore
# PL0_test.ld
# demo_functionality.c
# interrupt_vector.S
# interrupts.c
# kernel.c
# memory.h
Diffstat (limited to 'loader_stage1.c')
-rw-r--r-- | loader_stage1.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/loader_stage1.c b/loader_stage1.c deleted file mode 100644 index d209c15..0000000 --- a/loader_stage1.c +++ /dev/null @@ -1,25 +0,0 @@ -#include <stddef.h> -#include <stdint.h> -#include <global.h> - -char *const stage2_addr = ((void*) 0x4000); - -// there's one tricky thing about embedding file in executable; -// mainly, symbols are visible to c code as extern chars, but the actual -// values are their adresses... see the code below -extern char - _binary_loader_stage2_img_start, - _binary_loader_stage2_img_end, - _binary_loader_stage2_img_size; - -void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) -{ - // stage2 of the bootloader is a blob embedded in executable; - // copy it over to it's destination place - // TODO implement a memcpy() somewhere and use it instead of loops - for (size_t i = 0; i < (size_t) &_binary_loader_stage2_img_size; i++) - stage2_addr[i] = (&_binary_loader_stage2_img_start)[i]; - - // jump to stage2 - ((void(*)(uint32_t, uint32_t, uint32_t))stage2_addr)(r0, r1, atags); -} |