An old project to port xv6 to the Raspberry Pi, there are better more complete out there, published as an example of baremetal programming on a Pi.