Now, knowing that the Baking Pi tutorials are were created for an older model of the RPi, I searched a little bit online beforehand, and found the new correct address for the GPIO controller was 0x3F000000. I wrote the code for the OK (ACT?) LED blink, and everything compiled just fine on my Linux laptop.
The real problem came when I had to load this onto my RPi, as the tutorial was not very clear on this. First I thought I'd be fine just copying the kernel.img on. Obviously this did not work, so I did more research and found out that I needed some extra files. I formatted my microSD card to FAT, downloaded the RPi firmware off of github, and copied the boot folder onto the SD card, replacing both kernel.img and kernel7.img with my own compiled kernel.img.
Now, all the research i've done seems to indicate that this should work, but it just doesn't. The red PWR light comes on, I get some halfhearted blinking from the ACT LED, and... nothing.
So my question is: How do I properly use and boot the kernel image I've compiled given a blank FAT32 SD card? I'm seriously at my wits end - I really want to move on with this and I have no idea what to do!
Here's my ASM code:
Code: Select all
.section .init .globl _start _start: ldr r0,=0x3F000000 mov r1,#1 lsl r1,#18 str r1,[r0,#4] mov r1,#1 lsl r1,#16 loop$: str r1,[r0,#40] mov r2,#0x3F0000 wait1$: sub r2,#1 cmp r2,#0 bne wait1$ str r1,[r0,#28] mov r2,#0x3F0000 wait2$: sub r2,#1 cmp r2,#0 bne wait2$ b loop$