Thursday, 12 May 2022

RedHat Linux 5.2 (Apollo) on PCem Pentium 75

RedHat Linux

Initially established back in 1994, Red Hat (Wikipedia) is a commercial Linux vendor known for the RedHat Linux, Red Hat Enterprise Linux and Fedora Linux distributions.

RedHat Linux 5.2 was released in 1998, and supported i386 through early Pentium II systems. So it is suitable for comparing our physical system (tilia) and the PCem emulated equivalent.

PCem

The IBM PC and compatibles emulator PCem supports a range of PC system, from the original Intel 8088 based IBM PC through to a early 2000s slot 1 based Pentium II system. Including a couple of systems featuring the Intel 430fx chipset, making them equivalent to our reference physical system.

The target hardware for emulation is:

MainboardIntel Advanced/ZP (Zappa); Intel Triton 82430FX PCIset aka. 430FX
CPUIntel Pentium 75
RAM72 MiB (128 MiB max.)
Floppy3.5" 2.88MB
StorageIDE Controller Intel 82371FB aka. PIIX, ATA-2 16 MB/s
IDE hard disk 2048 GB
ATAPI CD-ROM drive
VideoS3 Trio64 based VGA
Network10Mb/s ethernet ISA

PCem Installation & Configuration

Since we have the PCem installation from the Slackware 3.0 on PCem Pentium 75 refer to that post of details of the installation of PCem and the configuration of the emulated machine.

For this emulation the only differences are the name given to the configuration ("RedHat Linux 5 i430fx Pentium 75") and the file name used for the hard disk image (RedHat52-i430fx-P5.img).

RedHat Linux 5.2 Installation

  1. Fetch the RedHat Linux 5.2 CD-ROM image from Archive.org (https://archive.org/details/red-hat-linux-5.2), for installation we only need CD 1, the second CD contains sources for the packages on CD 1.
  2. Unlike the previous Slackware 3.0 CD, the RedHat Linux 5.2 CD is bootable and will boot our machine once the option is enabled in the BIOS.
  3. So back to PCem...
    1. Start/load the machine we created
    2. Use the "CD-ROM">"Image..." menu to insert the CD-ROM ISO
    3. When first booted the machine will stop for the BIOS settings to be confirmed. Most of the settings will be fine, but the BIOS needs to be told about the floppy drive being 2.88MB and that we want the CD-ROM to be a boot device.
  4. The RedHat Linux installer is pretty good, so just follow the prompts.
    1. The mouse is a "Mouse Systems (serial)"
    2. For the LAN configuration use "NE2000 and compatible", specifcy the module parameters io=0x300 and irq=10. For SLiRP networking set the TCP/IP configuration to DHCP.
    3. Remember to "Empty" the CD-ROM drive when the installer reboots the system.
  5. Once logged in:
    1. add a regular user account (adduser <userName> ; passwd <userName>)
    2. if DNS is not working, add your network DNS to /etc/resolv.conf as a nameserver
    3. the X server was configured during installation, if you need to reconfigure use Xconfigurator
    4. If the configured name server doesn't work. Try adding the your network DNS address to /etc/resolv.conf as another nameserver

System Information - RedHat Linux 5.2 (Apollo)

So what does RedHat Linux 5.2 (Apollo) for x86 say about this system...

uname

Operating system release information:

$ uname -a
Linux p-rh52.home 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i586 unknown

A "Linux" kernel, on a node named "p-rh52.home", kernel release "2.0.36", version "#1 Tue Oct 13 22:17:11 EDT 1998", on a "i586" machine, processor "unknown"

/proc/cpuinfo

Processor information:

$ cat /proc/cpuinfo
processor	: 0
cpu		: 586
model		: Pentium 75+
vendor_id	: GenuineIntel
stepping	: 4
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: yes
fpu		: yes
fpu_exception	: no
cpuid		: yes
wp		: yes
flags		: fpu vme pse tsc msr cx8
bogomips	: 74.75

That would be a second generation Intel Pentium processor (P54C), but the BogoMips looks too high. The configuration has the CPU at 75MHz, which normally gives a BogoMips result of around 30...

The CPUID (Wikipedia) for this processor should be: family 5, model 2, with any stepping. This output has the stepping as 4.

/proc/meminfo

Memory information:

$ cat /proc/meminfo 
        total:    used:    free:  shared: buffers:  cached:
Mem:  72929280 66031616  6897664  8155136 47054848  9732096
Swap: 37122048        0 37122048
MemTotal:     71220 kB
MemFree:       6736 kB
MemShared:     7964 kB
Buffers:      45952 kB
Cached:        9504 kB
SwapTotal:    36252 kB
SwapFree:     36252 kB

So 72 MiB RAM, with about 36 MB of swap.

/proc/pci

Report PCI devices:

$ cat /proc/pci
PCI devices found:
  Bus  0, device  13, function  0:
    VGA compatible controller: S3 Inc. Trio32/Trio64 (rev 0).
      Medium devsel.  IRQ 11.  
      Non-prefetchable 32 bit memory at 0xff000000.
  Bus  0, device   7, function  1:
    IDE interface: Intel 82371 Triton PIIX (rev 0).
      Medium devsel.  Fast back-to-back capable.  Master Capable.  Latency=66.  
      I/O at 0xffa0.
  Bus  0, device   7, function  0:
    ISA bridge: Intel 82371 Triton PIIX (rev 0).
      Medium devsel.  Fast back-to-back capable.  Master Capable.  No bursts.  
  Bus  0, device   0, function  0:
    Host bridge: Intel 82437 (rev 0).
      Medium devsel.  Master Capable.  Latency=66.  

The Linux 2.0 kernel used in RedHat Linux 5.2 pre-dates the availability of the lspci command or the /proc/bus/pci/devices file. So we're left with /proc/pci. Since the network card is on the ISA bus, we only see the mainboard chipset and the graphics card.

dmesg

System log:

$ dmesg
Memory: sized by int13 0e801h
Console: 16 point font, 400 scans
Console: colour VGA+ 80x25, 1 virtual console (max 63)
pcibios_init : BIOS32 Service Directory structure at 0x000fc9f0
pcibios_init : BIOS32 Service Directory entry at 0xfca00
pcibios_init : PCI BIOS revision 2.10 entry at 0xfca21
Probing PCI hardware.
Calibrating delay loop.. ok - 74.75 BogoMIPS
Memory: 71220k/73728k available (748k kernel code, 384k reserved, 1376k data)
Swansea University Computer Society NET3.035 for Linux 2.0
NET3: Unix domain sockets 0.13 for Linux NET3.035.
Swansea University Computer Society TCP/IP for NET3.034
IP Protocols: IGMP, ICMP, UDP, TCP
Linux IP multicast router 0.07.
VFS: Diskquotas version dquot_5.6.0 initialized

Checking 386/387 coupling... Ok, fpu using old IRQ13 error reporting
Checking 'hlt' instruction... Ok.
Intel Pentium with F0 0F bug - workaround enabled.
alias mapping IDT readonly ...  ... done
Linux version 2.0.36 (root@porky.redhat.com) (gcc version 2.7.2.3) #1 Tue Oct 13 22:17:11 EDT 1998
Starting kswapd v 1.4.2.2 
Serial driver version 4.13 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16550A
tty01 at 0x02f8 (irq = 3) is a 16550A
Real Time Clock Driver v1.09
Ramdisk driver initialized : 16 ramdisks of 4096K size
ide: i82371 PIIX (Triton) on PCI bus 0 function 57
    ide0: BM-DMA at 0xffa0-0xffa7
    ide1: BM-DMA at 0xffa8-0xffaf
hda: PCemHD, 2047MB w/256kB Cache, CHS=520/128/63
hdc: PCemCD, ATAPI CDROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
Floppy drive(s): fd0 is 2.88M
FDC 0 is a post-1991 82077
md driver 0.36.3 MAX_MD_DEV=4, MAX_REAL=8
scsi : 0 hosts.
scsi : detected total.
Partition check:
 hda: hda1 hda2 < hda5 hda6 >
VFS: Mounted root (ext2 filesystem) readonly.
Adding Swap: 36252k swap-space (priority -1)
sysctl: ip forwarding off
Swansea University Computer Society IPX 0.34 for NET3.035
IPX Portions Copyright (c) 1995 Caldera, Inc.
Appletalk 0.17 for Linux NET3.035
ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)
NE*000 ethercard probe at 0x300: ac de 48 88 bb aa
eth0: NE2000 found at 0x300, using IRQ 10.

Here we see the results of hardware detection and initalization.

Benchmark

Since we have some information from an equivalent physical system (tilia), let's see how well the emulated system matches up let's run some benchmarks...

BogoMips

The BogoMips (Wikipedia) pseudo-benchmark has a behavior where the score is related to the processor clock speed, and has an easily available collection of results from a range of systems (see BogoMips mini-Howto).

PCem system: Linux 2.0.36, RedHat Linux 5.2 (Apollo) for x86:

Calibrating delay loop.. ok - 74.75 BogoMIPS

Comparing our physical system and the emulated system:

LinuxtiliaPCem
DistributionKernelBogoMipsBogoMips
Slackware Linux 3.0Linux 1.2.1329.8074.98
RedHat Linux 5.2 (Apollo)Linux 2.0.3629.8074.75
RedHat Linux 6.2 (Zoot)Linux 2.2.1429.80?
Mandrake Linux 7.2 (Odyssey)Linux 2.2.17148.68?
RedHat Linux 7.3 (Valhalla)Linux 2.4.18148.68?

The PCem result looks to be close to the clock for the emulated processor, but for this kernel the BogoMips for an Intel Pentium should be about clock * 0.4. That is around 30.0, which matches the 29.80 results for tilia. The BogoMips result scale change in Linux 2.2.14 (which seems to have been patched out in the RedHat Linux 6.2 kernel), due to a change in CPU cache states before the BogoMips calculation, suggests a possible source of the difference. The close to clock result in PCem could be a side effect of how PCem implements processor caches.

OpenSSL

The OpenSSL library of cryptographic methods provides a means to test the performance of the methods. Using this we can get a feel for the computational performance of a system, and comparisons with real hardware and other emulations can show how well a particular emulation performs. Since we are mainly interested in old hardware, we'll test using two of the older methods: MD5 and RSA.

Note: old versions of OpenSSL are not recommended for actual use. If you want to run comparisons like this, and thus need to use an old release, see the OpenSSL site for back to 0.9.6, for even older releases back to 0.91 see http://ftp.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/cryptography/libraries/ssl/openssl/.

RedHat Linux 5.2 (Apollo) for x86, with default compile OpenSSL 0.9.2b

An OpenSSL release from early 1999 has been chosen as being contemporary with RedHat Linux 5.2, and would be representative of the time.

$ openssl version
OpenSSL 0.9.2b 22 Mar 1999

Let's seen how MD5 and RSA do:

$ /usr/local/ssl/bin/openssl speed md5 rsa
Doing md5 for 3s on 8 size blocks: 297286 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 211698 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 106666 md5's in 3.00s
Doing md5 for 3s on 1024 size blocks: 35705 md5's in 3.00s
Doing md5 for 3s on 8192 size blocks: 4949 md5's in 3.00s
Doing 512 bit private rsa's for 10s: 459 512 bit private RSA's in 10.02s
Doing 512 bit public rsa's for 10s: 4275 512 bit public RSA's in 10.00s
Doing 1024 bit private rsa's for 10s: 79 1024 bit private RSA's in 10.07s
Doing 1024 bit public rsa's for 10s: 1337 1024 bit public RSA's in 10.00s
Doing 2048 bit private rsa's for 10s: 13 2048 bit private RSA's in 10.77s
Doing 2048 bit public rsa's for 10s: 385 2048 bit public RSA's in 10.02s
Doing 4096 bit private rsa's for 10s: 2 4096 bit private RSA's in 11.54s
Doing 4096 bit public rsa's for 10s: 106 4096 bit public RSA's in 10.02s
OpenSSL 0.9.2b 22 Mar 1999
built on: Fri Apr 15 12:52:03 BST 2022
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) 
compiler: gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5                792.76k     4516.22k     9102.17k    12187.31k    13514.07k
                  sign    verify    sign/s verify/s
rsa  512 bits   0.0218s   0.0023s     45.8    427.5
rsa 1024 bits   0.1275s   0.0075s      7.8    133.7
rsa 2048 bits   0.8285s   0.0260s      1.2     38.4
rsa 4096 bits   5.7700s   0.0945s      0.2     10.6

Extracting the relevant figures for comparisons (see OpenSSL Speed Results):

  • OpenSSL speed MD5 8,192 bytes: 13,514.07k
  • OpenSSL speed RSA 4,096 bytes sign/s: 0.2
  • OpenSSL speed RSA 4,096 bytes verify/s: 10.6

So how does this compare to tilia?

OpenSSL results from tilia:

OSOpenSSL
Version
MD5
8,192 bytes
RSA
4,096 bytes
sign/s
RSA
4,096 bytes
verify/s
Linux 2.0.36
RedHat Linux 5.2
x86
0.9.2b
22 Mar 1999
12,391.77k0.211.2
Linux 2.2.14
RedHat Linux 6.2
x86
0.9.5a
1 Apr 2000
12,454.57k0.211.1
Linux 2.4.18
RedHat Linux 7.3
x86
0.9.6b [engine]
9 Jul 2001
6,075.73k0.14.5

From these results it seems the PCem system has similar performance in to the physical hardware.

For reference a full run of all the methods provided by OpenSSL 0.9.2b on this PCem system gives results (openssl speed):

OpenSSL 0.9.2b 22 Mar 1999
built on: Fri Apr 15 12:52:03 BST 2022
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) 
compiler: gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md2                 41.58k      114.39k      154.20k      168.96k      173.61k
mdc2               148.97k      157.53k      158.55k      158.72k      158.99k
md5                793.08k     4536.64k     9110.70k    12100.27k    13516.80k
hmac(md5)          321.11k     2211.63k     5965.14k    10356.39k    13194.58k
sha1               479.29k     2306.54k     4135.85k     5159.25k     5562.37k
rmd160             385.22k     1798.87k     3127.47k     3834.88k     4106.92k
rc4               6048.08k     8647.72k     9065.98k     9175.72k     9210.54k
des cbc           1412.19k     1567.59k     1586.69k     1591.30k     1594.71k
des ede3           531.94k      558.98k      562.35k      563.20k      563.37k
idea cbc           462.00k      500.01k      504.83k      505.86k      506.22k
rc2 cbc            449.87k      487.42k      491.86k      493.23k      494.25k
rc5-32/12 cbc     3513.77k     5044.07k     5234.69k     5283.16k     5300.22k
blowfish cbc      2637.06k     3206.59k     3282.52k     3302.06k     3309.57k
cast cbc          2302.11k     2724.99k     2780.25k     2793.81k     2798.93k
                  sign    verify    sign/s verify/s
rsa  512 bits   0.0218s   0.0023s     45.9    427.9
rsa 1024 bits   0.1275s   0.0075s      7.8    133.6
rsa 2048 bits   0.8285s   0.0260s      1.2     38.4
rsa 4096 bits   5.7750s   0.0945s      0.2     10.6
                  sign    verify    sign/s verify/s
dsa  512 bits   0.0230s   0.0274s     43.6     36.5
dsa 1024 bits   0.0706s   0.0888s     14.2     11.3
dsa 2048 bits   0.2421s   0.2965s      4.1      3.4

Thoughts

PCem works well for getting a reasonably close match to old hardware, the slight difference in performance is not going to be an issue in most cases.

The large difference in the BogoMips result (tilia: 29.80; PCem: 74.75) could be due to differences in processor state. In particular the effects of cache states are not handled in most emulators, and the BogoMips busy-doing-nothing method could have interactions with the dynamic recompiler used in PCem and the host CPU's instruction processing. The result coming out close to the emulated processor clock looks connected.

Further References


No comments: