I think we want to support Raspberry on both 32 bit and 64 bit. It just takes time. Note that a lot of ARM hardware has come and gone since the ARM port was started so it is very much up in the air…
(For the work in progress 64 bit there were/are? issues with libs so it is currently targeting only newer arch, but that will change)
Honest question: Is it even worth it supporting ARM32? Other than that, the main reason I think RPi would be a killer platform to support is:
1 - It is obviously one of the most successful (if not the most successful) small computer development platform.
2 - It is a lot easier to support a well defined platform like it (few drivers to make sure are working and fewer weird interactions to worry about).
3 - There is no indication that it is not here to stay for the foreseeable future.
I agree, Raspberry Pi (3 or 4) could be a good candidate for first HW platform for the ARM port. Once it starts working in qemu.
As of now it seems that the 64-bit ARM port would be better suited for ARMv8.2 i.e. Snapdragon, Exynos, Apple M1/M2 while the 32-bit ARM port for entry level ARMv7/ARMv8 devices.
Earlier I promised a list of next possible items for the ARM port… in case someone wants to join me in the fun.
So here we go.
driver and accelerant for qemu ramfb device - this is mostly for easier debugging in qemu, the code is mostly there I just have to clean it up and upload it for review
implement missing parts of memory management. Most important: accessed and modified bits. I can share some more details if anyone is interested
sort out FPU context save/restore. When does it have to be done and exactly how - the existing code is half-baked. Check how to do it on exceptions, context switches, setjmp/longjmp
thread handling is mostly there but it needs some testing, ensure that forking, signals, resuming syscalls really work as expected. So far I haven’t seen any particular issue with this but not much happens in user space so far.
troubleshoot remaining user mode issues. Currently most of the initial processes are able to start (incl. app_server) but we start getting unhandled page faults rather early. At this point I don’t know what is this so this will need some debugging.
Resolving these should get us quite far at least in qemu. Then for running on real hardware:
memory barriers need to be reviewed
similarly for cache and TLB maintenance
drivers, drivers, drivers
… and some optional nice-to-have items:
sort out which when to save which registers. Currently we save all registers on exceptions, context switches, signals etc - maybe some of it can be optimized based on the call convention - this needs some investigation, at least I always forget the save-by-caller, save-by-callee etc
implement TTBR split. Currently all the memory is mapped via TTBR0 so we have a page table containing both kernel and user memory. We could map lower memory via TTBR0, upper memory via TTBR1
implement LPAE, this also gives us better page permission handling (NX/PNX etc)
and then I don’t even want to mention SMP, that will be a story of its own. Once we get things running on one core…
the usual disclaimer: this is my current (very limited) understanding so please feel free to amend, criticise or completely ignore it
I also spotted in the SerenityOS monthly update, that they have RPi3 emulation target in QEMU booting to their desktop without any apparent issues (other than they don’t have USB yet), so maybe there is something in there to help with our port?
I had a little bit of time recently to check on the current status of the ARM port (a few minor things merged recently)
The blue background is now reproducible on latest hrev, thanks to the fix for the framebuffer driver from X512. I’ve also added a fix to uname so now package daemon won’t try to uninstall everything at the first bootup.
Unfortunately we’re still getting random page faults (but every time so it might be related to timing or an uninitialized variable) and nothing shows up on the GUI, just the empty background. Some more troubleshooting will be needed.
some more technical updates here, as I haven’t posted in a while.
As it’s noted in the monthly report by waddlesplash, there was some limited progress on the 32-bit ARM port last month:
implement memory types using TEX remap
implement MMU Accessed flag
implement MMU Modified flag
Other points of interest
no regression on QEMU, RPi3, RPi4 (i.e. it reaches the same point in the bootup sequence as before)
mutex issues seen on multiple threads, reaching the assertion mutex was not actually locked! - this was before hrev57121, should be re-checked , Update: on newer hrev we only get warning printouts, see below.
no input neither with virtio-input nor usb, input_server seems unresponsive
with a little bit of “cheating” I was able to get AboutSystem and LaunchBox to start, I’ll upload a screenshot soon