diff options
| author | wires <wires@noreply.wires.systems> | 2025-03-19 17:09:41 -0400 |
|---|---|---|
| committer | wires <wires@noreply.wires.systems> | 2025-03-19 17:09:41 -0400 |
| commit | 8466e9b4d2fbca85d53d8dadc87914b4766c43de (patch) | |
| tree | 99a0d7a23e805f4ad3e30814ee9a09ebb00ae08b /src/startup.s | |
| download | zosimos-8466e9b4d2fbca85d53d8dadc87914b4766c43de.tar.gz | |
initial commit
Diffstat (limited to 'src/startup.s')
| -rw-r--r-- | src/startup.s | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/startup.s b/src/startup.s new file mode 100644 index 0000000..e0c6385 --- /dev/null +++ b/src/startup.s @@ -0,0 +1,28 @@ +.section ".init" +.global _start + +_start: + mrs x1, MPIDR_EL1 + and x1, x1, 0b11 + + cbz x1, init +halt: + wfe + b halt + +init: + adr x1, __stack_base + mov sp, x1 + + adr x1, __bss_start + adr x2, __bss_size + cbz x2, exec_kernel + +clear_bss: + str xzr, [x1], 8 + sub x2, x2, 1 + cbnz w2, clear_bss + +exec_kernel: + bl main + b halt |