I've been curious about baremetal programming on linux-class devices for awhile. Turns out there's a community of folks with the same curiosity (https://www.raspberrypi.org/forums/viewforum.php?f=72) and a lot of progress made in open source land. I'm plan to use this project as mostly a learning exercise. Since we all need a goal to get stuff done, I'm going to *try* to port MicroPython (https://github.com/micropython/micropython) onto a Raspberry Pi Zero. To the text editor!
In addition, there's a rather datedproject that got ChibiOS (my preferred RTOS) running on a Pi using the above resources. There may be a separate project for the RTOS in the future!
Have you seen this port of MicroPython already? https://forum.micropython.org/viewtopic.php?f=12&t=3317