I found the Nard build http://www.arbetsmyra.dyndns.org/nard/ which does EXACTLY what I need, but the author confirms it won't currently work on the Pi4 and would take months of effort to retarget. So can anybody point me at anything similar that would work on the Pi4 ?
I'd really like all the things listed on the Nard website, but the key issues for me are :
Running in RAM - no write access to the SIM card except for updates
Runs 64 bit code
Constant running for months on end
Handles power-fail situations seamlessly, including in the middle of an update
Watchdog
Hotswap of USB memory sticks
Doesn't need any of the fancy Linux stuff - just needs to boot and launch a single application which just uses the memory mapping, multithreading, SIM, USB and WiFi APIs.
And I realise this is almost achievable with Bare Metal ... except the WiFi !