2

I seek to use the Pi as an educational tool to learn about programming a machine from the ground-up. In a perfect scenario, the first instruction executed after the firmware on ROM, and everything thereafter, should be something I write.

Unfortunately, as far as I'm aware, there is no way around this for the Pi. Broadcom stuck basically all the cool stuff into their closed-source GPU blob which we are forced to load.

With this in mind, is there any way to actually do what the Pi was meant to do? I.e. learn about how all this stuff works?

For example, drawing to a screen. From what I've found, the lowest-level available solution on the Pi is to request a frame buffer from VideoCore using the mailbox system, then write into that buffer, and the GPU checks that buffer and magically outputs to the screen. But how does the contents of the buffer actually get written to the screen? It's still just as much as a mystery as using something like Win32 to blit a buffer to the screen.

  • 1
    Keeping in mind that the "pi" in Raspberry Pi is, according to its creators, for python, a high level interpreted language, you may have misinterpreted what they intended it for learning. So sure, you can do bare metal programming for it, in the same sense you could probably do so for your desktop, etc, where the firmware bios is still required, and displays have some fairly complex hardware and firmware between them and the CPU. One thing that might make the pi useful, if you are interested in how displays work, would be the GPIO pins, which you could connect to an mc connected – goldilocks Dec 20 '15 at 19:13
  • ..to an led screen, etc. – goldilocks Dec 20 '15 at 19:14
  • I don't think it's very educational, just calling into a black-box blob and thinking we know what's going on. – zach Dec 20 '15 at 19:41
  • 1
    There's a black box at some point no matter what. The processor instruction set is an abstraction. I can't control individual transistors in the CPU that way! I can't tell whats really going on! I'm not defending BCM or anyone else, just pointing out it is what it is. If it isn't for you, look around for something that better meets your needs. Please note this is not a discussion forum, it's a Q&A only site. – goldilocks Dec 20 '15 at 19:47
  • 2
    There is a whole forum with over 850 distinct topics available on the subject of bare metal programming on the pi ... I'd suggest having a browse there ... see .. raspberrypi.org/forums/viewforum.php?f=72 – Kolban Dec 21 '15 at 0:02
3

People have been writing hobby operating systems and bare metal code since 2012 for the Raspberry Pi. I think you fixation on the closed-source GPU blob is misguided - the lack of official public USB controller docs has been a bigger obstacle. Check out the Bare Metal subforum at https://www.raspberrypi.org/forums/viewforum.php?f=72 in any case.

To your framebuffer comment : GPUs are (to me) an abstraction unto itself - write to memory and it magically appears on screen. This is their very purpose if i am not mistaken.

A system like fignition or the Parallax Propeller (both have a distinct educational aspect) might be a better choice here because it is more obvious and transparent how the video is actually generated.

Another option might be to refuse using HDMI/Composite and driving an display over the GPIO yourself.

  • Thanks for the reply, and thanks for the recommended systems! Yes, I was aware the USB stack was also closed as well. I have not actually dug into the Pi yet (I bought one today though!). Perhaps a more direct way of phrasing my question is: How many of these "black boxes" can I expect as I try to tinker around at low levels? My primary goal is self-education. – zach Dec 22 '15 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.