RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Dual-format SD card

category: Help

Introduction

Many hardware platforms (Raspberry Pi, Beagleboard etc.) need a DOS partition to hold bootloader files, but RISC OS wants its files (particularly !Boot) to reside in a Filecore partition. Additionally, Filecore doesn’t – yet – handle partitioned discs, so “thinks” it owns the whole device. Finally, there’s only one SD card slot on the Raspberry Pi.

How to solve this conundrum?

The answer is a “dual-format” SD card.

Card layout

The solution is actually quite ingenious.

  • The entire SD card is formatted using !HForm.
  • Next, a DOSDisc file called !Boot.Loader is created, big enough to hold the bootloader files with room to spare.
  • Finally the Master Boot Record (MBR) is adjusted to show a DOS partition occupying the exact space allocated to !Boot.Loader, and the MBR is also adjusted to show a Filecore partition occupying the remainder of the card.1

RISC OS will see the SD card as a Filecore-format disc, but other systems will see a DOS partition. Hence the Raspberry Pi (etc.) bootloader can boot from the DOS partition, and RISC OS can access !Boot itself using Filecore.

1 Having a Filecore partition mentioned in the MBR isn’t strictly necessary (Filecore ignores it) but it does prevent other systems from accidentally overwriting the contents.

How to create your own boot SD card

There are two easy methods, and one not-so-easy method:

  1. The RISC OS application SystemDisc will reformat a blank SD, and then guides you through the process of populating the DOS and Filecore partitions with the necessary software. This method allows RISC OS to access the entire SD card: it is not limited to the first 2GB.
  2. A platform-independent way is to clone an existing boot SD card (e.g. the RISC OS Pi SD image available from the Downloads page). Note that RISC OS will only be able to use the first 2GB of the card.
  3. The more adventurous of you might want to use the (Linux) scripts referenced in this forum thread to generate a boot SD card of any size.

Once you have the SD card in the correct format, it’s time to populate it with software.

  • Right-click on the drive icon to open the Filecore partition. This will already contain a !Boot directory containing just one file (Loader). Now copy the necessary !Boot directory contents (e.g. from the stable HardDisc4 image on the Miscellaneous downloads page) along with any other files you want to have in the Filecore partition. Take care not to overwrite !Boot.Loader – the card won’t boot if you do.
  • Next, double-click on !Boot.Loader and install the RISC OS ROM and the necessary firmware for your hardware platform (e.g. on the Raspberry Pi you might be copying “bootcode.bin”, “config.txt”, “fixup.dat”, “riscos.img” and “start.elf”; you may also be copying “CMOS”, “cmdline.txt”, “fixup4.dat” and “start4.elf” if needed).
  • Remember to dismount the SD card and wait the regulation 15 seconds before unplugging.

Restrictions

  1. !Boot.Loader must NOT be moved, deleted or overwritten. The proper way of updating the DOS partition is to double-click on !Boot.Loader and copy the individual files.
  2. Do not expose the SD card to any utilities that check for partition inconsistencies. For example, “fsck” has been known to find some inconsequential problem with filenames in the DOS partition: when it “corrects” the “error”, the card won’t boot.

The future

Work is underway to update Filecore to handle partitioned discs directly. When that is complete, the need for this special dual-format SD card will disappear.

Revised on September 15, 2020 14:33:33 by Stuart Painting (5389)? (2.27.47.211)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: Raspberry Pi questions and answers, Using RISC OS on the Raspberry Pi

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys