WIP: Long descriptor page table support
Note that other than a couple of components (listed below), all the outstanding LongDesc code has now been merged into the main sources, so the code from this merge request is no longer needed (just use the main kernel sources).
To build a version of the kernel which uses long descriptor page tables, set LongDesc to TRUE in hdr.Options or via ASFLAGS.
Summary of API changes/extensions:
- Added OS_Memory 64, which is OS_Memory 0 but with 64bit physical addresses
- Added OS_Memory 65, for logical -> physical address translation which works with IO regions (OS_Memory 0/64 only work with regular RAM)
- Added Service_PagesUnsafe64 & Service_PagesSafe64, which are Service_PagesUnsafe / PagesSafe but with 64bit physical addresses (using same block format as OS_Memory 64, like their predecessors which used the OS_Memory 0 format)
- OS_Memory 19 (DMAPrep) has a flag to allow 64bit physical addresses to be used
- OS_PlatformFeatures 0 has a new flag (CPUFlag_HighRAM) which is set of any RAM is present which has a > 32bit physical address (a hint that apps should use the new 64bit APIs instead of older 32bit ones)
- RISCOS_AddRAM has a flag that allows high RAM to be added (causes start, end & sigbits to be interpreted as page-unit addresses instead of byte-unit). High RAM is automatically ignored if LongDesc is FALSE
- PhysRamTable now stores addresses in page units instead of byte units, and advertised via OS_ReadSysInfo 6 item 89
- Note all the above changes apply to all kernel builds, regardless of whether LongDesc is enabled
What works:
- Boots to desktop on Pi 3, Pi 4, IGEPv5, Titanium
- Compressed ROM support
- Cacheable pagetable support
- Lazy task swapping
- Support for RAM above the 4GB limit
- Support for machines with >4GB RAM
- Boot-time selection of long vs. short descriptor format (based on whether the HAL has registered any high RAM)
- Other WIP component updates:
TODO:
- HAL control over RISCOS_MapInIO page flags
- OS_ReadSysInfo 6 items for finding the long-descriptor page tables
- Proper handling of "privileged read-write, unprivileged read-only" access permission - the long descriptor format doesn't support this, so currently it gets handled as "privileged read-write, unprivileged read-write"
- Updates to other OS components to make them happy with the long descriptor tables (softload tool, etc.)
- Updated DMAManager for 64bit phys addresses
- Probably some other things!