The July 2024 talk was a hybrid meeting featuring Gerph (who knows a few things about RISC OS) looking at the 64 bit issues which RISC OS faces with the disappearance of 32 bit chips. It was a very well attended talk with 50 people on or offline.
Gerph worked for RISC OS Select (did most of the 32 bit port), wrote RISC OS Pyromaniac.
The structure of the talk was the differences between 32 and 64 bit, what problems it causes us and some personal thoughts on what can be done.
64 bit has been around for some time (since ARMv8) but had 32bit backwards compatibility. 64 bit refers to size of memory, register size and a set of new features. AArch32 and AArch 64 another to refer to them.
New ARM chips do not offer 32 bit and RISC OS is a 32bit OS... Could still be run in emulation and old chips still likely to be around (you can still buy a 6502) but will not run on new hardware.
Big change on instructions which are not backwards compatible.
ARM64 has a choice of 64 or 32 bit register access. Floating point is more 'reliable' - it's all there or not. Registers work differently. Different modes of operation (privilege model).
The problems all this raises is that any ARM code will not run. Assembler needs rewriting or some emulation. C code will need to be recompiled and probably tweaked. New version of BASIC will be needed. Norcroft does not support 64 bit. SWI numbers are 24 bits but SVC 'replacement' is only 16 bit.
Any API which uses descriptors in memory will need to be changed. RISC OS APIs will need work and a good chance to clean up some bad design (like bouncing in and out of privileged modes). LImited number of RISC OS developers and small user base.
The final part of the talk looked at some possible solutions. Will need to be done gradually in small steps. Converting modules to C will take time but helps.
Gerph's suggestions are:-
- stop writing assembler - just C.
- Use a register for SWI number
- Stick to 32bit logical address space for memory
- Adopt AAPCS as only register mapping
- Assume Frame Pointer will always be used
- Get rid of multiple instantiation of modules
- Write Tests for APIs
- Redesign APIs to avoid flags
- Make modules easier to work with in C
- Update AIF headers to show not 32 bit and remove decompression entry
- Only use ELF in future
- Feature flags for modules to show system
- Modules start on page boundary +4
- Special module area rather than just using RMA (becomes Random Memory Area)
- Rewrite the assembler modules in C (having written the tests)
Gerph had some nice demos running some ARM and C 64 bit code on RISC OS Pyromaniac (code on GitHub), including the game Chucky Egg.
In a nice plot reveal, the whole talk was running on Pyromaniac using a 64bit version of Gerph's presentation tool.
Full talk slides are at http://presentation.riscos.online/64bit/
After the talk there was time for Q and A.
Many thanks to Gerph for making a complex topic very clear and understandable.
As usual, details on talks available on the Rougol website.