Friday 27 May 2022

Linux for ARM on QEMU (virt) - System Information

Linux for ARM

Processor designs from Arm Ltd. are used in a plethora of microprocessors and SoC (System on a Chip) components. Which power a wide range of devices including: smartphones, tablets, PDAs, network routers, NAS systems, set-top boxes, etc. Some (non-exhaustive) lists of devices using the ARM architecture can be found in:

The initial port of the Linux kernel to ARM began back in 1994, then targeting an Acorn A5000 running RISCOS, and grew from there through to being part of the mainline Linux kernel.

The use of ARM cores in microprocessors, microcontrollers and SoC devices, for many different vendors, meant that supporting Linux on a device would often require a specific kernel built for that specific device. This limited the availability of general purpose Linux distributions, while making vendor specific embedded Linux kernels common. Fortunately since most user-space applications use the kernel abstractions to access devices, the same user-space can be used with any kernel built for the same flavor of the architecture (see ArmPorts - Debian Wiki).

Support for a selection of ARM based systems ('arm') appeared in the Debian GNU/Linux 2.2 (`potato') release in 2000. The current Debian Linux 11 (bullseye) supports ARM through the 'armel', 'armhf' and 'arm64' (aka. 'aarch64') ports.

QEMU

The diversity of devices using the ARM processor means the QEMU system emulators for ARM provide a large number of emulated systems, with the QEMU 5.2.0 build I'm using listing 90 systems for the 64-bit system emulator (qemu-system-aarch64), and 84 for the 32-bit system emulator (qemu-system-arm). While most systems appear in the lists for both emulators (suggesting they could be implemented with 32-bit or 64-bit processor cores) a small set of systems are 64-bit only.

While most of the available systems correspond to physical hardware, the "QEMU ARM Virtual Machine" system ('virt') is a virtual system based on the use of paravirtualized devices. This provides performance improvements, particularly for I/O, and is useful for software development and testing, for cases where specific hardware features are not required.

Wednesday 25 May 2022

RedHat Linux 7.3 (Valhalla) on PCem Pentium 75

Red Hat Linux 7.3 GNOME desktop

RedHat Linux

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

RedHat Linux 7.3 (Valhalla) was released in 2002, and supported i386 through early Pentium 4 systems (the Intel Core based processors didn't ship until 2006). So it is suitable for comparing our physical Intel Pentium system (tilia) and the PCem emulated equivalent.

Earlier Releases

A couple of earlier Red Hat Linux releases are described on the same PCem system in:

It is interesting to see the evolution of the Red Hat Linux distribution over these releases.

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. This includes a couple of systems featuring the Intel 430fx chipset which makes them equivalent to our physical system.

So the target emulated hardware 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

Monday 23 May 2022

Linux for PowerPC on QEMU (g3beige) - System Information

QEMU g3beige running Debian Linux 8 with XFCE desktop

QEMU & Linux for PowerPC

A recent post (see Linux for PowerPC on QEMU (mac99) - System Information) looked at Linux on QEMU's 'mac99' machine, an emulation of an Apple PowerMac G4 (AGP Graphics). But what about QEMU's other Power Macintosh system?

QEMU

QEMU provides an emulation of the older, Apple Power Macintosh G3 ("beige").

Checking Apple Support, EveryMac.com, Wikipedia the hardware specification for the 'g3beige' would be:

SystemApple Power Macintosh G3 ("beige")
Mac FirmwareOldWorld
CPUPowerPC 750 @ 233, 266, 300, or 333 MHz; upgrade to G4 @ 350 or 400 MHz
RAM32, 64 or 128 MiB (768 MiB max.)
BusPCI
Storagebuilt-in IDE controller; 128GB max. HD
built-in SCSI controller
4GB SCSI, 2x 4GB SCSI or 8GB IDE hard disk(s)
24x ATAPI/IDE CD-ROM
Floppy3.5" 1.44MB
VideoATI 3D Rage II+, ATI 3D Rage Pro, or ATI 3D Rage Pro Turbo, 6 MiB VRAM
AudioWhisper or Wings personality card
Networkbuilt-in RTL-8029(AS) 10 Mb/s 10baseT ethernet
Keyboard & MouseADB

Third-party processor upgrades offered higher spec. G3 and G4 options. Since the emulation will determine the processor speed, we'll go with the default processor.

Emulation Command

For reference the QEMU command used:

qemu-system-ppc \
    --machine g3beige \
    -hda hda_DebianLinux_g3beige.qcow2 \
    -cdrom debian-8.11.0-powerpc-DVD-1.iso \
    -g 1024x768x8 \
    -net nic \
    -net "user,guestfwd=:10.0.2.1:22-cmd:netcat 127.0.0.1 22,hostfwd=::2222-:22" \
    -kernel vmlinux-3.16.0-6-powerpc \
    -initrd initrd.img-3.16.0-6-powerpc \
    -append 'root=/dev/sda3' \
    -name 'Debian Linux 8 (jessie) on Power Macintosh G3 (Beige)'

Note that due to issues with the boot loader, a kernel and ramdisk extracted from the installed system are used to start the system.

Saturday 21 May 2022

Mandrake Linux 7.2 (Odyssey) on PCem Pentium 75

Mandrake Linux 7.2 KDE desktop

Mandrake Linux

Initially established back in 1998, MandrakeSoft (Wikipedia) was a commercial Linux vendor known for the Mandrake Linux distribution (Wikipedia), after a merger with the Brazilian Linux distribution Conectiva and a dispute over rights to the "Mandrake" name, the company and their Linux distribution changed name from Mandrake to Mandriva.

Mandrake Linux is notable for many improvements to desktop Linux distributions, including improvements to hardware detection and handing, and the use of a graphical installation process. Mandrake was also a pioneer in optimizing their Intel x86 distribution for Pentium or higher processors.

Mandrake Linux 7.2 was released in 2000, and so was a competitor with Red Hat Linux 6.2, and supported Pentium through early Pentium III systems (the Intel Pentium 4 didn't ship until November that year). So it is suitable for comparing our physical Intel Pentium system (tilia) and the PCem emulated equivalent.

PCem

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

Basing our desired system on tilia and the PCem devices, the target emulated hardware 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 PCI
Network10Mb/s ethernet ISA or 100Mb/s ethernet PCI

Friday 20 May 2022

Linux for PowerPC on QEMU (mac99) - System Information

QEMU mac99 running Debian Linux 8 - XFCE desktop

Linux for PowerPC

Back in the 1990s Apple, IBM and Motorola (Wikipedia) got together and created the PowerPC architecture (Wikipedia), which would be used in IBM's RS/6000 series systems, Apple's Power Macintosh systems and many Motorola products, including desktop computers and embedded processors. Apple's short lived licensing of Macintosh clones during the mid-1990s, Microsoft Windows NT supporting PowerPC (alongside Alpha, MIPS, and x86), and Apple supporting MkLinux development, drove additional interest in the platform and saw production of affordable PowerPC desktop computers.

While IBM would continue development of PowerPC into their 64-bit POWER architecture, Apple had cut-off the Macintosh clone business in 1997, and then Apple switched away from PowerPC in 2006. Leaving a lot of PowerPC based hardware in circulation, with few operating system options remaining.

Linux on PowerPC has a long, and somewhat complex history, with initial work beginning in 1994, the first Linux distributions appearing in 1996, and PowerPC support being integrated in the mainline Linux kernels with Linux 2.2 in 1999. While the PowerPC architecture has been sunset by many distributions, a few remain.

Debian Linux

Debian added support for PowerPC to its Linux distribution in 2000 with the release of Debian GNU/Linux 2.2 (potato), and while official support for 'powerpc' (32-bit PowerPC and 64-bit big-endian PowerPC) ended in 2020 with Debian 8 (jessie), Debian ports continues to make unstable/testing builds for the 'powerpc' architecture, and has official releases for the 64-bit POWER based systems ('ppc64le').

In the interests of simplicity, reproducibility and ease of comparison, I'm going to use Debian Linux 8 (jessie) for PowerPC, since it has a DVD image available, which means the lack of online repositories won't be a problem and we don't have to consider package version variation.

QEMU

The widespread use of PowerPC processors in computers and embedded systems has driven a need for emulators capable of supporting development and testing for those platforms. The QEMU emulator includes a wide range of processor and system emulations for PowerPC processors, making it a excellent options for these roles at minimal cost.

Monday 16 May 2022

RedHat Linux 6.2 (Zoot) on PCem Pentium 75

RedHat Linux 6.2 on PCem

X Windows desktop for Red Hat 6.2 (zoot) running on PCem

RedHat Linux

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

RedHat Linux 6.2 was released in 2000, and supported i386 through early Pentium III systems (the Intel Pentium 4 didn't ship until November that year). So it is suitable for comparing our physical Intel Pentium system (tilia) and the PCem emulated equivalent.

PCem

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

Basing our desired system on tilia and the PCem devices, the target emulated hardware 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

Saturday 14 May 2022

Notes on OpenSSL Performance

OpenSSL

OpenSSL can use three different implementations of the cryptographic methods, providing different performance tiers:

  1. Portable C-based methods: most portable but typically the slowest.
  2. Processor family assembler based methods: faster but less portable, and may have problems on some processor compatible implementations
  3. Methods utilizing hardware acceleration: typically the fastest option, but has specific hardware requirements

A simple compile time option ('no-asm') disables the assembler implementations used by default, so a. & b. are simple to test. For c. appropriate hardware is required. Fortunately three of the options supported by OpenSSL are available to us:

  1. VIA PadLock (Wikipedia): as implemented in the VIA C3 Nehemiah processors (Wikipedia)
  2. Intel Advanced Encryption Standard New Instructions (AES-NI; Wikipedia): implemented on Intel x86_64 since 2010 and AMD x86_64 processors since 2011
  3. Intel SHA extensions (SHA Ext.; Wikipedia): implemented on Intel x86_64 processors from 2016 and AMD Ryzen from 2017

To illustrate the effect on performance a set of methods have been selected which show the effects of each type of implementation.

Using the results for 8,192 byte blocks:

VIA Luke @ 1.0 GHz
OpenSSL 1.1.0l on Debian Linux 11 for x86
MethodAES-256 CBCIDEA CBCMD5SHA-1SHA-256SHA-512
no-asm6,916.78k9,684.21k80,191.49k36,410.71k12,064.09k1,832.28k
asm11,122.01k9,661.10k106,332.16k45,978.97k21,534.04k9,393.49k
Kerneld,e11,127.92k9,655.64k104,336.04k45,566.63k21,515.64k9,374.38k
Padlockb520,596.10k9,662.71k104,357.28k45,472.50k21,460.31k9,376.82k
OpenSSL 3.0.2 on Debian Linux 11 for x86
MethodAES-256 CBCIDEAa CBCMD5SHA-1SHA-256SHA-512
no-asm6,916.47k9,662.71k78,665.19k36,050.26k12,125.81k1,829.55k
asm11,127.47k9,655.64k103,931.19k45,509.29k21,493.73k9,368.92k
Kerneld2,033,909.76k9,627.65k104,328.02k45,512.02k21,442.15k9,366.19k
Padlockb515,844.78k9,658.37k103,765.33k45,520.21k21,435.73k9,368.92k
AMD Ryzen 5 3600
OpenSSL 1.1.0l with Debian Linux 11 for x86_64
MethodAES-256 CBCIDEA CBCMD5SHA-1SHA-256SHA-512
no-asm212,366.68k119,010.65k749,469.70k845,922.30k307,301.03k553,937.58k
asm232,721.07k119,545.86k793,971.37k1,050,842.45k470,701.40k604,972.40k
AES-NI & SHA Ext.1,086,559.57k119,250.94k790,495.23k1,027,295.91k470,671.36k605,863.94k
Kerneld,e1,092,332.20k120,416.94k787,464.19k1,029,693.44k475,791.36k601,159.00k
OpenSSL 3.0.2 with Debian Linux 11 for x86_64
MethodAES-256 CBCIDEAa CBCMD5SHA-1SHA-256SHA-512
no-asm210,668.20k117,587.97k740,698.79k832,288.09k310,059.01k559,205.03k
asmc1,097,910.95k119,048.87k789,848.06k1,036,997.97k473,503.06k599,274.84k
Kerneld37,086,822.40k120,220.33k793,990.49k1,041,334.27k474,685.44k598,278.14k

Notes:

  1. In OpenSSL 3.0.2 access to the IDEA method requires use of the legacy provider (to use without installing $ LD_LIBRARY_PATH=`pwd` apps/openssl speed -provider-path ./providers/ -provider legacy -provider default idea)
  2. The OpenSSL PadLock engine only supports AES on our VIA Luke (C3 Nehemiah) based system, more recent versions of the VIA PadLock hardware provide additional methods, including SHA
  3. On systems that support AES-NI and/or SHA Ext. the standard assembler implementations in OpenSSL 3.0.2, detect and use the instruction set extensions to accelerate the methods
  4. The OpenSSL 'afalg' engine (used for "Kernel") uses the Linux Kernel Crypto API (AF_ALG) to access the methods in the Linux kernel, which make use of hardware acceleration and processor features beyond those used by the standard assembler implementations in OpenSSL
  5. The OpenSSL 1.1.0 implementation of the 'afalg' engine only supports use of the kernel methods for AES-128-CBC

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

Tuesday 10 May 2022

Linux for m68k on QEMU (q800) - System Information

QEMU running Debian Linux unstable (bookworm/sid) for m86k

Motorola 68000 series

Introduced in 1979 the Motorola 68000 series was used in a wide range of computers through the 1980s and 1990s. Initially using a 32-bit instruction set and 32-bit registers combined with a 16-bit data bus, which Motorola dubbed a 16/32-bit processor, later iterations would implement fully 32-bit architectures, while remaining instruction compatible. The initial models provided 8-bit (68008) and 16-bit (68000, 68010) options for the external data bus allowing the use of cheaper support chips in markets that were typically 8-bit and 16-bit dominated in the early 1980s. The first fully 32-bit model, the 68020 introduced in 1984 (a year before Intel launched the 80386), initially appeared in UNIX workstations and its successors would be at the core of home computers in the 1990s. While 68000 series processors no longer appear in desktop systems, they can still be found in embedded applications.

Linux and Motorola 68000 series

Unsurprisingly the Motorola 68000 series was one of the first systems to have a Linux port (see Linux/m68k: Linux on Motorola's 68000 Processor | Linux Journal). Arguably Linux/m68k was the first port of Linux to a non-x86 architecture, initially starting off as a parallel fork of the Linux kernel, and later being incorporated into the mainline kernel, once work to support multiple platforms was in place (see Linus Torvalds 1997 M.Sc. thesis "Linux: a Portable Operating System").

A wide range of Motorola 68000 series systems are supported. Although a memory management unit (MMU) is required for support, which excludes some system variants using processors which didn't include the MMU or where the MMU is non-functional (systems without an MMU may be supported by μClinux (Wikipedia)). Looking around for a Linux distribution with Motorola 68000 series support and which doesn't require too much setup, it looks like Debian is the best bet.

Debian Linux had official release support in Debian 2.0 (Hamm) through Debian 3.1 (Sarge), and has continued to support the architecture through Debian - Ports. Currently a unofficial Linux/m68k network installation image is available for Debian 10 (buster) (https://cdimage.debian.org/cdimage/ports/10.0/m68k/iso-cd/). That sounds good, so let's give it a go...

QEMU

The wide range of systems that used the Motorola 68000 series means there are a lot of emulation options... Since we've looked at QEMU in previous emulation posts, let's see what QEMU offers for these systems...

QEMU has a relatively limited selection of system emulations for the Motorola 68000 series:

Arnewsh Inc. SBC5206an5206evaluation board
NXP MCF5208 Evaluation Boardmcf5208evbevaluation board
NeXT NeXTcube (Wikipedia)next-cubeUNIX workstation
Apple Macintosh Quadra 800 (Wikipedia)q800desktop system

Note: with QEMU 6.0 support has been added for a virt machine that is more flexible than systems considered here (see QEMU M680x0 support [PDF]).

The QEMU wiki has a description of how to install Linux on the q800 system (Documentation/Platforms/m68k - QEMU), so that sounds like a good place to begin...

Checking Apple Support, EveryMac.com, Wikipedia the hardware specification for the 'q800' would be:

SystemApple Macintosh Quadra 800
CPU68040 @ 33 MHz, includes PMMU & FPU
RAM8 MiB (136 MiB max.)
Floppy3.5" 1.44MB
StorageEmulex SCSI Processor (ESP236) controller
SCSI internal hard disk 230 MB or 500 MB
SCSI 2x CD-ROM drive
Videoframebuffer, 512 KiB or 1.0 MiB
NetworkSONIC (DP83932) 10Mb/s ethernet AAUI-15
Keyboard & MouseADB

Third-party processor clock upgrades could get the 68040 to 40 MHz or 50 MHz, and there was a PowerPC 601 @ 100 MHz upgrade processor option.

Since QEMU is not limited by the physical hardware, there is the option of having more memory than the system could support. For 'q800' it turns out that the maximum RAM is around 1,000 MiB (with 1.0 GiB problems appear).