mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
Kernel: Zero out .bss contents on aarch64
After building and running objcopy -O binary Build/aarch64/Kernel/Prekernel/Prekernel \ /media/sdcard/kernel8.img things start booting on an actual RPi4 :^) (Assuming the sdcard contains RPi firmware, an empty config.txt, and no other kernel*.img files).
This commit is contained in:
parent
715f9666f2
commit
d0c1db5efc
2 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,14 @@ start:
|
|||
ldr x14, =start
|
||||
mov sp, x14
|
||||
|
||||
// Clear BSS.
|
||||
ldr x14, =start_of_bss
|
||||
ldr x15, =size_of_bss_divided_by_8
|
||||
Lbss_clear_loop:
|
||||
str xzr, [x14], #8
|
||||
subs x15, x15, #1
|
||||
bne Lbss_clear_loop
|
||||
|
||||
b init
|
||||
|
||||
.globl wait_cycles
|
||||
|
|
|
@ -29,6 +29,10 @@ SECTIONS
|
|||
|
||||
.bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss))
|
||||
{
|
||||
start_of_bss = .;
|
||||
*(.bss)
|
||||
end_of_bss = .;
|
||||
} :bss
|
||||
}
|
||||
|
||||
size_of_bss_divided_by_8 = (end_of_bss - start_of_bss) / 8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue