RPCEmu Linux Guide


Revision as of 18:24, 23 October 2008 by Dtanis (Talk | contribs)
Jump to: navigation, search



This quick guide describes how to download/instal/configure RPCEmu for your linux environment. The guide is written for a [hddp://www.debian.org/ Debian] linux distribution like [hddp://www.ubuntu.com Ubuntu], [hddp://www.knoppix.org/ Knoppix] and [hddp://www.xandros.com/ Xandros]. This doesn't mean it won't work on other linux distributions but commands, package names and places of files could be different then described in this guide.


What do you need:

  • Linux system: P4 or similar processor at about 2GHz or more.
  • A working [hddp://en.wikipedia.org/wiki/X_Window_System X Window system (X11)]
  • Internet connection
  • Harddisc space: 62 MB for the emulator and 500 MB for RISC OS applications
  • Image files of RISC OS roms 3.6, 3.7 or 4.02 (best is RISC OS 4.02)


Get the required packages for the RPCEmu emulator by using apt-get:

sudo apt-get update
sudo apt-get install subversion liballegro4.2 liballegro4.2-dev liballegro4.2-plugin-jack

Get the lates RPCEmu package with subversion:

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

After downloading:

cd rpcemu/src/

If you get an error that the system doesn't recognize any of the above commands then install the next packages:

sudo apt-get install make automake autoconf

You can get some warnings from the allegro library, just ignore them.

Now you have two options. Create the interpreter version of rpcemu or the dynamic recompiler. The first one is slower but more stable and it's possible to select an ARM processor. The recompiler version has the advantage to be five times faster but only runs the StrongARM (SA) processor. If you want to run the SA processor under RISC OS 4 then I recommend the recompiler because of bad screen redraws and abort on data transfers in 16 bits per pixel modes.

To select the interpreter:


To select dynamic recompiler:

./configure --enable-dynarec

If you see the output and get no errors then compile:


The emulator is ready for use. You only need the RISC OS roms. I recommend to get RISC OS 4.02 because it has more support for internet. As RISC OS is copyrighted, you have to get them yourself from a real RISC PC. Just open a taskwindow (press CTRL+F12) on your RISC PC and enter the next commands:

*save rom1 38000000 39000000
*save rom2 39000000 3A000000
*save rom3 3A000000 3B000000
*save rom4 3B000000 3C000000

Get the 4 files (rom1 rom2 rom3 rom4) to your linux host system and copy them to the roms directory. If you have the wget package then download the bootimage:

wget hddp://b-em.bbcmicro.com/arculator/hdboot.zip

Otherwise download the archive from the site with your browser. Extract the archive to the rpcemu directory and overwrite cmos.ram and hd4.hdf:

unzip hdboot.zip

Create two directories:

mkdir hostfs
mkdir poduleroms

Edit rpc.cfg:

mouse_following = 1
cdrom_type = 0
cdrom_enabled = 1
blit_optimisation = 0
refresh_rate = 60
stretch_mode = 0
sound_enabled = 1
vram_size = 2
cpu_type = ARM710
mem_size = 32
ipaddress =

Start up the emulator in your X11 environment:


A window will pop up and the emulator loads the OS and runs the Boot system. You've got a working RISC OS desktop on your linux system.

Enlarging bootdisc

Run the emulator and wait till the system has been booted. Now open the Filer window of your HostFS disc. This disc is linked to your previously created hostfs directory. It's now empty but you can use this disc to transfer files from the host system to RISC OS and back. The ADFS harddisc where the system boots from is linked to an image file hd4.hdf on your host system.

Open !Boot (shift doubleclick) on the bootdisc and go to directory Choices.Boot.Task.!hostfs. Edit !Run (shift doubleclick) and change line:

rmensure hostfs 0 rmload <hostfs$dir>.hostfsrm


rmensure ArcEmHostfs 0 RMLoad <hostfs$Dir>.hostfsrm

Copy !Boot from IDEDisc4 to the HostFS disc.

Now press F12 and enter the command:

*configure filesystem HostFS

Return to the desktop. Go back to the linux console and copy the HostFS module in the !Boot to your dir poduleroms:

cp hostfs/\!Boot/Choices/Boot/Tasks/\!hostfs/hostfsrm,ffa podulesroms/

Shutdown RISC OS and quit the emulator. Get HForm from the [hddp://b-em.bbcmicro.com/arculator Arculator] website and unzip it:

wget hddp://b-em.bbcmicro.com/arculator/rpchform.zip
unzip rpchform

Boot the emulator and press CTRL+END. A menu pops up at the left top. Select 'Disc' -> 'Load drive :0...'. Select hform.adf and press 'OK'. Open drive 0 (click on the :0 icon at the iconbar) and run !HForm. Format the ADFS bootdisc with these options:

Drive: 4
Retain shape: No
Drive type: OTHER
Sectors per track: 63
Heads: 16
Cylinders: 1024
Drive parameter init flag: 1
Parking cylinder: 1023
No more changes to defect list
Initialise the drive
Soak test: None
Bootable disc: Yes
Longfilenames: Yes (only available for RISC OS 4)
Confirm format: Yes
Large file allocation unit (LFAU): 2048

You have created a large harddisc image of 504MB for ADFS drive 4. If you want a bigger image then enlarge number of cylinders. Note that the parking cylinder must be the total amount of cylinders minus 1. Note also that you have to multiply the suggested LFAU value by 2. So if HForm suggests 1024 then change it to 2048.

Installing RISC OS 4 Boot system

Go to directory hostfs and download the RISC OS 4 Boot installer archive from the riscos.com site:

wget hddp://support.riscos.com/Support/Releases/RO4install.zip
mv RO4install.zip RO4install,ddc

As you probably don't have a dearchiver for RISC OS:

wget hddp://www.davidpilling.net/splug.bas
mv splug.bas splug,ffb

Open your HostFS disc in RISC OS and run the basic file splug. After !SparkPlug has been created, doubleclick on the archive file RO4install and extract !RO4Install to your Harddisc4 disc. This can take some minutes (look at the SparkPlug icon to see if the extracting has finished).

Doubleclick on the RISC OS 4 installer, drag the !Boot icon to the filer window of Harddisc4, click on 'Continue' and in the next dialogue click on 'Start install'. Click on 'Continue' in the warning window and click on 'Continue' in the next dialogue. Wait till the installer is finished and click 'Continue' again. In the next dialogue click 'Continue' to install Apps and Utilities. After installation click 'Exit'

Press F12 and enter the commands:

*configure filesystem ADFS
*configure drive 4

Return to the desktop. Open the installed !Boot dir and go to directory Choices.Boot.Task. Open your old !Boot directory on the HostFS disc and copy !hostfs from Choices.Boot.Task to the same directory inside the new installed Boot. Shutdown RISC OS and click 'Restart' to boot the OS with the new Boot.

You now have a fully working Boot with the standard RISC OS 4 apps and utilities.

CD-ROM support

Check if the symbolic link /dev/cdrom points to your CD-ROM device at the host system. You can check this by trying to mount this device to a directory. Insert a data CD-ROM in your drive and enter the commands:

mkdir ~/cdrom
sudo mount /dev/cdrom ~/cdrom
ls ~/cdrom

If you don't get any errors and see the contents of the disc then the link works. Now unmount the disc and remove dir cdrom:

sudo unmount ~/cdrom
rmdir ~/cdrom

Edit rpc.cfg and check if:

cdrom_enabled = 1

Start the emulator and open the RPCEmu menu. Select 'Settings' -> 'CDROM' -> 'IOCTL'. Doubleclick the !Boot icon on the RISC OS bootdisc. Select 'Discs' in the configuration dialogue, configure one CD-ROM drive and click on 'Set'. Click 'OK' in the next warning dialogue. Open the CD-ROM by clicking the CD-ROM icon :0 at the left of the iconbar.

It also possible to mount ISO images instead of real CD-ROM's with RPCEmu. Open the RPCEmu menu and select 'Settings' -> 'CDROM' -> 'ISO image ...', select an ISO image to mount and click 'OK'. Open the CD-ROM image by clicking the CD-ROM icon :0 at the left of the iconbar.

Note every time you start RPCEmu, you have to select 'IOCTL' or 'ISO image ...' to enable CD-ROM support.

Network support

RPCEmu uses a TAP tunnel device to send packets between the emulator and the host system. Unfortunately these devices can only created by root, therefore RPCEmu must be run as root. So to enable it you have two options:

1. Use sudo to start RPCEmu:

sudo ./rpcemu

RPCEmule will automatically drop root privileges as the tunnel has been created. This has a disadvantage that you have to enter a password to get RPCEmu going.

2. Make root the owner of the rpcemu binary and set the user s-bit. Enter the two commands:

sudo chown root rpcemu
sudo chmod u+s rpcemu

And edit rpc.cfg to add this line:

username = <your standard username>

In this case RPCEmu will also drop root privileges after the tunnel has been created.

Check rpc.cfg for the IP-address. It should be:

ipaddress =

Run RPCEmu with root privileges. You should not get messages like:

Error setting TAP on tunnel device: Operation not permitted
Networking unavailable

Check if the emulator has created a tap interface and that it's IP-address has been set to

ifconfig -a

You should get something like this:

tap0      Link encap:Ethernet  HWaddr 00:ff...........
          inet addr:  Bcast:  Mask:

Next try to ping the interface:


You should get something like this:

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.079 ms
64 bytes from icmp_seq=2 ttl=64 time=0.069 ms

Get the latest !System from Castle:

cd hostfs
wget hddp://www.iyonix.com/32bit/download/System.zip
mv System.zip System,ddc

Copy the EtherRPCEM directory from riscos-progs to the hostfs dir:

cp -r riscos-progs/EtherRPCEm/ hostfs/

In RISC OS open the HostFS disc and extract archive System. Doubleclick on !SysMerge. Open dir EtherRPCEm and copy !Boot from the EtherRPCEm dir on the !Boot of your bootdisc. Run !Boot and click 'System' to open the System merge dialogue. Drag !System from the EtherRPCEm dir to it and click 'Merge'. Click 'Network' in the configuration dialogue and click 'Internet' in the next dialogue. Enable 'TCP/IP Protocol suite' and click on 'Interfaces'. Enable 'RPCEmu' interface and click 'Configure...'. Set these settings:

Obtain IP address: Manually
IP address:

Click 'Set' and 'Close' in Interfaces dialogue. Open the Routing dialogue and set these settings:


Click 'Set' and open the Host Names dialogue. Set these settings:

Host name: rpcemu
Local domain: riscoslocalnet.net
Primary name server: use 1st IP addres from output command cat /etc/resolv.conf
Secondary name server: use 2nd IP addres from output command cat /etc/resolv.conf
Tertiary name server: empty or 3rd IP addres from output command cat /etc/resolv.conf
Name resolver module: Resolver Acorn
Enable Use name server also

Click 'Set' and 'Close' in the Internet configuration dialogue. Next Click 'Set' in the Network configuration dialogue and click 'Reset now' in the next question dialogue.

After the emulator has booted open a taskwindow (CTRL-F12) and enter:

*ifconfig -a

You should get something like this:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet netmask 0xff000000 
        inet netmask 0xffff0000 broadcast
        ether 00:00:00:00:00:00 

Next try to ping (the emulator gateway) and your host system IP. If that works fine you only have to configure the host system to enable packet forwarding. If you're running a firewall package on your host system then it's recommended to use it to configure port forwarding. You can also enable forwarding by using these commands:

sudo iptables -I FWDINTERNET -j ACCEPT
sudo iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -I POSTROUTING -t nat -o ! lo -j MASQUERADE
sudo echo "1" > /proc/sys/net/ipv4/ip_forward
sudo echo "1" > /proc/sys/net/ipv4/ip_dynaddr

Try to ping some hosts on the internet like google.com, riscos.com etc. If that works you are connected to the internet with RPCEmu.

Installing Netsurf

Go to the hostfs dir and download the latest Netsurf from hddp://www.netsurf-browser.org or use wget:

wget hddp://www.netsurf-browser.org/downloads/development/netsurf.zip

Rename netsurf.zip to netsurf,ddc. Start the emulator and create a dir Internet on your bootdisc. Extract the contents from the netsurf archive to this dir. Use the Boot Merge and the System Merge facility to merge !Boot and !System from the Internet dir to your boot system. Next reboot the emulator and start !NetSurf from dir Internet. Enter a valid url in the top bar and you're on the world wide web.

Personal tools