Linux Tor Relay on Pentium 75

For a long time I’ve been toying with the idea of running a TOR relay for my own privacy reasons and to give back to the community as well. Though my router and NAS (and possibly even my WD Live box) have enough chutzpah to run it, I prefer to use a very old computer instead for reasons of separation (security). For a while, I even considered buying a Raspberry Pi or some other similar cheap gizmo, then I remember I have a bunch of old computers I've never used..

My very first “computer” was a Sinclair ZX Spectrum back in the 90s, and that little fellow hummed along nicely on only 64K of RAM (that is Kilobytes!!). I played on it the very first RTS game (‘87), Nether Earth, now ported on Windows, MacOSX, LinuxRPM, Ubuntu and even iPhone and also on Android in 3D under the name Battlefield Moon. You can also play it on many other platforms via a Speccy emulator (I had good results with ZX 32) and downloading the original NetherEarth image from World of Spectrum. There is even a demented version II and not long ago Doom was ported to a 128K Speccy :)

Perhaps that early formative experience caused me to be a miser when it comes to investing in the bloated hardware of today. OTOH, I don’t always have the time to fiddle, which is why I’ll be using this article as a repository of info re: all my old computers. I’ve accumulated quite a few old computers and have yet to throw them away.
  1. Pentium 75 MHZ Phoenix BIOS bootupMy very first Intel computer was a 486-DX-33 in a desktop case (not pictured here). I think it still has about 16MB of RAM, 8 ISA slots, two large expansion bays, one floppy and one internal HD. In the ISA slots some serial and parallel connectors, a 3com Ethernet card, a Creative SB Live! combination soundcard + SCSI with a SCSI CD-ROM drive, a VLB video card and what seems to be a newer SCSI VLB card. Though this one begs for a Linux install, it probably still has Windows 3.11 for Workgroups; I haven’t touched it in a long time nor do I plan to use it right now; maybe later or never. I’m curious if it has enough RAM to run a firewall distro such as IPCop.
  2. My second computer was an AMD Am486-DX4S-120MHZ (K4?) and it has 64MB or RAM, Award BIOS 4.51PG. This one is in a tower case with 3 external large bays and 2 external floppy-sized bays. This one could be a good candidate for m0n0wall (based on FreeBSD).
  3. My 3rd computer was a Pentium II 333MHz. I stopped using it a while back when I fried the power supply. I might look into it soon to see if I can revive it with a spare power supply and use it as a FreeNAS with UFS.
  4. A computer I salvaged from a friend who was going to throw it away is a Compaq Presario 2200 with a Cyrix processor. Small, black and with speakers in the case, this could’ve been a perfect network MP3/Shoutcast player. I got a Xircom PE3 parallel to Ethernet adapter back when I got it but could not get it to work. Without networking it’s useless as a Linux server – better off using it with its installed Windows 98SE and modem. The case is too small to fit a regular ISA card instead of the modem. With its 56K modem, it was pretty good for someone older who first tried the Internet and still had a regular phone line, but then she did something and now it would not boot up.
  5. Another computer I’ve never really used is an NEC “Ready 7020” – much heavier case than anything else. It has 2 double sided RAM banks and 2 single sided for a total of 26 or 28 MB. On-board CL-GD5434 video is brilliant at 1152x864x16-bit color. 2 PCI and 4 ISA slots on transverse `riser' accessible through a hatch on the bottom of the case. The ‘riser’ is also a sound / fax / modem / CD connector / COM ports card. I haven't looked at the mobo much except to determine that all capacitors are fine, but the chips on the combo card may help in installing the proper .o module. The Cirrus Logic chips (CL-MD1214-11QC-D 43225-592DD 9519N JAPAN-N, CL-MD2614-20QC-E 43391-435CE 9519B JAPAN-N and MD1724-11VC-D 95155-234AB-9517 B) are mostly related to the CD-ROM connectors, the Yamaha OPL YMF262-H 9510 FTC most likely provides FM synthesis on the Sound Card (or is the SC) and the OPTI 82C929A Taiwan 9515NE, the mysterious ST HP94D9514 M628032-2CEI or CRYSTAL CS4231A-KL CKARYE9520 - not sure.

I bet that even if I were to list them on Craigslist or Kijiji for free pickup still nobody would show up :)

I decided to try my luck with #5, the Pentium 75MHz (PDF) as it will probably be the easiest to play with and being so low-powered its power consumption is most likely negligible.

Here’s a Whetstone benchmark from Thandor:

Whetstone Benchmark of old computers

This Pentium is significantly better than the AM486-DX4/120, and even the Dhrystone (integer only) shows a slight advantage for the Pentium. Moving forward, I might decide to swap the double-sided RAM banks between the AMD and the Pentium, giving the Pentium a likely 72MB of RAM (up from its current 24) but that is not the priority.

WinDos

If I remember correctly, this computer had 2 HDs, one fixed inside as the boot drive and another one in a removable tray. When trying to start it I wasn’t sure which PS/2 jack was for the keyboard and as I impatiently plugged it / unplugged it I seem to have fried some keyboard circuitry inside. Not a show stopper since I was planning on SSHd-ing into this box anyway; I just connected the HD to another computer that did not have this issue. With the second hard drive removed, Windows fails to start, suggesting that I had moved the Windows directory on the second drive. Further investigation reveals that Windows had been installed on top of DOS 6, which means that pressing F8 at boot (if a keyboard could work) would present as last option “Previous DOS” or something like that. DOS was configured to load a driver for the 3Com ISA card, get an IP lease and run the Arachne browser (video).

Let’s look at the WinDOS startup files.

Autoexec.dos:

@ECHO OFF
PROMPT $p$g
PATH c:\baslinux;C:\W\D;C:\W\ARACHNE
SET TEMP=C:\W\t
set dircmd=/p
set tmp=%temp%
LH /L:1,6384 c:\w\d\doskey.com
LH /L:1,32096 c:\w\d\MSCDEX.EXE /D:CDRM001 /V /M:8 /L:M
LH /L:0;1,45456 /S c:\w\d\smartdrv.exe
LH /L:0;1,3328 /S c:\w\utility\ctmouse.exe
REM ---------- ARACHNE PACKET DRIVER ----------
LH /L:1,7648 C:\W\ARACHNE\SYSTEM\PKTDRVRS\3C509 0x60
REM ---------- END OF ARACHNE CHANGES ---------

Config.dos:

device=c:\w\d\smartdrv.exe /double_buffer
DEVICE=C:\W\D\HIMEM.SYS /testmem:off
DEVICE=C:\W\D\EMM386.EXE NOEMS
BUFFERS=15,0
FILES=50
DOS=UMB
LASTDRIVE=Z
FCBS=4,0
DEVICEHIGH /L:1,12048 =C:\W\D\SETVER.EXE
DOS=HIGH
SHELL=C:\W\D\COMMAND.COM C:\W\D\  /p
DEVICEHIGH /L:1,27648 =C:\W\SBCD\SBIDE.SYS /D:CDRM001 /P:1F0,14 /V

rem ----------------SYMBIOS installed drivers----------
rem DEVICE=c:\w\symbios\aspi8xx.sys
rem DEVICE=c:\w\symbios\symcd.sys /D:CDRM001
rem ------------end SYMBIOS changes--------------------

Autoexec.w98:

@ECHO OFF
PROMPT $p$g
PATH D:\WIN98SE;D:\WIN98SE\COMMAND;C:\W\D;C:\W\ARACHNE
SET TEMP=C:\W\t
set dircmd=/p
set tmp=%temp%
D:\WIN98SE\COMMAND\MSCDEX.EXE /D:CDRM001 /V /M:8 /L:M

Config.w98

DEVICE=D:\WIN98SE\HIMEM.SYS /testmem:off
DEVICE=D:\WIN98SE\EMM386.EXE NOEMS
FILES=50
DOS=UMB
DEVICE=D:\WIN98SE\setver.exe
DOS=HIGH

The 800MB bootup drive has two partitions: DOS and Linux. I might later on decide, if need be, to blow up the DOS partition and make it swap, which is why I’ve listing the config files here.

linux

As far as linux distributions for old computers go, when it comes to low RAM situations, 3 distributions keep getting mentioned: Damn Small Linux (DSL), Tiny core linux (TC), Basic Linux, Mepis and Puppy Linux. Of all these, Basic Linux seems to have the lowest requirements: a 386 with 3MB of RAM from a DOS drive.

In INSTALL.TXT from Slackware 4 on which Basic Linux is based hardware requirements, examples and suggestions are discussed.

Any ISA, EISA or VESA Local Bus 80386 or 80486 system will do.
Currently, the MicroChannel (MCA) architecture (found on IBM PS/2 machines) is not supported.  Any CPU from the 386SX to the 486DX2 will work. You do not need a math coprocessor, although it is nice to have one.

You need at least 4 megabytes of memory in your machine. Technically, Linux will run with only 2 megs, but most installations and software require 4. The more memory you have, the happier you'll be. I suggest 8 or 16 megabytes if you're planning to use X-Windows.

Of course, you'll need a hard drive and an AT-standard drive controller. All MFM, RLL, and IDE drives and controllers should work. Many SCSI drives and adaptors are supported as well; the Linux SCSI-HOWTO contains more information on SCSI.

Linux can actually run on a single 5.25" HD floppy, but that's only useful for installation and maintenance.

Free space on your hard drive is needed as well. The amount of space needed depends on how much software you plan to install. Most installations require somewhere in the ballpark of 40 to 80 megs. This includes space for the software, swap space (used as virtual RAM on your machine), and free space for users, and so on.

It's conceivable that you could run a minimal Linux system in 20 megs or less, and it's conceivable that you could use well over 200 megs or more for all of your Linux software. The amount varies greatly depending on the amount of software you install and how much space you require. More about this later.

Linux will co-exist with other operating systems, such as MS-DOS, Microsoft Windows, or OS/2, on your hard drive. (In fact you can even access MS-DOS files and run some MS-DOS programs from Linux.) In other words, when partitioning your drive for Linux, MS-DOS or OS/2 live on their own partitions, and Linux exists on its own. We'll go into more detail later.

You also need a Hercules, CGA, EGA, VGA, or Super VGA video card and monitor. In general, if your video card and monitor work under MS-DOS then it should work under Linux. However, if you wish to run X Windows, there are other restrictions on the supported video hardware. The Linux XFree86-HOWTO contains more information about running X and its requirements.

In all, the minimal setup for Linux is not much more than is required for most MS-DOS or MS Windows systems sold today. If you have a 386 or 486 with at least 4 megs of RAM, then you'll be happy running Linux. Linux does not require huge amounts of diskspace, memory, or processor
speed. I (used to) run Linux on a 386/16 MHz (the slowest machine you can get) with 4 megs of RAM, and was quite happy. The more you want to do, the more memory (and faster processor) you'll need. In my experience a 486 with 16 megabytes of RAM running Linux outdoes several models of workstation.

Alternatively, one could also try to “trick” Ubuntu into installing on a low memory machine such as mine. However, as far as I can remember apt-get alone needs more RAM to run than this machine has and that package manager is one of the main reasons to try Ubuntu / Debian. I doubt I could get my RAM that high. Furthermore, a CLI system needs 450MB, which is probably a bit more than the current EXT2 partition can offer. Using a MinimalCD or Alternate CD one must go through the onerous task of blacklisting modules in /etc/default/linux-restricted-modules-common with DISABLED_MODULES="ath_hal fc fglrx fwlanusb ltm nv". The page linked above offers the following tips as well:

  1. if you do not use hibernation, comment or delete /etc/initramfs-tools/conf.d/resume then execute sudo update-initramfs -u
  2. if you do not have a laptop, you may consider removing acpi and acpid by executing sudo apt-get remove acpi acpid
  3. if you do not need extra languages you may consider removing language-pack-en and language-pack-en-base

Lubuntu is Ubuntu with a very lightweight windows manager.

It might be possible to use a beefier computer to install one of the above distros on the hard drive (to get around installer memory requirements), strip it down then reattach the hard drive to the old computer. This is how I installed Basic Linux on my old Pentium 75 - not because of memory issues, only because of the misbehaving keyboard.

install

Since I already had DOS up and running, I decided to use it for the install. I downloaded bl3-50.zip and expanded it in C:/baslin. I have found a howto page at logicassembly which I adapted below, as that used floppies, which I did not want to bother with. If you need to partition your drive, you will need to boot from the floppy and use fdisk to create partitions. If, however, your drive is already partitioned (i.e., my situation) you do not need to touch floppies.

Let’s start by quoting for the DOS-challenged.

If you don't know how to install DOS, or need a refresher course, follow these steps:

  • find that old dusty DOS floppy disk, or use that Windows 98 EBD ("Emergency Boot Disk") feature to create a boot disk for you
  • put the boot disk in your floppy drive and reboot (you're running on an older machine that has a floppy drive, right?)
  • after booting, run fdisk.exe and delete all the partitions on your hard drive (you did back-up anything of importance on this machine?)
  • in fdisk, create a primary bootable 100MB partition and exit
  • reboot the machine, again with your DOS boot disk
  • your single 100MB partition will be drive C:, so run the following command:
     format c: /s
  • after the format is complete run the following commands:
    c:
    mkdir dos
    cd \dos
    copy a:\*.*

Now your computer will boot DOS without a floppy disk and you have the basic DOS files on your hard drive.

Once I exploded the archive downloaded above to c:/baslin, I changed to that directory then simply issued the command “boot”. Once in Linux, I mounted the Linux partition to /hd then installed:

mkdir /hd
mount -t ext2 /dev/hda2 /hd
install-to-hd

After the install completed, I issued “reboot” to reboot in DOS, then issued “hd” in the baslin directory to load Basic Linux from the /dev/hda2 partition. First, I mounted the DOS partition with mount –t msdos /dev/hda1 /mnt/windos (after mkdir /mnt/windos) and modified fstab (edit /etc/fstab) to mount it automatically by adding the line /dev/hda1   /mnt/windos msdos defaults (this could probably also be accomplished with echo “/dev/hda1   /mnt/windos msdos defaults“ >>/etc/fstab).

I now have a very basic Linux install which can be expanded by adding Slackware 4 packages. This can be accomplished by locating an online Slackware 4 archive, such as Utah dot edu. You can search for your .tgz packages in the FileList or directly for packages, in your browser, with Ctrl+F. If you’re not in North America, have a look at the Mirrors list and if you have questions try the FAQ. There’s even a document on Low Memory Systems. Once you get the URL of the file you want from the filelist, you download it with wget http://url and install it with pkg yourpackage.tgz. You may also list the files in a package with tar tzvf yourpackage.tgz. To check dependencies, try ldd.

lilo

This old Linux boot manager allows dual boot. For some unknown reason, my install had no “/boot” directory, but a file, so I had to remove it (rm /boot) and recreate the /boot directory with mkdir boot. I then copied an optimized kernel (zimage.p1 in this case) and chain.b. Next, I created the lilo configuration (edit /etc/lilo.conf) where I pasted the following:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
compact
prompt
timeout=100
image=/boot/zimage.p1
     label=Basic_Linux
     root=/dev/hda2
     read-write
other=/dev/hda1
     label=Win_DOS

For some reason, lilo had not been installed either, so I grabbed lilo.tgz and installed it with pkg lilo.tgz. Finally, I can fully install linux dual boot with lilo –v. Removing all floppies or CD-ROMs and issuing reboot will cause the system to restart with a “lilo:” prompt for 10seconds, after which Basic Linux is loaded by default. You can go straight to Linux by pressing <Enter> or hit TAB to see all your options (Win_DOS) is my other one, but you can change that by changing the label= above. In my case, I won’t be changing much to linux or anything else as my keyboard circuitry on the motherboard is fried.

At this point I could modify or get rid of the instructions & tips screen that is displayed after boot-up by issuing edit /etc/issue but since I won’t be logging in from the console I don’t need to do that.

network

Though this computer can run without a keyboard, the Ethernet (network) card must be installed and configured. To identify the module that needs to be loaded I looked at my card, then tried to find what seemed to match on the list of modules. Since I was getting this to work on a computer that did not have ISA slots like my target machine, I could not test it if it worked, but luckily, the name of the card was quite specific. I copied the .o module to the hard-drive and off I went.

If you’re not this lucky, you might have to follow L.Savage’s instructions.

Download the module file (e.g. tulip.o) and save it to floppy disk. Insert this disk into your Basic Linux machine and execute the following commands replacing module with the module you are using:

  • mount /fd
  • cp /fd/module.o /lib/modules/2.2.26/misc
  • insmod module

If you see output such as that below, then this driver is not a suitable match for your network card hardware and you need to try a different one:

  • Using /lib/modules/2.2.26/misc/3c59x.o
  • insmod: init_module: 3c59x: Device or resource busy

If on the other hand, if you see output like that below, then proceed on to the next step:

  • Using /lib/modules/2.2.26/misc/3c59x.o
  • 3c59x.c 18Feb01 Donald Becker and others http://www.scyld.com/network/vortex.html
  • eth0: 3Com 3c900 Boomerang 10Mbps Combo at 0x6200,  00:10:4b:95:19:cf, IRQ 11
       8K word-wide RAM 3:5 Rx:Tx split, autoselect/10baseT interface
       Enabling bus-master transmits and whole-fram receives.

If you end up trying many modules, it may be easier to download and copy all the modules to floppy disks (all 82 modules fit on 2 floppy disks by the way) and copying them into the "/lib/modules/2.2.26/misc" directory all at once. Then you can simply issue the "insmod" commands in succession until you get one that works. Don't forget to remount the floppy drive each time you swap disks!

With the correct .o file, issue edit /etc/rc, locate the “activate ethernet” section and edit as follows, replacing <module.o> with yours:

###_ACTIVATE ETHERNET_###
insmod <module.o>
ifconfig eth0 192.168.1.100
route add default gw 192.168.1.1

Instead of the last two lines, which configure your networking with a fixed address, you might want to use udhcpc, which will get an IP lease from a DHCP server on your network (usually your router). This command will however load that client in the memory, which may be something that you would rather avoid.

SSHd

This machine boots root without any password prompt and that is fine, except that before installing SSH we need to have a the user login module. Such basic add-ons must be downloaded and then installed with pkg. After first installing passwd.tgz, I issued the command passwd to set the password for root to something hard for others to guess but easy for me to remember. Rebooting (with reboot) I was prompted to login.

I am now able to install sshd, modify /usr/local/etc/sshd_config for better security (if not using Pubkey Authentication at least change the default port and force Protocol 2), add /usr/local/sbin/sshd to /etc/rc,  move the HD to the target computer, start it up and SSH into it from my regular workstation.

There may be one more thing to do before moving the hard drive: make sure that the sftp server and/or the smbclient work so that files can be easily moved back and forth on this machine. I chose to install the smbclien.tgz package which I use with smbclient //machine/volume –U username. When launched it behaves like an FTP client of yore (cd, lcd, put, get). I also set up a bunch of aliases which I place in the /root/.profile, where I also commented out the netstart script which is now unnecessary, as it duplicated /etc/rc. The computer Ubuntu and even boots rather slowly.

adlib

This computer has also a huge sound (soundcore+sound+uart401 and then adlib, gus, i810, mad16, maestro, maui, mpu401, sb, etc)/ fax / modem card that also has some specialised CD-ROM connectors and a CD-ROM drive (cdrom.o and sbpcd.o for Matshita CR-585) which I haven’t bothered to configure – in fact, I will probably pull them out as they are not necessary. OTOH, later on I might want to add a pair of speakers and play some music in the garage, where this is going.

The soundcard can hopefully be identified by inspection. If it is a SoundBlaster, one can follow the BL3 instructions:

    insmod soundcore
    insmod sound
    insmod uart401
    insmod sb io=0x220 irq=5 dma=1 dma16=0 mpu_io=0x330

You can test if it works with either mpg123.tgz or the much better mplayer (classrad, mplay, us, eur, mp3blaster, mplayer4, ogg).

  • diagnose.exe - Creative Labs SB16 diagnosis program for DOS which can be used to determine settings for sb16 ISA cards in linux. These cards do not seem to need initialization by isapnp or even DOS diagnose. hwinfo also provides irq and dma information (as do some bioses). Typical settings for SB16 plugnplay cards are io=0x220 (or 240 260 280) irq=5 (or 7, 10) dma=1 (or 0, 3, 5) and if you are getting IRQ/DRQ errors trying to play mp3 files dma16=5 (or 6, 7 or the same as low DMA).
  •  s64basic.exe (run and install) comes with ctcmbbs.exe which produces ctcu.exe and ctcm.exe, ISA configuration utility and manager, that you can use to initialize pnp SB cards in DOS. You don't need to do this except to play midis with AWE and possibly with FM synthesis.
  • 2.2.16 sound kernels

Gateway between two laptops:

> - ifconfig eth0 192.168.1.1 on GW machine
> - ifconfig eth0 192.168.1.2 on client machine
> - route add default gw 192.168.1.1 on client machine
>
activate IP forwarding on the GW machine:
-----------------------------------
echo "1" > /proc/sys/net/ip_forward

Other packages supposedly working in BL are unrar, minihttpd, pure FTP server (info), SoundBlaster, timidity.

BL3 uses libc5 which was the standard shared library of the late 90s. Today’s software uses glibc2 which can be found in Slackware 9.0 in the slackware/a directory:

Other miscellaneous libraries may be found in misc-libs.tgz. They are installed, as usual, with pkg. Another library often needed is ncurses – it goes in /libs. As previously stated, additional dependencies can be checked with ldd and then found, as above, in the Slackware 9 /a or /l directories.

tor

Downloaded the latest tor tarball and exploded it:

~/tor/tor-0.2.2.39<#>ls
ChangeLog      Makefile.in    compile        contrib        orconfig.h.in
Doxyfile.in    README         config.guess   depcomp        src
INSTALL        ReleaseNotes   config.sub     doc            tor.spec
LICENSE        acinclude.m4   configure      install-sh     tor.spec.in
Makefile.am    aclocal.m4     configure.in   missing

To compile, a number of standard packages need to be installed.

Installed gcc, binutils.tgz, gmake.tgz, libc.tgz and linuxinc.tgz.

The Configure script gets stuck at libevent, which fails to install because "Fatal, Kernel too old". An older version would be too buggy (I might as well try an older tor), whereas building, compiling and installing a newer kernel or just upgrading might force reinstalling almost everything - I might as well install a newer distro. The TorProject people recommended installing Debian. Despite its "low requirements" reputation, it still requires more RAM than I have in this machine, but it might be possible to blacklist some modules and turn off daemons when using the package manager.

Stuck, so I asked a question and learned about Proteus and LFS; the latter might be just what I'm looking for. OTOH, cross-compiling might allow me to separate installation of the OS from installation of programs and is worth a look.

I have also tried Pulp based on suggestion from Sindi Keesan (k at sdf.org):

>>> Try the pulp version of puppy linux, which has a precompiled TOR.
>>> Pulp boots into 10MB memory and if you exit (or don't load) the GUI,
>>> somewhat less.  It supports much more modern software.

The interface was quite slow and had the same problem with booting, I tried Debian after finally getting keyboard access. Following the guide of installing Debian from another Linux install I got debootstrap and soon enough the error message “no pkginfo available – install perl”; after installing Perl from S4 I got:

# /usr/sbin/debootstrap --arch i386 squeeze /mnt/debinst http://ftp.ca.debian.org/debian

I: Retrieving InRelease
I: Failed to retrieve InRelease
I: Retrieving Release
W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving Packages
I: Validating Packages
E: Cannot check sha1sum

I’ll keep tryin’

Sources / More info: TorTV, How2s, rc-init, tcl/tk, bl-files, keesan, pbraun, tips, tor-cli, tor-docs, tor-linux, tor-cli-more, txz, cabext, kbdrv, deb2tgz, src2pkg, SlackBuilds, sb-tor-0.1.2.14-11, sb-tor-0.2.2.37-14, tor-wikipedia, tor-amazon, wh-tor-setup, rbox-tor, uptime+Sheeva

blog comments powered by Disqus
Your gift enables us to continue to provide high quality reporting without advertising.