Austin Robertson

musings and thoughts from yours truly

Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the new 64-bit z/Architecture. Hercules runs under Linux, Windows (98, NT, 2000, and XP), Solaris, FreeBSD, Mac OS X (10.3 and later).

So why not turn your Raspberry Pi, the $35 ARM-based mini computer, into an emulated mainframe?

Load up your Rasberry Pi with the latest Debian image.

The Raspbian respository actually already has a compiled Hercules package. You can install with just a simple:

sudo apt-get install hercules x3270

This will install Hercules 3.07 from the Raspbian repository as well as a TN3270 called x3270. In the mainframe world, you’ll need this type of emulator.

Now launch hercules and give it a configuration file:

hercules

That starts Hercules. Use the TN3270 emulator to access the Hercules console.

x3270 localhost:3270

And you should get a screen like this:

/=======================================================================\
|                                                                       |
| Hercules Version  : 3.07                                              |
| Host name         : raspbian                                          |
| Host OS           : DEBIAN                                            |
| Host Architecture : armv6l                                            |
| Processors        : UP                                                |
| LPAR Name         : HERCULES                                          |
| Device number     : 0010                                              |
| Subchannel        : 0004                                              |
|                                                                       |
| HHH          HHH   The S/370, ESA/390 and z/Architecture              |
| HHH          HHH                 Emulator                             |
| HHH          HHH                                                      |
| HHH          HHH  EEEE RRR   CCC U  U L    EEEE  SSS                  |
| HHHHHHHHHHHHHHHH  E    R  R C    U  U L    E    S                     |
| HHHHHHHHHHHHHHHH  EEE  RRR  C    U  U L    EEE   SS                   |
| HHHHHHHHHHHHHHHH  E    R R  C    U  U L    E       S                  |
| HHH          HHH  EEEE R  R  CCC  UU  LLLL EEEE SSS                   |
| HHH          HHH                                                      |
| HHH          HHH                                                      |
| HHH          HHH     My PC thinks it's a MAINFRAME                    |
|                                                                       |
| Copyright (c) 1999-2011 Roger Bowler, Jan Jaeger, and others          |
|                                                                       |
\=======================================================================/

TADA. Your Raspberry Pi thinks it’s a MAINFRAME.

Finch is a console-based implementation of the popular chat application Pigdin. Finch is super useful when you need a chat application but only have a terminal interface.

A Finch package is available from the Ubuntu repository with sudo apt-get install finch but sometimes you need to compile from source.

I needed to modify the way Finch displays the Away contacts in the Contact List. The character corrupts the fixed column width with Times New Roman in browser-based terminals like shellinabox. I simply changed the unicode character to a . at pidgin-2.6.10/finch/gntblist.c:937 to:

strncpy(status, ascii ? "." : ".", sizeof(status) - 1);  

But you probably just want to compile vanilla source. This is what worked for me. (Optional) Uninstall any installed versions of Finch:

sudo apt-get remove finch

First, start off by downloading the source tarball from here. Then un-tar:

tar zxvf pidgin-*.tar.gz
cd pidgin*

Next, you will need some dependencies:

sudo apt-get install intltool libglib2.0-dev libxml2-dev gettext libncurses5-dev libgnutls-dev libidn11-dev libdbus-1-dev libdbus-glib-1-dev

Now let’s configure it. We --disable-gtui because we only want to build Finch. We also disable things like sound support, video support, scripting support and Sametime protocol support. I didn’t need it. Your mileage may vary.

./configure --disable-gtkui --disable-gstreamer --disable-vv --disable-meanwhile --disable-avahi --disable-nm --disable-perl --disable-tcl

If your configure fails, you are probably missing a development library. Search for it with apt-cache search <term> and install it with apt-get install. Now grab a cup of coffee while we build:

make
sudo make install  

This will install Finch to /usr/local/bin. You may need to add this to your PATH if it’s not already there:

export PATH=$PATH:/usr/local/bin  

FIN