megatron_6
Posts: 8
Joined: Wed Aug 28, 2019 3:50 pm

Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 2:43 pm

I want to do a deep dive into learning how a computer's systems are programmed at the lowest level and obviously, I'd need to get a hold of some low-level code.

The Raspberry Pi seems to make sense for me because I already own an RPI3 and I have an RPI Zero on the way, that I recently bought.

The question I want to ask is already in the title but I'll expand a but, I know that the Raspberry Pi isn't meant to be free and open source, it's just a learning tool for kids and a sort of prototype board for adults.
If there is an open source firmware somewhere out there for it, one that is functional and runs Linux, can I have a link to it? If not, then is there another single board computer with completely open firmware out there?

Thank you,

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25914
Joined: Sat Jul 30, 2011 7:41 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 2:45 pm

No, there is no open source firmware AFAIK.

Although if you want to 'deep dive', the linux kernel tree source code, which is OSS, should keep you going for about 200 years. You probably don't need to go much deeper than that.

Not aware of any completely open source SBC's.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“My wife said to me `...you’re not even listening`.
I thought, that’s an odd way to start a conversation.."

megatron_6
Posts: 8
Joined: Wed Aug 28, 2019 3:50 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 3:07 pm

jamesh wrote:
Fri Aug 30, 2019 2:45 pm
No, there is no open source firmware AFAIK.

Although if you want to 'deep dive', the linux kernel tree source code, which is OSS, should keep you going for about 200 years. You probably don't need to go much deeper than that.

Not aware of any completely open source SBC's.
I'm interested in learning hardware level programming, firmware programming for example.
I know that there is the Novena laptop, which has open source firmware, but it costs about $500 just to get the board without anything in addition to it.
On the higher end, there is also the Talos II computers from Raptor Engineering, which have a Power9 CPU and the firmware is completely open. The NVME drivers in the Talos II are closed source but that is optional. That costs over $2000 though.

I'm sure that there are some cheaper computers out there that have all their software open to everyone. Even if it's somewhat over $100 I think I'd buy it.

I'll definitely take your advice on looking into Linux code though. Thank you.

fruitoftheloom
Posts: 22557
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 3:10 pm

megatron_6 wrote:
Fri Aug 30, 2019 3:07 pm
jamesh wrote:
Fri Aug 30, 2019 2:45 pm
No, there is no open source firmware AFAIK.

Although if you want to 'deep dive', the linux kernel tree source code, which is OSS, should keep you going for about 200 years. You probably don't need to go much deeper than that.

Not aware of any completely open source SBC's.
I'm interested in learning hardware level programming, firmware programming for example.
I know that there is the Novena laptop, which has open source firmware, but it costs about $500 just to get the board without anything in addition to it.
On the higher end, there is also the Talos II computers from Raptor Engineering, which have a Power9 CPU and the firmware is completely open. The NVME drivers in the Talos II are closed source but that is optional. That costs over $2000 though.

I'm sure that there are some cheaper computers out there that have all their software open to everyone. Even if it's somewhat over $100 I think I'd buy it.

I'll definitely take your advice on looking into Linux code though. Thank you.

https://www.96boards.org/
Rather than negativity think outside the box !

Asus ChromeBox 3 Celeron is my other computer.

ejolson
Posts: 4849
Joined: Tue Mar 18, 2014 11:47 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 3:19 pm

megatron_6 wrote:
Fri Aug 30, 2019 3:07 pm
jamesh wrote:
Fri Aug 30, 2019 2:45 pm
No, there is no open source firmware AFAIK.

Although if you want to 'deep dive', the linux kernel tree source code, which is OSS, should keep you going for about 200 years. You probably don't need to go much deeper than that.

Not aware of any completely open source SBC's.
I'm interested in learning hardware level programming, firmware programming for example.
I know that there is the Novena laptop, which has open source firmware, but it costs about $500 just to get the board without anything in addition to it.
On the higher end, there is also the Talos II computers from Raptor Engineering, which have a Power9 CPU and the firmware is completely open. The NVME drivers in the Talos II are closed source but that is optional. That costs over $2000 though.

I'm sure that there are some cheaper computers out there that have all their software open to everyone. Even if it's somewhat over $100 I think I'd buy it.

I'll definitely take your advice on looking into Linux code though. Thank you.
A purely open-source software stack is more important for auditable security than learning hardware-level programming.

If I were to suggest a useful project for the Raspberry Pi regarding open firmware, I would suggest porting the iPXE network boot program. There are already 32-bit and 64-bit ARM versions of this code in the repository designed to run under EFI. The Pi would need some sort of bare-metal version.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25914
Joined: Sat Jul 30, 2011 7:41 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 4:15 pm

megatron_6 wrote:
Fri Aug 30, 2019 3:07 pm
jamesh wrote:
Fri Aug 30, 2019 2:45 pm
No, there is no open source firmware AFAIK.

Although if you want to 'deep dive', the linux kernel tree source code, which is OSS, should keep you going for about 200 years. You probably don't need to go much deeper than that.

Not aware of any completely open source SBC's.
I'm interested in learning hardware level programming, firmware programming for example.
I know that there is the Novena laptop, which has open source firmware, but it costs about $500 just to get the board without anything in addition to it.
On the higher end, there is also the Talos II computers from Raptor Engineering, which have a Power9 CPU and the firmware is completely open. The NVME drivers in the Talos II are closed source but that is optional. That costs over $2000 though.

I'm sure that there are some cheaper computers out there that have all their software open to everyone. Even if it's somewhat over $100 I think I'd buy it.

I'll definitely take your advice on looking into Linux code though. Thank you.
Not much difference between linux drivers and writing firmware TBH. They both talk to hardware, and they both have code that doesn't talk to hardware. For example, the VC4 firmware on the Pi is 250k lines of code, of which only a small number of drivers talk directly to the hardware. Much of it is indistinguishable from any other high level coding. Same with Linux. So you should be able to learn a colossal amount from the linux drivers.

A good example, the H265 decoder on the Pi 4 is ONLY accessible from the Arm and therefore requires Linux drivers. We don't access it from the firmware at all.

Or try something even lower level, like an Arduino, or bare metal on the Pi itself.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“My wife said to me `...you’re not even listening`.
I thought, that’s an odd way to start a conversation.."

hippy
Posts: 7103
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 5:54 pm

megatron_6 wrote:
Fri Aug 30, 2019 2:43 pm
I want to do a deep dive into learning how a computer's systems are programmed at the lowest level and obviously, I'd need to get a hold of some low-level code.
I doubt there's much which isn't open source which would stand in your way.

If there is then the PI probably isn't for you. You would either need to modify your plans to match what you get with a Pi or choose something else which has opened what you want to do.

Andyroo

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Aug 30, 2019 6:36 pm

The closest I know of is https://www.freertos.org/ on the Arduino.

Have had a look at the needs of Linux drivers, I decided to learn Python instead :oops:

hippy
Posts: 7103
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 2:54 pm

Andyroo wrote:
Fri Aug 30, 2019 6:36 pm
Have had a look at the needs of Linux drivers, I decided to learn Python instead :oops:
I managed to get a soft-UART device driver working how I wanted by standing on the shoulders of someone who had already done that. That was fairly straight-forward, all just standard C and determining the magic command line incantations needed to get it built and installed.

The OP hasn't said what they are wanting to do other than in wide-sweeping terms, has not explained why they need "open source firmware", "low-level code", or what either mean in practice. "Firmware" can mean a whole lot of different things when it comes to a Pi.

From this thread it appears the OP is interested in writing device drivers, but they haven't said what kind of drivers or what hardware those drivers would handle -

https://www.raspberrypi.org/forums/view ... 1#p1527381

It would probably help if the OP could detail some of the specific things they are looking at doing or hoping to learn about.
Last edited by hippy on Sat Aug 31, 2019 3:04 pm, edited 1 time in total.

megatron_6
Posts: 8
Joined: Wed Aug 28, 2019 3:50 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 3:01 pm

hippy wrote:
Sat Aug 31, 2019 2:54 pm
I managed to get a soft-UART device driver working how I wanted by standing on the shoulders of someone who had already done that. That was fairly straight-forward, all just standard C and determining the magic command line incantations needed to get it built and installed.

The OP hasn't said what they are wanting to do other than in wide-sweeping terms, has not explained why they need "open source firmware", "low-level code", or what either mean in practice. "Firmware" can mean a whole lot of different things when it comes to a Pi.

It would probably help if the OP could detail some of the specific things they are looking at doing or hoping to learn about.
I'd like to experiment with showing images on screen and possibly make a small game run on the bare metal.
Mostly I want to do it to learn how the computer works, I know I can do the above things with the existing firmware but I want to see as much of what happens under the hood as I can.

hippy
Posts: 7103
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 3:17 pm

megatron_6 wrote:
Sat Aug 31, 2019 3:01 pm
I'd like to experiment with showing images on screen and possibly make a small game run on the bare metal.
Mostly I want to do it to learn how the computer works, I know I can do the above things with the existing firmware but I want to see as much of what happens under the hood as I can.
I would suggest you start with Python or C and controlling a GPIO attached 3.5" LCD or similar directly. That's as direct as it can be and will teach you all the fundamentals of how things work right down to the very bottom level. Everything else is just an optimisation upon that foundation.

There is a lot of stuff out there on writing such drivers, optimising them, and pushing them to extremes. For example -

https://github.com/juj/fbcp-ili9341

I am writing my own driver for such an LCD which has stalled somewhat due to other adventures getting in the way. Such as figuring out how to read and write GIF, JPG and PNG files without calling library routines, how to create a framework which can copy images and screens to any other image or screen. There's a whole wealth of knowledge and fun to be gained which is all entirely possible on a Pi, without using what's provided with a Pi other than its ability to run the code one has written.

Memotech Bill
Posts: 34
Joined: Sun Nov 18, 2018 9:23 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 4:03 pm

Another way to learn what computers are doing at the chip level without having to deal with many layers of abstraction is to play with much simpler 8-bit machines such as:

https://www.raspberrypi.org/forums/view ... 62&t=77429
https://www.raspberrypi.org/forums/view ... 2&t=226889
https://www.retrobrewcomputers.org/doku.php

hippy
Posts: 7103
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 4:20 pm

Memotech Bill wrote:
Sat Aug 31, 2019 4:03 pm
Another way to learn what computers are doing at the chip level without having to deal with many layers of abstraction is to play with much simpler 8-bit machines such as:

https://www.raspberrypi.org/forums/view ... 62&t=77429
https://www.raspberrypi.org/forums/view ... 2&t=226889
https://www.retrobrewcomputers.org/doku.php
If going that route I would suggest starting with Arduino, ESP or something similar which others will be more familiar with.

A Propeller chip could be a good choice because that has video output mostly handled in software.

If wanting to go real low-level, I would grab an FPGA, implement RISC-V or some other ISA on that, then add an LCD to it.

But I still believe controlling a GPIO attached LCD from bit-banged Python or C is the best way to get to grips with the fundamentals. That makes the Pi the development and target device, makes development and debugging real easy. What's learned can be easily ported to something else, bare metal or some other device.

megatron_6
Posts: 8
Joined: Wed Aug 28, 2019 3:50 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 6:36 pm

hippy wrote:
Sat Aug 31, 2019 3:17 pm
figuring out how to read and write GIF, JPG and PNG files without calling library routines...
I suggest reading and writing the BMP and TGA formats. I made a small console app that converts BMP to TGA not too long ago, take a look.
https://github.com/gunrunners-paradise/ ... -converter
I think the code is a bit hacky but it gets the job done.

PNG and JPEG are fairly complex for beginners, I didn't want to spend too much time figuring out how they work so I found 2 formats that have their data laid out in a fairly simple manner. Though BMP files are literally a little bit backward with the way their color data is organized.

megatron_6
Posts: 8
Joined: Wed Aug 28, 2019 3:50 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 7:17 pm

Memotech Bill wrote:
Sat Aug 31, 2019 4:03 pm
Another way to learn what computers are doing at the chip level without having to deal with many layers of abstraction is to play with much simpler 8-bit machines such as:

https://www.raspberrypi.org/forums/view ... 62&t=77429
https://www.raspberrypi.org/forums/view ... 2&t=226889
https://www.retrobrewcomputers.org/doku.php
Wow, this definitely looks like something that is up my alley.
I think it requires knowing electronics and soldering though because it doesn't look like these are assembled when you buy them. I get the impression that you have to source each chip and electronics part from a separate place.

Any advice on how to start with retro style 8 bit computers?

ejolson
Posts: 4849
Joined: Tue Mar 18, 2014 11:47 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Sat Aug 31, 2019 7:19 pm

Memotech Bill wrote:
Sat Aug 31, 2019 4:03 pm
Another way to learn what computers are doing at the chip level without having to deal with many layers of abstraction is to play with much simpler 8-bit machines such as:

https://www.raspberrypi.org/forums/view ... 62&t=77429
https://www.raspberrypi.org/forums/view ... 2&t=226889
https://www.retrobrewcomputers.org/doku.php
The kit

https://www.tindie.com/stores/Semachthemonkey/

is simple, versatile and quite nice. It even has the option to use a Pi Zero as the system console.

Memotech Bill
Posts: 34
Joined: Sun Nov 18, 2018 9:23 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Sun Sep 01, 2019 6:56 am

As mentioned in the previous post the RC2014 is available as a kit. Probably also others if you Google.

Issues 7 and 8 of HackSpace magazine outlined building a simple Z80 machine as a (large) breadboard project. For that you would have to source your own chips. The articles are worth reading anyway for the description of the theory.

Or see if you can buy an old 1970's or 1980's 8-bit machine on Ebay. In many ways the older or more obscure machines which implemented all the logic in TTL chips are more interesting than say the Sinclair ZX81 or Spectrum which use a large ULA chip.

User avatar
jbeale
Posts: 3618
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Is there an open source firmware for the Raspberry Pi computers?

Thu Dec 19, 2019 6:10 pm

Speaking as a firmware programmer, I would say the Arduino world is the easiest place to get started with direct hardware control. It is also pretty low cost; you can get Arduino compatible boards well under $10 and in any quantity. Many of my projects have used some kind of arduino-style microcontroller for real-time control combined with a Pi to provide mass storage, network access and user interface. If you specifically want to use the Pi, you can start with the various libraries like PiGPIO intended for hardware control or to go farther, search for "raspberry pi bare metal" and see what comes up (it's quite a bit!)

Lewis-H
Posts: 26
Joined: Thu Oct 31, 2019 12:45 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Thu Jan 23, 2020 2:23 pm

No. The Pi Zero uses the BCM2835 system-on-a-chip, which combines a CPU and a VideoCore 4 GPU -- the same basic SoC as on the Pi A/B/+ models although with a faster clock speed (which does not necessarily mean it was manufactured any differently1).

My understanding is that the GPU bootstraps the CPU and loads a kernel into it. Although the kernel can be anything, including Linux, which in its vanilla form meets the FSF's standards for free/libre open-source software, the firmware required for the GPU is from the closed source.

I'm pretty sure the non-vanilla Raspberry Pi kernel, which presumably runs on the Zero, does qualify as FOSS. The bits added for the BCM2708 (of which 2835 is an implementation) are not proprietary. In other words, the fact that this has not been merged into the vanilla kernel is not a licensing issue.

So, this is the same in this regard as previous Pis and nearly all general-purpose computers currently on the market, which use proprietary firmware for the BIOS or (U)EFI. Looking at the article you linked, the issue with other single board computers seems to most often be firmware for peripheral components (wifi, VPU/GPU, etc).

tului
Posts: 18
Joined: Sat Nov 09, 2013 6:19 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Mon Jan 27, 2020 10:45 pm

jamesh wrote:
Fri Aug 30, 2019 2:45 pm
No, there is no open source firmware AFAIK...
...
Not aware of any completely open source SBC's.
I think the Librem 5 is about the closest you can get

cleverca22
Posts: 391
Joined: Sat Aug 18, 2012 2:33 pm

Re: Is there an open source firmware for the Raspberry Pi computers?

Tue Jan 28, 2020 9:01 am

there is also https://github.com/christinaa/rpi-open-firmware and the fork at https://github.com/cleverca22/rpi-open-firmware that ive been working on lately

currently, linux can boot on the rpi3, but i'm getting segfault issues within the initrd and some weird instability that i need to debug further

usb/ethernet is working, but no graphics yet, though i expect graphics to be relatively simple, given that the rpi4 puts linux into control more, and the gfx pipeline appears to be the same across all models

User avatar
MikeDB
Posts: 167
Joined: Sun Oct 12, 2014 8:27 am

Re: Is there an open source firmware for the Raspberry Pi computers?

Fri Feb 28, 2020 8:56 pm

Have a look at the STM32MP157. Not sure if everything is open-source but most STMicro stuff is.
Will the forthcoming MIDI-2 spec at last allow us to set the volume to 11 !!

Return to “General programming discussion”