What does HackerNews think of circle?
A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)
Access to most of the hardware and real-time deterministic behavior. It’s a really great project and lets you twiddle those gpio pins at ridiculous speeds with perfect timing (less than a millisecond).
A PI comes with a whole bunch of great hardware baked in, so if you have one laying around, and want to do some microcontroller stuff, I think it’s a great choice.
The way Apple moved classic MacOS from 680x0 to PowerPC was to write a tiny kernel emulator, with an API to run native stuff on the metal, and run more or less the whole OS under emulation, profile it and just translate the most speed-critical bits.
https://en.wikipedia.org/wiki/Mac_OS_nanokernel
That's a lot of work for a FOSS project but given the performance delta between 1980s 680x0 and 2020s ARM, total emulation of the whole thing should be perfectly fine. It's how the PiStorm Amiga upgrade works.
https://amigastore.eu/853-pistorm.html
So all I envision is something like Aranym:
... running on top of Ultibo, say:
Or maybe Circle:
[1] https://codeberg.org/dcoredump/MicroDexed [2] https://github.com/rsta2/circle [3] https://github.com/dwhinham/mt32-pi
Reminds me of some 'bare metal OS' series for Raspberry Pi: https://www.rpi4os.com and https://s-matyukevich.github.io/raspberry-pi-os and https://github.com/rsta2/circle
Recent x64 AMD and Intel PC's use UEFI secure boot and require signed boot images, so this simple approach won't boot out-of-the box anymore I suspect. Same for Mac M1. So some update would be useful, without requiring to disable UEFI secure boot.
I will suggest studying some general Assembly language concepts, memory locations, how to set-up RAM timings and bring offchip RAM into an address space, etc.
This stuff is used daily in the world of microcontrollers, I'm a huge fan of the Parallax propeller, in which the Spin interpreter in ROM launches Assembly routines on individual cores in about the simplest fashion possible...
Some things you may find interesting: https://github.com/dwelch67/raspberrypi
https://github.com/rsta2/circle
Think of the latter 2 as "HAL plus some primitives" rather than RTOS...