mailto: blog -at- heyrick -dot- eu

Navi: Previous entry Display calendar Next entry
Switch to desktop version

FYI! Last read at 04:43 on 2024/04/29.

Building RISC OS on the Pi

A little treat for you, in the run-up to Christmas (yeah... I know it is Christmas because there are more toys than normal in the supermarket, and it is themed into boy/girl, easily determined by virtue of the girl's aisle being pink - anything and everything is bright pink).
You've used RISC OS, right? On a Beagle? On a Pi? Or maybe just on an emulator?

Get ready for a geekfest!

We're going to elevate it to the next step - we're going to roll our own RISC OS. Yup, we're going to build this baby from source, install it, and run it.

Geek @ work

What you will need

Here is what you will need: So, let's recap:

 

A brief word about the licence

Just a small point that might be necessary to some - the RISC OS sources are not GPL. They are supplied according to a Castle licence, which you can read here. Basically, it is free for personal private use and hacking is encouraged so long as you grant Castle (and thus ROOL) the ability to merge your modifications into RISC OS to improve the system for everybody. The licence is specifically not an OEM licence, so you cannot distribute RISC OS within embedded products. If this is your wish, you will need the OEM licence (here) plus a licence for the number of copies of RISC OS you will be supplying. Interestingly, the price depends upon how soon you intend to feed your code back into RISC OS, so you can licence "everything" from as little as £3 per copy. Or £2.10 if you only want the kernel (ROM image) stuff. There are further reductions if you intend on supplying devices numbering in the hundreds...

 

Unpacking the sources

I have all of my DDE and source codes within a directory called "Coding", full path "$.Coding". I recommend that you have something similar to keep your directories tidy.
Within this tidy location, create a directory called "RISCOS".

This guide will assume that you will be placing RISC OS at $.Coding.RISCOS. If this is not correct for your setup, kindly ask your eyeballs to do a search-and-replace all occurances of that with the correct path that you are using. ;-)

Using !SparkFS (either the full one or the read-only one), unpack the archive UnTarBz2_106a2.zip into the RISCOS directory. Also place the source archive(s) in there.

Collecting all the things necessary to build RISC OS on a RaspberryPi

Run the !UnTarBZ2 program and drag the BCM2835Dev archive on to the UnTarBZ2 iconbar icon.

A window will appear, that looks like this:

Unpacking RISC OS

In the second, blank, writable icon, enter the full path to the RISCOS directory, like this:

Setting the unpack destination

Don't touch any of the other options (which ought to be as shown above). Just click on "RUN".

If you have a fondleslab or other sort of tablet, fire it up, watch animé or catch up on those episodes of Naniwa Shōnen Tanteidan that you never got around to watching...or is that just me? (^_^)
If you're stuck for ideas, Avril Lavigne's "Here's To Never Growing Up" is on YouTube (HD too). Watch it, and tell me it isn't a darker remake of "Complicated". Then look for a cat called Maru. Or attempt the Gangnam Style dance. Extra points if you can remember any of the words other than "yoe-ja".

Why have I suddenly started talking rubbish? Well, the conversion of the bz2 archive to a tar file will take about 28 minutes on a standard Pi with a Class 4 SD card. A better speed SD card would be preferred, but it seems that Class 10 (the wing-zing type) can suffer...shall we say "compatibility issues"? Annoyingly 7-zip did it on a 1.6GHz Atom in 67 seconds... go figure...

Following this is the unpacking proper. There are 8,369 files to be unpacked and moved and attributes/filetypes fiddled to make it all work correctly under RISC OS. Seriously, we're looking at a couple of hours, so while your lowly PC might be able to extract in a handful of minutes, the result will be pure gibberish to RISC OS. Just... set it going and then go watch a movie. A really long movie, like Space Battleship Yamato (live action) or Suzumiya Haruhi no shōshitsu (my review) or The Man From Nowhere (recommended!).
Alternatively... fire up your PC and write a blog post and whinge about how damn long this takes. ;-)

It this point the process will probably bomb out with the error "File 'SDFS::RISCOS.$.Coding.RISCOS.*.Prepare.!run' not found". Don't worry about this. You can close the UnTarBZ2 window.

The UnTarBZ2 program bombing out due to a star where there ought not be a star!

There is a directory within RISCOS called BCM2835Dev. Open it. Now open the directory Prepare that you now see. Then double-click on the !Run file.

Getting the environment set up

What is happening now is that pieces of your DDE and libraries are being copied into the sources so the build process can find them. Answer Y to set up the build process.
If the filer has not 'seen' the DDE tools, run !SetPaths in the AcornC/C++ directory, then answer Y.

You want to run Builder, so press Y one last time. That done, you can close the TaskWindow.

Click Menu on the Builder icon bar icon (looks like an old-fashioned EPROM with a trowel over it) and select the "Register build tree..." menu option.
Drag the BCM2835Dev directory to the window that appears, then click Save.

Setting up !Builder

NOW SHUT DOWN AND REBOOT. [because if the DDE has been seen, it risks clashing with the builder]

 

Starting the first build

Open the RISCOS directory, then BCM2835Dev, then Apps (or in other words, SDFS::RISCOS.$.Coding.RISCOS.BCM2835Dev.Apps) and double-click !Builder.

Click on the Builder icon bar icon. A window will appear. For the Environment, click on the menu pop-up icon and choose ROOL.BCM2835:

Selecting what to build

Now tick the following boxes (unsure the others are not ticked):

Do not touch the version numbering, leave it set as "ImageName" and "Don't".

Setting the build options

Then click on Build.

 

A few brief comments on build failures

The build process should not fail - after all, RISC OS is built every night from this source code. The sources that you downloaded to build this version of RISC OS is current as of yesterday, and the same will be true for you, whenever you download the source archive. However, there is always the possibility that something may be checked into the repository by error, so it might fail, once in a blue moon when Saiph is just about to rise... (^_^)

Just so you know, the string "AMU: ***" (or just "***") is your pointer to build errors. Some can be ignored, like "Nothing to delete", but "Not found" and "exit (1)" indicate serious problems.

If the build fails, it is imperative to correctly resolve the problem and redo the necessary steps. If in doubt, start the build process again from the beginning. It is better to be sure.

Oh, and if the build speed bothers you - try to imagine how it must have been to build RISC OS 3 on a 25MHz machine. Or RISC OS 2 on a 8MHz machine.

 

The conclusion of the build

After what seems like an eternity (about 50 minutes), you will see that a lot of modules (135 in this build) were created, pasted together, and prodded into the form of a RISC OS ROM image.

[...pages and pages of stuff above...]
CDFSSoftSCSI               FC44E6FC         00002514
CDFS                       FC450C14         00004268
CDFSFiler                  FC454E80         00002C60
UnSqzAIF                   FC457AE4         00000318
BlendTable                 FC457E00         000006F4
HeroNames                  FC4584F8         000002B9

Total of 135 modules.
==============================================================================
Starting phase join ...
romlinker: version 0.04 (31 Jul 2011)
romlinker: Standard ROM image construction
romlinker: Image has 686128 bytes spare (670.05K)
romlinker: crc16=8c61

==============================================================================
Finished ROOL.BCM2835 build : Tue Nov  5 18:48:50 2013
------------------------------------------------------------------------------
Closing log file 'SDFS::RISCOS.$.Coding.RISCOS.BCM2835Dev.BuildSys.Logs.dURZ00-00'.
That bit, in bold, is what you want to see.

 

Installing the new ROM image

Now comes the fun.

In the $.Coding.RISCOS.BCM2835Dev directory is a directory called "Images". Open it, and you ought to see a file with a name like dURZ00-00. The letter at the start increments with each build (aURZ00-00, bURZ00-00, cURZ00-00, etc). There can be problems with long file names and DOS partitions (would it be "DURZ00-00" or "DURZ00~1"?), so to keep things simple, just rename that to RISCOS/IMG (all upper case).

Rename the ROM image

Open the directory $.!Boot.Loader, and create a folder called "OLDER". Move the existing RISC OS ROM image (probably called "RISCOS/IMG") into the OLDER folder (do not delete it, you'll need it in case something went wrong).

Now copy the new RISCOS/IMG file from the "Images" directory into the "Loader" directory.

Installing the ROM image

Now open the file CONFIG/TXT in a text editor, and ensure that the line that points to the kernel (probably the last line) correctly refers to the file RISCOS.IMG - note that the file must be given in DOS form, so it's a dot not a slash!
Save the modified configuration file.

Editing the Pi configuration file

Don't worry if your CONFIG/TXT file looks different to mine. I started using composite video, and then moved to an HDMI to VGA adaptor, so there's stuff in there to set all this up correctly.

 

Note - you MUST rename the ROM image "RISCOS/IMG"

The reason for this is the SDCMOS file saves configuration information to the end of the ROM image (!) and it only looks for the image "SDFS::0.$.!Boot.Loader.riscos/img".
If you call your ROM something else, it will work but configuration will not persist between sessions.

 

Going for broke!

Shutdown RISC OS, then click the big inviting Restart button.
This is it! The final click!

Don't breathe!

 

...

 

If everything goes according to plan, you will see a lot of "init mod:" messages scroll up the screen, followed by something about callbacks, and then the familiar RISC OS start-up will appear.
Check the date in the Task Manager.
Go on... You know you want to!

My build is running quite nicely, thank you very much!

 

Normally I use 1280×1024 (as that is the native resolution of my monitor). Here is RISC OS running in a 640×512 mode, so that it will fit into this b.log article without scaling.

RISC OS!

 

Recovery - if nothing happens

If you have not updated your firmware, check it now. Details are above.
At time of writing, the correct firmware is: If yours differ, or if you have other files (LOADER/BIN, etc) then you may need to update your firmware. Try this first, and if RISC OS still fails to boot.....

The simplest recovery method is to remove the SD card from the Pi, place it into a different machine's SD card reader (such as a PC), and then:

Then put the SD card back into your Pi and boot it up.

If you want to have a crack at doing this again, go back to the "Starting the first build" step, and if there is an error in the build, be sure that you have dealt with it fully.

 

Your comments:

Rick, 31st December 2013, 21:09
This article (on building RISC OS from scratch) has been revised and updated to correct a few issues and provide additional information, and also to provide screenshots without the watermarks (as it makes things easier to read).
Rick, 18th March 2016, 23:59
You should now get your RISC OS ROM images from ROOL directly...

Add a comment (v0.11) [help?]
Your name:

 
Your email (optional):

 
Validation:
Please type 80553 backwards.

 
Your comment:

 

Navi: Previous entry Display calendar Next entry
Switch to desktop version

Search:

See the rest of HeyRick :-)