Internal boot-loader documentation needed #10

kallisti5 opened this Issue Apr 22, 2012 · 9 comments

3 participants


Internal documentation on what the boot loader is looking for is needed to ensure other platform ports are possible.

Documentation items could include:

  • 32k binary blob addition to kernel image?
  • Elf load address expectations.
  • Detailed boot procedure diagram.
  • Things in general that would enable non-linux operating system ports (BSD, Haiku, etc)
  • Maybe a simple example "hello world" kernel with needed build information?
Raspberry Pi member

I'm pretty sure it's not a binary blob, just an under-documented addition. If you look at you'll see it's generated completely from boot-uncompressed.txt and args-uncompressed.txt. boot-uncompressed.txt looks like ARM instructions to me. arm-linux-gnueabi-objdump -m arm -b binary -D first32k.bin


We figured out the first32k.bin file...

Eben also confirmed to me via email that there is no way currently to enable debug output from the closed-source blobs over uart at this time..

Figuring out first32k.bin has lead us to realize that arm elf code should really just "work". We are trying to throw together a quick assembly program to toggle gpio 16 (status 'ok' led) to test this theory. (let me know though if you can whip up the code faster then me... my arm assembly isn't too strong)

Raspberry Pi member

@kallisti5 There's a student here at the lab who has something like that working. I'll drop you an email and introduce you.


@asb is what I had so far from my very sleepy attempt at it last night.

Definitely interested if you already have something.



I've done something fairly similar:

It doesn't do much except play with the GPIO. I've attached the work I've done thus far (I'm currently working on the framebuffer; attached is almost the most current version - I've fixed a few things in fb.c, the latest version gets stuck at reading from the mailbox (it's always empty)):
Edit to match your install (I haven't edited my PATH variable yet, ugly but meh)
Edit to match your system, or alternatively copy manually
./, or alternatively copy kernel.img into the SDcard's /boot
Boot the Raspberry Pi with LEDs connected to GPIOs 8, 9, 11, and 25, and GPIO 14 set to high.
Alternatively, edit the main.c to infinite loop after WriteGpio(15)

I tried setting GPIO16 to high, but that didn't light the OK LED for some reason (I would recheck but my machine is currently somewhat busy).

With respect to first32k.bin, what I've done breaks if you edit to not add first32k.bin to the start.



I sent you an email: :D

Using the awesome work you've done thus far, plus the Raspberry Pi Linux GPIO example... I've gotten the GPIO working pretty well. It will light the "OK" led or anything really.

Thanks for the hard work! You've given me the entrance I needed :)

-- Alex


Updated version that actually draws stuff on screen (there's a strange memory bug that's causing some data to be offset weirdly, so no Hello, world! just yet:p):


this can be resolved. there is assembly floating around showing that the jump into the kernel needs to be at 0x00008000.

This is what we used linked infront of our baremetal code:

.globl _start
b jmp_loader

.balign 0x8000, 0
/* Set up 1MB C Stack Space */
mov sp, #0x100000
mov r4, #0

/* Start Haiku loader */
b pi_start
@kallisti5 kallisti5 closed this May 11, 2012

Thanks for that! I believe what happens is the GPU writes some stuff somewhere greater than or equal to 0x0004 and less than 0x8000. Anyway... It works now:

p.s: Sorry it's taken me a while... I've had exams and other stuff to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment