Softloading ROMs on Pi4
Salvatore Insalaco (8688) 7 posts |
I’d like to start playing with the kernel modules code, in particular with some drivers that cannot be tested in emulation. |
David Pitt (3386) 1248 posts |
A ROM that fails to start can be rather inconvenient. On the Titanium a development or test ROM build can be softloaded, if it fails then it is only necessary to reboot the machine to return to a safe ROM. That is a very nice way of working.
The RPi does not support softloading, and a ROM from another machine is not going to work in any case, ROMs are hardware specific. For the Pi one can have any number of cards, safe ones, risky development ones. When it does go wrong corrections can be made by reverting to a safe card and correcting the faulty card either in a USB micro SD card reader or even in the on board slot. The SD card slot is like a floppy disc, it can be hot changed. A safe renamed ROM image can be kept on a card but if the test ROM does fail then there does need to be some other method available to get the Pi working again and reinstate the safe ROM. It is worth considering separating RISC OS and the Pi firmware, RISC OS on a USB SSD with the firmware and ROM on an unpartitioned SD card.
The RPi can be that other machine, just have a card with Raspberry Pi OS, the “Raspberry Pi Imager”:https://www.raspberrypi.org/software/ will write new cards. Hope that helps. |
Salvatore Insalaco (8688) 7 posts |
Thank you for your suggestions David. |
Bryan (8467) 468 posts |
The Pi4 can have the hardware boot files 1 on a USB Memory stick instead of an SDcard. Just take the SDcard out and the Pi will boot from the USB Memory stick (which is more readily accesible on the 4té) 1 Only 5 files needed:- config.txt fixup4.dat start4.elf riscos.img and cmos |
Chris Hall (132) 3554 posts |
What is easy to do is to add a conditional step in the config.txt so that if you plug in a switch to the 40 pin header, you can select which rom starts up by whether the switch is open or closed. |
Bryan (8467) 468 posts |
Conditional steps in config.txt sounded interesting, so I tried this simple addition to the end of my Pi4 config.txt # make GPIO 21 input and activate pull-up gpio=21=ip,pu [gpio21=0] arm_freq=1300 [gpio21=1] arm_freq=1500 It works. Thank you Chris. I just used a link rather than a switch. GPIO 21 to Ground on the other row of pins |
David Pitt (3386) 1248 posts |
I did not know from this topic that it was a 4té. For my usage an obscured SD card slot would not be good. Moving on, USB booting is now a thing, with the default of booting from the SD card if present. I already have a RISC OS recovery Boot pen which is unpartitioned Fat32 containing only the firmware and ROM that can be used if the SD card fails to start. To access that, or to boot into Raspberry Pi OS on a USB SSD, the SD card has to be removed. Moving on a bit more, the Pi boot order can be set to boot from USB if present but if not boot from SD. This might be more convenient. With no USB FAT partitions present RISC OS runs from the SD card as usual. To run something else the USB device needs inserting and the Pi rebooting. A slight downside is that the SD card is slow to start, there is a Bootloader message showing the search. |