Main »

Booting RISC OS from SSD on the Raspberry Pi

Started 9th September 2021

I wanted to boot RISC OS from SSD on a Raspberry Pi. How to do this is available from Google, what I add here is the knowledge that it works, is easy to achieve and the mistakes I made.

I am using a Pi 4, some of the feeling of difficulty and hazard on the web comes from previous versions of the Pi.

Three steps:
Set up the Pi to boot from SSD
Install RISC OS on the SSD
Make the SSD boot into RISC OS

You will need, a Raspberry Pi, an SSD, a SATA to USB adapter...

Set up the Pi to boot from SSD
See: James A. Chambers, Legendary Technology Blog "Raspberry Pi 4 Bootloader USB Mass Storage Boot Guide" - the key being setting up the EEPROM bootloader.

The anxiety here is around power usage of the SSD and the SATA to USB adapter, and if the SATA adapter will work. I used "iitrust USB 3.0 to SATA Adapter Cable" and "Kingston SSDNow A400". I have 480GB and 240GB versions, the small one is for RISC OS because the ADFS disc format can't go above 256GB. The Pi is powered from an official Pi power supply. These choices work.

The boot behaviour set up above is that with a SD card inserted in the Pi SD socket, the Pi will boot from it. With no SD card the Pi boots from USB. What follows relies on this.

Install RISC OS on the SSD
Begin by downloading the latest release of RISC OS for the Pi from RISC OS Open. This is installed on an SD card in the usual way.

Connect up the SSD to the Pi running RISC OS (from SD) and use HForm from Utilities.Caution to format the SSD.

Next turn to the Pi running Raspian (from SD) and download and unpack the following from Github:

Chris Johns adfs-tools

With the RISC OS SD card inserted in a USB adapter in a Pi USB socket, run:

get_loader.py sda Loader

For me the device was "sda". It is useful to use ls /dev to see which the correct device is (it will appear after being inserted). The name "Loader" is arbitrary for this step, but since some subsequent steps require it, you might as well get it right here.

Now remove the RISC OS SD card in its USB adapter, and connect the SSD, and run the following:

put_loader.py sda Loader
claim_frags.py sda
add_loader.py sda

Now boot the Pi from the RISC OS SD card with the SSD connected. You can then copy the RISC OS files from SD card to the SSD. That includes !Boot. By default clicking on the SSD disc drive icon causes its contents to appear as those of a small PC partition - you don't want to copy to that. The filer should be closed and then opened on the RISC OS area of the SSD by clicking on the icon bar icon with Adjust.

It is now possible boot the Pi from SSD with no RISC OS SD card. But it won't complete the boot sequence until the next step.

Make the SSD boot into RISC OS
From 4.2. Can I boot the Pi from USB (without an SD card at all)?

configure filesystem scsi
configure scsifsdrive 0
savecmos scsi::0.$.!Boot.Loader.CMOS
(should be savecmos scsi::0.$.Loader.CMOS)

This is where I got it wrong. !Boot contains a file Loader, but that has been copied across from the RISC OS SD card; on that SD card Loader was a magic or special file, but on the SSD it is not (it lost its magic properties when copied). The magic file on the SSD is $.Loader. As it says in the ADFS tools instructions you might as well not copy !Boot.Loader, but if you do it should be removed, and replaced with the Loader file from the root (by rename or shift+drag move).

The magic throughout is that one disc can be read as an ADFS disc as well as a PC format FAT32 disc. The "magic" Loader file appears in both views of the disc because it exists in both. Under ADFS it appears as a PC partition file and can be opened as an image file to show its contents.

Bryan P pointed out that it is necessary to get the drive number right in the above, might be 4 and not 0.



Postscript
I synchronised the SSD with the disc in my Iyonix. This was stupid because !Boot off the Iyonix was not going to work with the latest version of RISC OS on the Pi. It also deleted the magic copy of Loader. Anyway with no Loader it is game over, it won't boot (of course) and although I could mount the SSD as an ADFS format disc, RISC OS hung. I did try putting the Loader back, and that didn't work either. Moral, look after the Loader file.


Comments

Click to return to index

David Pilling's Wiki

Set view

Page last modified on July 24, 2022, at 12:09 AM - Powered by PmWiki pmwiki-2.3.31 (pmwiki-2.3.31)

^