On Saturday, 29 April 2023 22:10:17 CEST Paul Boddie wrote:
Anyway, that is as far as I have managed to get, unfortunately. I did attempt to try the older Subversion-based L4Re distribution, but I encountered a long- forgotten issue with the build system and didn't have the appetite to continue. Any insights would be welcome.
Well, I reactivated the old Subversion-based L4Re/Fiasco distribution and it still works on the CI20. The build system problems are superficial errors that occur when running "make B=..." in the l4re directory and are related to various configuration tests that cannot find system headers. Ignoring these errors and just configuring and building yields a working image.
I decided to test the old L4Re distribution with the new kernel and it seems to fail when clearing the status register in the kernel's start routine. Similarly, the new L4Re distribution (obtained using ham) seems to fail in the same way, either with the old or new kernels.
Usually, when clearing the status register and, crucially, the ERL flag, any pending exception might be delivered and this may well be undesirable, especially if the exception handlers are not set up. Although a watchpoint exception is recorded in the cause register, there doesn't seem to be any indication that this exception is actually pending.
I am actually rather perplexed by the code in the bootstrap package's crt0.S file. It supposedly sets up a memory mapping for the first 512MB of memory using a pair of 256MB pages, but this is apparently superfluous if the CPU is already handling an error (ERL set in the status register), with an identity mapping being active for the first 2GB of memory in such cases.
I can only presume that some machines have bootloaders that clear ERL before the bootstrap code is invoked. Another concern is that the CI20 does not actually support 256MB pages, and so the mapping would actually only map two 16MB regions starting 256MB apart. I also find the mixing of virtual and physical addresses in the bootstrap code, as described previously, to be troubling.
Currently, I remain mystified by this problem. The bootstrap code has changed, but arguably not in substantial architecture-specific ways. Similarly, the kernel code remains unchanged in such ways, although the kernel payload is now somewhat bigger.
Any insights would be welcome, certainly.
Paul