Some notes on PI development
Posted: Sat Feb 09, 2019 9:32 pm
Hello everyone! This is my first post on the forum, but I've been using the Pi development page for a while, and it's helped me a lot. Since then I've made a good amount of progress, and I wanted to share what I've found:
- I don't know if it's a Cygwin thing, but my gcc setup doesn't seem to like "org" without a "." before it.
- I think Qemu fixed the binary loading issue. The latest version loads the binary at 0x8000.
- Using Qemu's "raspi2" (and, I'm guessing, using an actual PI 2) gives you a 32-bit ARM with 4 cores, even if you override the cpu setting (and it rejects any number of cores below 4). There isn't any code for shutting off the extra cores, and letting them run can crash or mess up the kernel, so I rewrote the ARM64 cores code to work with raspi2's cortex-A7 (and also my 4-core arm1176 setup):
This goes right after "_start:" in the ARM32 code and replaces the "mov sp, #0x8000" line.
Code: Select all
mrc p15, 0, r5, c0, c0, 5 and r5, r5, #3 cmp r5, #0 bne halt ldr r5, =_start mov sp, r5