wires

summary refs log tree commit diff
path: root/src/startup.s
blob: e73f53cc842006a4b7a8659345011d71ef6316b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.section ".init"
.global _start

_start:
    mrs     x4, MPIDR_EL1
    and     x4, x1, 0b11

    cbz     x4, init
halt:
    wfe
    b       halt

init:
    adr     x4, __stack_base
    mov     sp, x4

    adr     x4, __bss_start
    adr     x5, __bss_size
    cbz     x5, exec_kernel

clear_bss:
    str     xzr, [x4], 8
    sub     x5, x5, 1
    cbnz    w5, clear_bss

exec_kernel:
    bl      main
    b       halt