diff options
author | Bad Diode <bd@badd10de.dev> | 2021-09-07 10:48:33 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-09-07 10:48:33 +0200 |
commit | 4b86e6272166236c9283004f6a060d5174165796 (patch) | |
tree | 67521dabe329b256c27761fa2a93a837b8e3fec4 /src | |
download | uxnrpi-4b86e6272166236c9283004f6a060d5174165796.tar.gz uxnrpi-4b86e6272166236c9283004f6a060d5174165796.zip |
Initial commit: bootstrap
Diffstat (limited to 'src')
-rw-r--r-- | src/linker.ld | 34 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/start.s | 11 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/linker.ld b/src/linker.ld new file mode 100644 index 0000000..f3482e9 --- /dev/null +++ b/src/linker.ld | |||
@@ -0,0 +1,34 @@ | |||
1 | ENTRY(_start) | ||
2 | |||
3 | SECTIONS | ||
4 | { | ||
5 | . = 0x8000; | ||
6 | __start = .; | ||
7 | .text : | ||
8 | { | ||
9 | KEEP(*(.text.boot)) | ||
10 | *(.text) | ||
11 | } | ||
12 | . = ALIGN(4096); | ||
13 | .rodata : | ||
14 | { | ||
15 | *(.rodata) | ||
16 | } | ||
17 | . = ALIGN(4096); | ||
18 | .data : | ||
19 | { | ||
20 | *(.data) | ||
21 | } | ||
22 | . = ALIGN(4096); | ||
23 | __bss_start = .; | ||
24 | .bss : | ||
25 | { | ||
26 | bss = .; | ||
27 | *(.bss) | ||
28 | } | ||
29 | . = ALIGN(4096); | ||
30 | __bss_end = .; | ||
31 | __bss_size = __bss_end - __bss_start; | ||
32 | __end = .; | ||
33 | } | ||
34 | |||
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..1ce2dd1 --- /dev/null +++ b/src/main.c | |||
@@ -0,0 +1,3 @@ | |||
1 | void main(void) { | ||
2 | while(1); | ||
3 | } | ||
diff --git a/src/start.s b/src/start.s new file mode 100644 index 0000000..0fd2a5f --- /dev/null +++ b/src/start.s | |||
@@ -0,0 +1,11 @@ | |||
1 | .section ".text.boot" | ||
2 | |||
3 | .global _start | ||
4 | |||
5 | _start: | ||
6 | ldr r3, =main | ||
7 | blx r3 | ||
8 | |||
9 | halt: | ||
10 | wfe | ||
11 | b halt | ||