Virtual Acorn – Fun with Virtualized RISC OS

(this is a guest post from Antoni Sawicki aka Tenox)

VirtualRPC-SA let’s you run virtual RISC OS on a Windows or Mac OS X host similarly to VMware, VirtualBox or Qemu. The company page features this picture:

acorn1… in reality you you probably don’t want to do that!

As of time of writing of this article there is a sale going on! You can buy VirtualRPC-SA for only about $100. My primary reason for getting it was porting aclock to RISC OS. In addition to the VM I also purchased the original compiler and developer tools (DDE). It allows to target the funky 26 bit CPU. Otherwise GCC is available for free.acorn-cVirtualRPC comes “pre-installed” with the RISC OS in a virtual ROM image. The OS at first glance is quite nice looking and seems fun in to explore and play around. You can browse the web and use a bunch of weird applications from alien world. You can find a lot of software apps here and here and here. However I personally could not use this for anything more serious.

riscos-webPorting of aclock to RISC OS was by far one of most difficult ones if not the most difficult. To display text on the screen you need to use system calls directly, for which you use a special function called _swi() or _swix(). There is no concept of sleep() so I had to improvise an empty loop. Fortunately there are screen codes that allow to position the cursor, clear screen etc.

void cls(void) {
     (void) _swix(OS_WriteI + 12, 0);
}

The result is far from pretty but it will do for v1:

aclock-riscosSome funnies, which actually weren’t that funny at the time:

A directory separator in RISC OS is “.” (yes a dot) for example: root.folder.subfolder.file. The C compiler expects .c as a file extension as it would on any normal OS. The problem is that naming file aclock.c would make a directory aclock with c file in it. Fortunately, or maybe not, extensions in RISC OS are prefixing, not postfixing a file. So you have c.aclock or o.aclock. Except, as previously explained c and o are directories. You can see c and o folders in the screenshot above. Are you confused yet?

Interestingly RISC OS does have concept of a command line interface and a terminal window. However try to figure out the commands!

  • dir – change directory aka “cd” on the planet Earth
  • cat – list directory aka “ls” or “dir” in your normal OS

riscos-cmdThere is more, so I encourage you to try yourself just for the fun!