How to compile Arculator for Windows

ask about 32-bit emulators like ArcEm, Red Squirrel, Arculator or RPCEmu here
timw
Posts: 26
Joined: Tue May 10, 2016 6:55 pm

How to compile Arculator for Windows

Postby timw » Thu Jan 05, 2017 12:18 am

How to compile Arculator for WIndows from sources, and run RISCiX

For those wanting to run RISCiX on Arculator, it's helpful/necessary to be able to compile Arculator from the latest sources, because the available binary is quite old and doesn't include all the most recent fixes. These steps work for me as of January 2017, tested with Windows 8.1. They also work fine with wine on Linux, apart from steps 2-3 with the MinGW installer, which didn't work for me - I copied the MinGW folder across from a Windows machine instead.

The basis of these instructions (actually most of the work) comes directly from a very helpful post from dangardner - thanks, Dan!
http://www.stardot.org.uk/forums/viewtopic.php?f=29&t=8962&start=60#p103041
I've just added a bit more clarification and some small changes to get it working for me.

Instructions

  1. Download the MinGW installer "mingw-get-setup.exe" from this link:
    https://sourceforge.net/projects/mingw/files/Installer/

  2. Run the installer. Accept the default installation directory "C:\MinGW" and and click Continue

  3. Install the minimal MinGW installation as follows:
    i) Right-click on the package "mingw32-base" and select "Mark for installation"
    ii) Click on Installation...Apply Changes and click Apply
    iii) Wait for the downloads to complete, then Close and exit the installer

  4. Install 7-zip:
    http://www.7-zip.org/

  5. Download the OpenAL devpak:
    http://netcologne.dl.sourceforge.net/project/the-agency/devpaks/OpenAL-0.099-mingw/OpenAL-0.099-mingw.DevPak

  6. Use 7-zip to open the devpak (two levels of extraction may be needed). Extract the "include" and "lib" folders into C:\MinGW (merging with the existing folders)

  7. Download allegro and zlib from these links:
    http://cdn.allegro.cc/file/library/allegro/4.4.2/allegro-4.4.2-mingw-4.5.2.zip
    http://netcologne.dl.sourceforge.net/project/mingw/MinGW/Extension/zlib/zlib-1.2.3-1-mingw32/libz-1.2.3-1-mingw32-dev.tar.gz
    http://netcologne.dl.sourceforge.net/project/mingw/MinGW/Extension/zlib/zlib-1.2.3-1-mingw32/libz-1.2.3-1-mingw32-dll-1.tar.gz

  8. Use 7-zip to extract all "bin", "include" and "lib" folders into C:\MinGW (merging with the existing folders)

  9. Rename the following files in C:\MinGW\lib:
    ALc.a -> libALc.a
    ALu.a -> libALu.a
    ALut.a -> libALut.a

  10. Download the latest arculator source as a zip file and extract it to a convenient folder (eg. Documents\Arculator). I used the sources kindly updated and made available by dgrubb:
    https://bitbucket.org/dgrubb/arculator/downloads

  11. Open the file src\Makefile.mingw in Notepad, make the following changes to the LIBS line and save the file:
    i) Replace "-lalleg44.dll" with "-lallegro-4.4.2-md"
    ii) Delete "-lstdc++"

  12. Open a command window with Windows-R and "cmd", then navigate to the extracted arculator source folder:

    Code: Select all

    cd Documents\Arculator

  13. Add MinGW to PATH:

    Code: Select all

    set path "%path%;c:\mingw\bin"

    (Or use setx for a persistent change, but you will need to open a new command window for it to take effect).

  14. Compile

    Code: Select all

    cd src
    mingw32-make -f Makefile.mingw

    (This creates the executable "Arculator.exe" in the src folder)

  15. Compile SCSI support (optional, if you want to use the RISCiX SCSI disc image)

    Code: Select all

    cd ..\podules\src\aka31
    mingw32-make -f Makefile.mingw

    (for me this gives a "recipe failed" error, but this doesn't matter, it still creates aka31.dll)

  16. Copy the following files into the podules folder (optional, as above)
    i) aka31.dll (from inside podules\src\aka31 as compiled in the previous step)
    ii) scsirom (available from http://www.stardot.org.uk/forums/download/file.php?id=14573)
    iii) scsihd4.hdf (the RISCiX SCSI disc image, as per this thread: http://www.stardot.org.uk/forums/viewtopic.php?f=29&t=8962)

  17. Copy the Arculator.exe file from src into the top level of the arculator folder (ie. up one level) and install the RISC OS 3 ROM in roms\riscos3

  18. Copy the following files into the top level of the arculator folder (or into C:\Windows\System32 if you prefer)
    i) allegro-4.4.2-md.dll (from C:\MinGW\bin)
    ii) libgcc_s_dw2-1.dll (from C:\MinGW\bin)
    iii) libz-1.dll (from C:\MinGW\bin)
    iv) OpenAL32.dll (from C:\MinGW\lib)

  19. Run Arculator.exe and choose the following settings from the menu:
    i) Video...Borders...No borders
    ii) Machine...Configure...Preset - choose Archimedes 540

  20. You should now get to the desktop. Press F12 and from the command prompt:

    Code: Select all

    *configure monitortype 4
    *co. wimpmode 31
    *co. floppies 1
    *co. harddiscs 0

    and File...Reset. The monitor/mode changes are optional but look better than interlaced mode 12.

  21. Exit arculator and restart it. Press F12 and check that "SCSI expansion card" is present (optional, if you are using the SCSI image):

    Code: Select all

    *podules
    *co. scsifsdiscs 1

    and File...Reset

  22. Now you should be able to open the SCSI filer window and run RISCiX from the SCSI disc image. (You will need to change the CMOS device defaults to "sd000" from the RISCiX Boot menu, otherwise you will get a "failed to open object" error).
    window.png

  23. Next, you can optionally set up an ST506 disc image as per my previous thread:
    http://www.stardot.org.uk/forums/viewtopic.php?f=29&t=11154

Good luck!

Tim
Last edited by timw on Fri Jan 06, 2017 5:22 pm, edited 1 time in total.

User avatar
pollito
Posts: 39
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: How to compile Arculator for Windows

Postby pollito » Fri Jan 06, 2017 3:46 pm

Hi Tim,

First of all thank you so much for this. I've been trying to do this for a long time! :D :D :D

Just a couple of observations though:

In step 6 you have to first extract OpenAL-0.099-mingw from OpenAL-0.099-mingw.DevPak using 7-Zip and then Open the extracted OpenAL-0.099-mingw in the 7-Zip File Manager (otherwise you just see a OpenAL-0.099-mingw file).

In step 13 when you run the setx command it makes it permanent for subsequent sessions (not the current Command Prompt session) so you have to run set path %path%;c:\mingw\bin too or close the Command Prompt and open a new one. Otherwise Windows can't find the make command.

In step 20 after the *configure monitortype 4 you can't do a *co. wimpmode 31 until you have rebooted or you get a Bad configuration option error.

Otherwise it compiles fine.

Thanks again,

EDIT: I had scsirom in the wrong folder. SCSI is now running fine.
pollito

timw
Posts: 26
Joined: Tue May 10, 2016 6:55 pm

Re: How to compile Arculator for Windows

Postby timw » Fri Jan 06, 2017 5:36 pm

Hi Pollito,

Thanks for the feedback, I've updated the post to note the devpack extraction and to use set instead of setx, as these are both useful hints!

Interestingly, I don't seem to get the error in configuring mode 31 (with RISC OS 3.11), even when the current monitortype is 0. Mode 31 isn't available on machines with an 8MHz MEMC (pre-A540) or with RISC OS 2.00, but I don't know how the logic works in generating the error message.

For the SCSI podule, are you sure you have the scsirom file in the podules folder? I get the same output as you (blank entry for podule 2) if I have aka31.dll present, but not scsirom. The md5sum for my scsirom is 85f3d8ca716d6612e831cbc5d1e36aa8.

Tim

User avatar
pollito
Posts: 39
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: How to compile Arculator for Windows

Postby pollito » Fri Jan 06, 2017 8:37 pm

Hi Tim,

Many thanks for your reply. Interestingly enough, I didn't have to reboot after setting the monitor type on my machine at home, it was only when I was playing around on my work PC. It could be that I was using a different RISC OS ROM, or that it had something to do with me multitasking with the work I was supposed to be doing. :wink:

I have successfully managed to get the RISC iX image to boot, however I don't think it can see the ST506 as trying a mkfs gives me /dev/rst0a: cannot create (despite /dev/rst0a existing). I tried to patch RISCiXFS with PatchRiXFS but every time I do I get the error: Handle is either illegal or has been closed. - this also happens if I copy both files to a new location and try the patching there. PatchRiXFS is set to type FFB.

Am I doing something incredibly stupid? :P
pollito

timw
Posts: 26
Joined: Tue May 10, 2016 6:55 pm

Re: How to compile Arculator for Windows

Postby timw » Fri Jan 06, 2017 11:28 pm

No, you're almost there!

When RISC iX boots, if the ST506 controller is enabled you should see the following text displayed in the first few lines:

Code: Select all

st[0-1]: internal controller

If you don't, it was disabled by the RISCiXFS module to save a bit of memory (which it does based on RISC OS version and machine type), so the patching of the module didn't work.

The PatchRiXFS BASIC program isn't very clever and expects to find the module in the current directory (and the handle..illegal error means it couldn't find it). The easiest way to run it is to put PatchRiXFS inside !RISCiX (on the SCSI drive) and then run it from the command line:

Code: Select all

*scsi
*dir
*dir !riscix
*patchrixfs

You may then run into a problem with RISC iX stuck in an infinite loop with a spurious interrupt message, which I think is an Arculator bug, but at least shows that the ST506 controller is enabled. You then need to recompile Arculator with a modification to ioc.c (a quick hack to the current version that as a side effect will prevent the floppy drive from working properly). In the function ioc_updateirqs(), comment out the code that sets/unsets the disc change flag:

Code: Select all

#if 0
        if (!fdctype || romset<2)
        {
                if (discchange[curdrive])
                {
                        ioc.irqb |= IOC_IRQB_DISC_CHANGED;
//                        if (ioc.mskb&0x10) rpclog("Disc change interrupt\n");
                }
                else                     
                        ioc.irqb &= ~IOC_IRQB_DISC_CHANGED;
        }
#endif

Before recompiling Arculator you can rename the existing Arculator.exe so that you keep two versions, one with and one without the patch to the interrupt code, that otherwise share all the same setup (and running only one at a time!)

User avatar
pollito
Posts: 39
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: How to compile Arculator for Windows

Postby pollito » Sun Jan 08, 2017 8:19 am

Hi Tim!

Re: the patch - I thought that running a program by double clicking it would automatically change the working directory to that location. Whoops! I'm still learning when it comes to RISC OS. :)

Thank you so much, it all worked fine and I now have RISC iX on an ST506 image ready to transplant to my Pi! :D :D :D

One more thing (if you have any ideas). I was trying to do what you suggest at the end of your tutorial on RISC iX on ST506 - creating a second ST506 image and moving usr and home onto it, but I noticed two things:

First of all, creating HardImage2 and *configuring two harddiscs in RISC OS causes Arculator to see HardImage2 as drive 4 and HardImage1 as drive 5 which is seems a little counter intuitive and meant I had to swap the filenames around (no big deal, just a little strange and worth noting).

Secondly, do you have any idea how to format the second disc? HFORM-iX insists on creating a FileCore partition and assigning a name to the RISC iX partition. Do you know if there is any way to do the whole process of partitioning and formatting the second disc from within RISC iX?

Thanks again for all of this. I'm really enjoying playing around with RISC iX. :D
pollito

timw
Posts: 26
Joined: Tue May 10, 2016 6:55 pm

Re: How to compile Arculator for Windows

Postby timw » Sun Jan 08, 2017 9:39 pm

Hi Pollito,

Yes, it's quite fun to play with!

I think (though I could be wrong) that it's necessary to have a Filecore partition on each disc, because this contains the offset to the RISC iX section, which is read by RISCiXFS on the RISC OS side, and then passed to the RISC iX kernel. Also, without it, RISC OS would complain about the drive not being formatted. If there is a way to partition a whole ST506 disc from inside RISC iX, I don't know it!

You can use HFORM-iX to create a very small RISC OS partition, and the names of the RISC iX partitions can be changed - Root and Swap are just the suggested defaults for the first two (and I don't think the names are used, anyway). I used the following settings for my second ST506 disc:
form.png

The idea was to have a 16MB additional swap partition (4MB swap doesn't last long in X), then partitions for /usr/lib and /usr/share, whilst keeping >800kB for the ADFS partition. Before making the filesystems in RISC iX, I had to create the special files in /dev - the minor numbers are 0-7 for the partitions on st0, and 8-15 on st1:

Code: Select all

mknod /dev/st1S b 8 8
mknod /dev/st1b b 8 9
mknod /dev/st1c b 8 10
mknod /dev/rst1S c 18 8
mknod /dev/rst1b c 18 9
mknod /dev/rst1c c 18 10

Then you just need to edit /etc/fstab to add your new partitions, and hey presto, oodles of swap and loads of free space:
xterm.png

There doesn't seem to be any way to change the default (permanent) swap partition when booting with !RISCiX, though it can be specified on boot from the command line (see *help riscixfs).

User avatar
pollito
Posts: 39
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: How to compile Arculator for Windows

Postby pollito » Mon Jan 16, 2017 9:32 pm

Hi Tim,

Sorry for the long delay in my reply, I've been very busy with work and trying to sort out things around the flat.

I am a little confused by your HFORM-iX screenshot as you first specify a 16MB swap partition and then specify it again as partition 0 (which usually defaults to Root). Is this intentional?

ArcEm runs far more smoothly on RISC OS than Arculator does on Windows despite the fact it doesn't seem to be as user friendly. I will continue to play and let you know the result. :)

Thanks once again!
pollito

timw
Posts: 26
Joined: Tue May 10, 2016 6:55 pm

Re: How to compile Arculator for Windows

Postby timw » Sun Jan 22, 2017 5:19 pm

When HFORM-iX asks for the desired swap partition size, this is only to calculate a suitable number of cylinders to show as the default for defining the second partition (which would normally be swap on a standard installation with one disc). You're free to change the actual allocation to whatever you like, independent of what you entered for the "desired size" (and of course if it's the second disc then you don't need any swap at all).

By the way, I've also noticed some oddities in the way Arculator behaves with two ST506 disc images. HardImage1 seems to work as ADFS::4 for me, with HardImage2 as ADFS::5, but if I use OS_GBPB in RISC OS to write data to drive 4, it ends up getting written to HardImage2 (and hence corrupting it). Also, if I save a file (eg. from !Zap) on to drive 4 when only one disc is configured, nothing is actually written. But reading from ADFS::4 and ADFS::5 works as expected. I haven't investigated what's going on here!

User avatar
pollito
Posts: 39
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: How to compile Arculator for Windows

Postby pollito » Sun Jan 22, 2017 8:10 pm

Interesting! Can you reproduce that on ArcEm too?

It may not be relevant but I noticed that both Arculator and RPCEmu on Windows try to write to their data to their respective Program Files folders, which causes the creation of a lovely VirtualStore folder in your Windows profile. When I had strange behaviour with Arculator seeing the wrong image as HardDisk1 before, I cleared out its VirtualStore shadow folder and started again.

I don't have access to my Pi at the moment (where I have been playing with ArcEm and RISC iX) but there are a few things I want to test. I followed your instructions for creating the second disc image, partitioning it and created the devices. However I then attempted to mount the new partitions so I could copy /usr/lib and /usr/share to them but they wouldn't mount. That was around 3am one morning before a long day at work though, so I need to try again with a clear head! The FileCore partition was definitely showing up in RISC OS.

Once I've got the second disc set up I want to start creating some users to play around with.

What would be awesome (although probably a pipe dream) is networking support under ArcEm / RISC OS Pi. I set up Ultrix and VMS under simh (VAX) on NetBSD with full networking. It was great to telnet into what might as well have been a vintage computer. :)
pollito


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 1 guest