I'm completly new to arm and just recently got my RPi so please excuse my ignorance and feel free to throw any urls at me to read.
What I'm wondering is what environment is defined when you turn on the RPi and your bare metal kernel gets control.
So far I know the following (correct me if I get anything wrong):
- On power on the GPU has control and does some magic stuff and evntually loads the kernel.bin from the SD card to 0x8000 and starts the ARM cpu there (r15 = 0x8000).
- the lower 1GB address space repeats itself 4 times with different cache attirbutes, no page tables are present
- supervisor mode (svc) is enabled
- interrupts are disabled
- The stack pointer (SP) is not initialized
- 0x4000-0x8000 is free for use (e.g. as small stack)
- UART1 is configured to 115200 8N1 (but one should initialize it again before use to be sure)
I've read quite a bit about ATAGs and how they give the amount of memory the system has and the video mode and such. But no mention of where to find them on the RPi. I've read that r0, r1, r2 would contain something but no explanation what that would be. I'm guessing that would have something to do with the ATAGs. Unfortunately the example code I'm playing with use (and therefore overwrites) those registers so I can't print them to the UART for inspection later on.
How about the video output? Will the GPU have activate and configured that already at that point? Do I just need to find the ATAG, look for the ATAG_VIDEOLFB and have all the settings there? Or do I need to mess around with the mailboxes first to get the GPU to initialize video output?
Anything else noteworthy? Any "Introduction to Baremetal" post I forgot to read?