Meeting: RISC OS on Linux with RPCemu

June 2009

Steve Fryatt installed a copy of RPCemu on an Ubuntu Linux machine, using a copy of RISCOS Ltd’s “Virtually Free” CD to get RISC OS 4 up and running. Starting with downloading the source code from the internet, we saw how to compile the emulator from scratch, set up a host filing system, install the RISC OS ROM images and get software such as ArtWorks Viewer and the Ovation Pro demo available for use.

Report by Chris Bass

Steve Fryatt opened his talk by saying that, while he was aware that users with Windows or Mac systems have got Virtual Acorn solutions for running RISC OS, those on Linux don’t (and probably won’t) have. He has looked at the only solution – RPCemu, which is an open-source emulator that will run RISC OS 3 and 4. A version for Linux is hosted on the riscos.info website, and is a development of the original program by Tom Walker.

Whilst RPCemu is less polished than the commercial systems, it costs nothing – and it is readily available. Installation on Linux requires the source to be downloaded and compiled, although Steve did add that efforts have been made to provide ‘packaged’ systems – Paul Stewart was offering Puppy Linux with RPCemu at the show. Also, versions are available for Windows and Mac OS (such as the ready-built ‘Spoon’ editions). In fact, installing on Linux isn’t actually that hard!

Steve talked about his experience of installing RPCemu on Ubuntu, one of the many distributions (or ‘distros’) of Linux. The guide on the RPCemu site is written for Debian Linux, of which Ubuntu is a ‘flavour’. It is currently one of the more popular distros, and is what the machine used for the demonstration was running. Other distros will require some different commands, but the process should be similar.

Getting the bits

To get RPCemu running, you require the emulator sources, and a copy of the RISC OS ROMs. The most legitimate way to source the latter is to buy a copy of RISCOS Ltd’s ‘Virtually Free’ ROMs on CD for £5, which also come with a full RISC OS 4 disc image. If you have a RiscPC, you can ‘extract’ a copy of the ROMs, but you don’t get the disc image! One member did say he has successfully got the 4.39 ROM working under the Windows version of RPCemu.

The guide indicates that you need a modern-ish hardware and software system. A lot of the guide is command-line based, but all the commands are given. In some cases there are GUI alternatives, but using these may require more effort.

The first step is to open the command prompt (known as the terminal on Linux) to install some basic tools. Updates and tools are installed via the package management system – this is what RiscPkg is modelled on, but it’s far more developed (and useful) on Linux. There are two ways to access it on Ubuntu: via apt-get from the terminal, or via the GUI with the Synaptic Package Manager. Steve launched Synaptic, and showed that the packages listed in the instructions were present, along with many others – including the Linux version of NetSurf.

However, the instructions use the command line, so Steve turned to the terminal. The first thing to do was to make sure that the package manager had an up-to-date list of what packages were available on the Ubuntu site, so he entered the command (copied from the guide):

sudo apt-get update

In the command, update is an instruction to the apt-get command which tells it to go online and update its list of packages. As the package manager can make changes to the system, it must be run as the ‘root’ (or ‘administrator’, in Windows-parlance) user; sudo tells the system to do this, and makes it ask for the root password before the command will run. Having updated the package list, Steve could install the software required by RPCemu, with the command

sudo apt-get install build-essential subversion liballegro4.2 liballegro4.2-dev liballegro4.2-plugin-jack unzip wget

This went away and installed all of the packages required by RPCemu – as before, the command was copied from the instructions.

Compiling the source

The final thing to be downloaded from the internet was the RPCemu sources themselves. These are stored on the riscos.info website, using a system called Subversion. Using the cd command (equivalent to *Dir on RISC OS) to change to the directory in which he was to install RPCemu, Steve then entered the command

svn co svn://svn.riscos.info/rpcemu/trunk rpcemu

to download the files and place then in a new sub-directory called rpcemu. He then changed directory again to the folder containing the downloaded sources, with the command cd rpcemu/src/, before issuing three further commands copied from the instructions

aclocal
automake
autoconf

You can get some warnings from the Allegro library – just ignore them.

Now there are two options: create the interpreter version of RPCemu, or use the dynamic recompiler. The first is slower but more stable in use. The recompiler version has the advantage of being up to five times faster, but only runs the StrongARM processor. Steve recommended the recompiler because of a current problem in the interpreter with bad screen redraws and abort on data transfers in 16 bits per pixel modes.

To select the dynamic recompiler, Steve entered the command

./configure --enable-dynarec

As the output seemed to contain no obvious errors, he then went on to compile the emulator itself with the command:

make

Again this gave no errors, and a new file had appeared in the directory listing: the emulator executable.

The emulator was compiled from source code downloaded from the internet – the rpcemu file seen bottom-right is the finished product

Setting up RISC OS

The next stage of the process was to fetch copies of the RISC OS ROMs and disc image. Steve had bought the Virtually Free CD from RISCOS Ltd at the Midlands Show last December, so he was able to copy them from this to the hard disc.

The instructions say to download the disc image, but it’s also included on the disc from RISCOS Ltd. Like VRPC, RPCemu also has a host filing system – now called EmuFS, it used to be called HostFS as well, which explains its directory name. To make the disc image available to RISC OS, it needs to be seen by EmuFS: still following the instructions, Steve created a hostfs folder (using the mkdir hostfs command) to act as the RISC OS hard disc and copied the archive containing the disc image into it.

The Virtually Free CD also contains a set of instructions for installing RPCemu, supplied in text and HTML formats. Steve opened these, and suggested that the only relevant sections were steps 4 and 5 of the RPCemu bit – all the rest is out of date to one degree or another.

Before running the emulator, it was also necessary to configure RPCemu correctly. Its options are stored in a text file: rpc.cfg, in the same directory as the emulator. Steve double-clicked on the file to open it in a text editor, and worked through the changes given on the web page. In addition to the listed changes, Steve also suggested upping the machine’s RAM by setting mem_size = 128.

The EmuFS filing system also needed to be enabled, and at the end of the file Steve edited [hostfs_] to read [hostfs]. The default options following this define two drives: one is the contents of the hostfs folder; the other is a view of the Linux home directory. Having made the changes. Steve saved the file and closed it.

Running RPCemu for the first time

To run RPCemu Steve double-clicked on rpcemu in the directory listing. The emulator screen opened and ran through boot to the basic RISC OS desktop. Since there was no !Boot on the disc yet, only the basic RISC OS from the ROMs was available. At this point, Steve said that due to his use of the disc image from the RISCOS Ltd CD, he was going to deviate slightly from the guide on the website.

Finally... a familiar-looking screen on the Linux desktop

On the left of the iconbar are some hard disc icons. ‘Boot’ and ‘Home’ are EmuFS drives, and provide access to places on the Linux disc (Boot is the contents of the hostfs folder, where the disc image archive was stored). ‘4’ is an ADFS ‘disc’, and won’t be formatted yet. We might need this if we find something that isn’t happy on EmuFS (such as Ovation Pro), but for the time being, the EmuFS discs would be sufficient. Steve clicked on the ‘Boot’ hard disc icon, and there was the RO4Disc file from earlier. As a self-extracting archive, it was typed as ‘Absolute’ and the Next slot in the Task Manager was set to more than 8M before being double-clicked. A save box opened, and Steve dragged the icon to the root directory of the Boot disc.

The contents of the archive extracted to the hard disc, and some familiar items appeared. Once complete, Steve deleted the RO4Disc archive itself, and also deleted the !hostfs application which was a hang-over from days before EmuFS. Double-clicking on !Boot wouldn’t let Steve do anything, as !Boot had not been run properly yet. To make the disc bootable, Steve pressed F12, and typed

*Configure Filesystem EmuFS

RISC OS was then shut down and the emulator closed to save the ‘CMOS RAM’ settings, then the emulator was re-run. This time, “EmuFS” was shown as the system started. When the boot finished there was a backdrop on the pinboard, so !Boot must have run. However, the screen was still at 640 × 480. To change this, Steve double-clicked on !Boot to start Configure, went to the Screen section, chose ‘Acorn AKF65’ and set ‘256 Colours’, and ‘800 × 600’. However, when Set was clicked there was an error: “EmuFS must be given a filename”.

Steve suggested (having found the problem when he had first installed RPCemu) that this was ‘probably’ due to an error during booting preventing the sequence from completing correctly. This problem isn’t restricted to RPCemu, and can be seen on all hardware and all versions of RISC OS when things go wrong. In order to track it down, he installed Martin Avison’s Reporter and configured it to log every step of the boot sequence (as described in this howto article).

Re-starting the emulator again generated a log showing one particular issue in the !Boot.Choices.Boot.Predesk.!!ROMPatch file: the ROM patches don’t work on RPCemu for some reason. Steve solved this by amending the *ROMpatch command in the file to read *X ROMPatch – this quietly ignores errors, so they don’t stop !Boot. Saving the file and restarting the machine again now showed a bigger desktop, at 800 × 600, as the boot sequence had completed correctly.

RPCemu could not be run full screen as yet, as Steve had hit issues for this demo because of the odd resolution that he was running the laptop at for the projector. It worked fine at the machine’s native resolution, and he offered to show this at the front after the talk.

Doing something useful

Next Steve updated the installation’s !Boot by installing the newer Toolbox modules from RISCOS Ltd’s website, and the 32-bit Shared C Library from Castle. He also updated the copy of SparkPlug from the RISCOS Ltd CD to a newer version from David Pilling’s website.

With !Boot updated, Steve installed a copy of ArtWorks Viewer and showed some of the example images. RPCemu is limited to the modes that an actual RiscPC can do, but switching to a 32-thousand colour mode improved the rendering of things like the ‘ArtWorks Apple’.

As mentioned earlier, even though EmuFS is good, some applications don’t like it (Ovation Pro being one). As a result, Steve now went on to set up an emulated ADFS disc: these are a fixed size, take up real disc space (think of discs under the old PC Emulator), and can’t be accessed from Linux. The disc is stored in the rpcemu directory, as hd4.hdf; as supplied in the download, it’s a small file which must be formatted from RISC OS.

A copy of HForm comes with RISC OS 4’s disc image, in Utilities. Steve ran it, and entered the commands to format the disc as recommended on the riscos.info website. After a couple of problems caused by him changing some of the parameters on the spur of the moment, the format was complete and he showed this by installing and running the demo version of Ovation Pro from the ADFS disc.

Note that larger, pre-formatted hard disc images can be obtained from the riscos.net site. You can also boot from the ADFS disc by pressing F12, and typing

*Configure Filesystem ADFS
*Configure drive 4

Networking RPCemu

Steve had also wanted to demonstrate how RPCemu could make use of the machine’s network connection, but problems getting either of the Linux machines to talk to the sports club’s WiFi meant that this was not possible. He assured us that it does actually work! As with everything else, getting the networking up and running is just a case of following the detailed instructions in the online guide.

Steve concluded by saying printing also works: you need to download and install !Printers from the RISC OS Open Ltd site. He has successfully printed documents this way, using PrintPDF to turn the output into a PDF file and then printing this out via Acrobat Reader or whatever from within Linux. Remember the EmuFS drives can be accessed under Linux.

After this Steve went on to discuss other distributions of Linux including Puppy Linux.

Finally Steve was thanked for a very interesting and enlightening talk, which I’m sure will prompt many of the members present to have a go either using Linux or Windows versions of RPCemu.

Useful links

The RPCemu page (with links to the Linux guide) is at www.riscos.info/index.php/RPCEmu.

The “Virtually Free” RISC OS 4 CD can be bought from RISCOS Ltd at sales.riscos.com.

Copies of !Printers are at www.riscosopen.org/content/downloads/desktop-zipfiles.

Meeting resources

There are more resources for this meeting if you are a WROCC member: log in to view them.