TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: BOB PROHASKA
from: THEO
date: 2020-12-19 21:04:00
subject: Re: Bare metal programmin

bob prohaska  wrote:
> Found a somewhat readable (for a non-programmer) account of how to
> load and run "bare metal" programs on a Pi4. It's at:
> https://isometimes.github.io/rpi4-osdev/
>
> The author still uses u-boot to load and run his code, leaving the question
> of how much code he _didn't_ write remains resident and active.
>
> I'm getting the impression that u-boot starts a considerable amount of
> activity on the GPU. Does it simply go away once an introduced kernel is
> started? Later on in the tutorial it's clear that bluetooth requires
> its own software, which doesn't appear to be open source.

The GPU runs its own OS and provides services to the ARM cores via the
'mailbox' interface.  Other components (eg wifi and bluetooth) contain their
own processors running their own software stacks.  In general you don't get
sources to software running on 'peripherals'.

On Pis 1-3 the GPU boots *first* and then loads the kernel ready for the
ARM.  On Pi4 it's a more 'normal' system with the ARM in charge.

> So, just how "bare" is bare metal on the Pi?

You can get the ARM cores to yourself if you want.  It is possible to keep
u-boot
in memory to provide 'firmware' services that your operating system doesn't
provide, and there's also TrustZone, although I don't think the Pi
environment uses that out of the box (I'm less familiar with Pi4).

If you want to do bare-metal things without U-boot, there's BakingPi:
https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/
although that's written for the Pi1 and will need small changes for Pis
0/2/3.  I'm not sure it'll work on Pi4.  There are some PRs for supporting
other Pis (Alex hasn't been able to work on it for a while):
https://github.com/Chadderz121/bakingpi-www

Theo

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.