From Linux PARISC Wiki
(Difference between revisions)
Jump to: navigation, search
m (HP-UX)
m (HP-UX)
Line 115: Line 115:
  "whatever") and sets the default MSUS to that drive.
  "whatever") and sets the default MSUS to that drive.
HP-UX 9.05 fails like this: (reported 2021/05/18 by Stefano Repici <rs.rdp@zoho.eu>)
HP-UX 9.05 fails like this: (reported 2021/05/18)
     Stored message buffer up to panic:
     Stored message buffer up to panic:
         Floating point coprocessor configured and enabled.
         Floating point coprocessor configured and enabled.

Revision as of 19:52, 18 May 2021


QEMU support status regarding hppa/parisc

Since QEMU version 2.12 (April 2018), qemu fully supports 32-bit hppa user emulation (hppa-linux-user) and 32-bit hppa system emulation (qemu-system-hppa). All necessary changes have been merged into the upstream qemu git tree.

PA-RISC machines need a firmware ("PDC" = Processor Dependend Code). Qemu comes with a precompiled PDC firmware for hppa (pc-bios/hppa-firmware.img), which is based on a fork of SeaBIOS .

The emulated machine is a HP B160L desktop machine, with one or more 32-bit PA7100LC CPUs.

The QEMU emulation is able to run Linux and HP-UX.

QEMU on parisc has been developed by:

  • Richard Henderson: QEMU CPU emulation (32-bit only), QEMU hardware divers
  • Helge Deller: QEMU hardware drivers, SeaBIOS PDC firmware
  • Sven Schnelle: Lots of fixes all over QEMU and SeaBIOS (SCSI, CPU emulation fixes, SeaBIOS PDC firmware)

QEMU runtime options

Possible qemu options:

  • -accel tcg,thread=multi - always use this to enable parallel tcg (otherwise all guest CPUs run on one host CPU)
  • -smp cpus=4 - define number of CPUs in the guest (maximum CPUs: 32)
  • -boot menu=on - Firmware: enable interactive mode (boot prompt)
  • -boot order=c - Firmware: Boot from hard disc
  • -boot order=d - Firmware: Boot from CD/DVD
  • -serial mon:stdio use serial console
  • -nographic - disable artist graphic card emulation, so no graphics output
  • -global -global artist.width=800 artist.height=600 set Artist graphic card to 800x600 pixel
  • -fw_cfg opt/pdc_debug,string=255, enable all firmware debug infos

When running you can press

  • ctrl-A + X to exit qemu.
  • ctrl-A + C + ENTER when started with "-serial mon:stdio", the serial port and the QEMU debug port are multiplexed and you can switch between them with this key combination.

How to build QEMU from source

Check out the qemu git tree

Run configure, e.g.

  • (for system emulation) ./configure --target-list=hppa-softmmu --enable-numa
  • (for user emulation) ./configure --target-list=hppa-linux-user --disable-stack-protector --prefix=/home/qemu-hppa/chroot-unstable --interp-prefix=/home/qemu-hppa/chroot-unstable --static

Run "make"

Emulation guest targets


  • Linux kernel >= 4.14 runs best, with initial optimizations added for kernels >= 4.9.
  • Prefer the Tulip NIC, then e1000 over the rtl8129 card. The latter gives irq issues with Dino emulation.
  • If you try to boot older Linux install CDs (Debian-5, Debian-8, Debian-9), you may need to start qemu with "-boot menu=on", and then change the kernel console option to "console=ttyS0" (serial port) instead of "console=tty0" (terminal). Then switch in GUI to the "serial0" device to see console. Alternatively start without graphical console, e.g. with "-nographic"-

Debian Linux QEMU image for parisc

Download Debian hard disc image:

wget http://backup.parisc-linux.org/qemu/debian-10-hdd-img.tar.bz2

Unzip image:

tar xvfj debian-10-hdd-img.tar.bz2

Run qemu:

./hppa-softmmu/qemu-system-hppa -drive file=debian-10-hdd.img -nographic -serial mon:stdio -accel tcg,thread=multi -smp cpus=4 

Log in as root, root password is "rootme"

How to run QEMU with Debian-10 installer image

  • Create a virtual hard disc once:
qemu-img create -f qcow2 hdd.img 50G
./hppa-softmmu/qemu-system-hppa -drive file=hdd.img -drive file=debian-10.0-hppa-NETINST-1.iso,media=cdrom -boot order=d -nographic -serial mon:stdio 
  • Choose typical installation options, the defaults are OK.
  • Either skip the step "Configure the Package manager", or configure the mirror as with hostname "ftp.ports.debian.org", and directory "/debian-ports"
  • Shut down virtual machine after installation
  • Start emulator with installed operating system any time:
./hppa-softmmu/qemu-system-hppa -drive file=hdd.img -nographic -serial mon:stdio -accel tcg,thread=multi -smp cpus=2 
  • Edit the sources.list (/etc/apt/sources.list) file:
deb http://ftp.ports.debian.org/debian-ports unstable main
deb [arch=all] http://ftp.debian.org/debian unstable main 
deb-src http://ftp.debian.org/debian unstable main

Gentoo Linux

  • From https://www.gentoo.org/downloads/#hppa download the Minimal installation CD or the hppa32 netboot image (lif file)
  • Start qemu with "-cdrom <isofile>", or the lif file with "-drive file=<lif-file>", e.g.
qemu-system-hppa -drive file=gentoo-2020-hppa-netboot.lif -accel tcg,thread=multi -smp cpus=2 -nographic


  • Still LASI NIC emulation and NCR 710 Emulation needed in order to be able to boot older HP-UX releases.
  • Astrobaby wrote about his test results.
  • The "INTERRUPT KEY" mentioned sometimes by HP-UX can be emulated with the "Ctrl-\" key combination
  • In case you lost the HP-UX root password, boot at ISL 'hpux -is' and then give a new password with running "passwd".
  • How to test dtwm Windows Manager: start "xinit", then run "/usr/dt/bin/dtwm".
  • File downloads see https://archive.org/download/hpunix/
  • HP-UX 7.05 gives System Panic: "Unable to initialize msus structure". according to this document "msus" means "mass storage unit

specifier", which might mean that old 7.05 doesn't know how to handle the SCSI PCI card and thus can't access the disc. Remember, a B160L is different to a HP700.

You can set the default mass storage unit with:
where ":T" points it at the Tape drive, ":D700" points it at the first
disk drive unit, ":D701" at the second, and ".GAMES" (or ".whatever")
searches the disk drives for a disk with the volume label "GAMES" (or
"whatever") and sets the default MSUS to that drive.

HP-UX 9.05 fails like this: (reported 2021/05/18)

    Stored message buffer up to panic:
        Floating point coprocessor configured and enabled.
        No BTLB entries found for processor 0
        Unsupported module type 0x7 found

        System Panic:
           B2352A HP-UX (A.09.05) #2: Tue Oct 18 15:46:14 PDT 1994
        panic: (display==0xbc00, flags==0x0) Unable to initialize msus structure
        PC-Offset Stack Trace (read across, most recent is 1st):
           0x000ec6f8  0x000d7e3c  0x00081e5c  0x000254c0
        End Of Stack

        dumping 0 bytes to dev 0xffffffff, offset 0 ...
        Dump failed, returning 5.


Images at http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/images/

Info at https://www.netbsd.org/releases/current.html

qemu-system-hppa \
       -kernel ${KERNEL} \
       -drive file=hdd.img \
       -drive file=NetBSD-8.99.37-hppa.iso,media=cdrom \
       -nographic \
       -serial telnet::55555,server
  • at least NetBSD-8 required.
  • NetBSD-7 doesn't work, since the trap handler code is complaining about the stack pointer it sees in the trap frame. 0xa0 for the stack pointer isn't good (analyzed with Nick Hudson <nick.hudson@gmx.co.uk>):
    • insanity: 'tf->tf_sp >= minsp && tf->tf_sp < maxsp' at trap:556 type 0xf tf 0xe00040 lwp 0xe38140 sp 0xa0 pc 0x200240

(info by Nick Hudson <nick.hudson@gmx.co.uk>)


Download at ftp://ftp.cirr.com/pub/hppa/mklinux/ The file root_ext2_g.dd.bin.gz doesn't cleanly decompress.. so I did a gzip -dc into root_ext2_g.dd.bin.

MkLinux sources: https://github.com/slp/osfmk-mklinux

qemu-system-hppa -boot c -drive if=scsi,bus=0,index=3,file=root_ext2_g.dd.bin,format=raw \
       -serial mon:stdio -nographic -m 128 

It boots, but fails during device detection because Qemu currently emulates a B160, while MkLinux expects a HP700. So it fails to see the LASI chip below the GSC bridge.

NVM bootdata Bad Checksum (0)
OSF Mach boot
: /mach
text (0x95618) at 0x11000
data (0x48594) at 0xa8000
Mach 3.0 VERSION(PMK1.1): cb <pmk1_1>; Wed Nov 26 17:20:37 MET 1997; mach_kernel/PRODUCTION (cameleon)
unknown machine type 0x502
good luck :-)
, 0K Icache, 0K Dcache, 256 entry shared TLB)
Warning: unsupported module at ffc00000 (type:7 svers:0 hvers:50)
Stack Trace (depth=1):
End of Stack 

(info by Jason Stevens <neozeed@gmail.com>)

Future QEMU work

Still need to do:

  • Add Dino/Lasi serial port
  • Harmony sound card in Lasi
  • Does HP-UX has some kind of "sleep" assembler instruction in it's idle loop which can be used to lower qemu power consumption?
  • Fix virtio-drivers in SeaBIOS (endianess-bugs, because SeaBIOS is originally only Little-endian from x86)
  • More correct emulation of B160L in Qemu
  • Emulate a 712 and/or j5000/c3000 machine
  • Emulate built-in LASI SCI controller instead of PCI SCSI add-on card
  • Elroy PCI emulation, then emulate e.g. a C3000?
  • PA2.0/64bit (low prio)
  • ...
  • Push SeaBIOS changes upstream!!

List of QEmu important patches


HP-UX booting up


HP-UX CDE Login screen


HP-UX CDE initial screen


Some applications started in CDE


Personal tools