OpenBSD Journal

Developer Blog: Mark Kettenis on HPPA

Contributed by dwc on from the dept.

I recently laid my hands on an HP C3700 workstation. My first real exposure to UNIX was on an HP workstation, and I've always admired how solidly these machines are built. The original idea was to try and make some progress on OpenBSD/hppa64. Since the problems with hppa64 were mostly in supporting the host bridges, I started reading through the (somewhat limited) documentation that HP made available to the folks porting Linux to PA-RISC. I soon realised that these machines were built to support running a 32-bit kernel as well as a 64-bit kernel. And I wondered how much effort it would be to make my machine run OpenBSD/hppa instead of OpenBSD/hppa64. I was pretty sure there'd be people who'd appreciate faster OpenBSD/hppa machines.

So I started hacking, using the code Michael Shalayeff already wrote for OpenBSD/hppa64, and adding the missing bits. Soon I had code to walk the PCI bus and see what hardware was in the box. But the fun really started when I realised that the interrupt controllers in the machine were the same I/O SAPICs that Intel uses for Itanium. Once I had the interrupts working, the onboard network controller worked...sort of. The box spewed out watchdog timeout messages, but things worked well enough to boot from an NFS root. But it really shouldn't spit out those messages, so what was going on here.

I started reading Linux source code, and after fighting off the headache, I realised that the virtually indexed caches were back to haunt me. DMA on these machines is cache coherent. Which means that you don't need to flush the memory caches before doing DMA like on most other machines. However, since the caches are virtually indexed, this means the Astro chip responsible for the DMA needs to know about the virtual address of DMA memory as well as its physical address. Otherwise it won't be able to determine whether data it needs is in the cache or not. The way to provide these virtual addresses is by using an IOMMU. Usually IOMMU's are used the map 32-bit PCI bus addresses to 64-bit memory address, such that PCI devices designed for 32-bit machines can be used in 64-bit machines. But for these HP machines we need to use the IOMMU even in 32-bit mode. So I turned to OpenBSD/sparc64 (Sun UltraSPARC machines all have IOMMU's too) for inspiration and wrote code to deal with Astro's IOMMU.

This indeed fixed my watchdog problems and made it possible to access the internal disks, making my C3700 self hosting. And it looks as if most HP four digit B/C/J-class workstations will work. Not all of my code is in the tree yet, but the latest snapshots have the missing bits. So if you have one of these machines, give it a go and send in a dmesg.

This doesn't mean that hppa64 is off the table. I'd love to run my machine in 64-bit mode too; another 32 bits really help with address space randomization. It would really help if I had another disk for my machine, and these machines use some HP-specific brackets. So if anybody could donate one of those to me (preferably with a disk in it)...

Hacking on these boxes brought up memories of working on HP big iron, waiting for minutes for the beasts to boot, only to miss the "To discontinue, press any key within 10 seconds." prompt and having to wait for minutes again...

(Comments are closed)


Comments
  1. By Gordon Willem Klok (24.57.96.182) gwk@openbsd.org on

    Can;t thank you enough for doing this Mark, nice to be running hppa on slightly less antiquated kit.

    Obligatory dmesg porn.

    [ using 312284 bytes of bsd ELF symbol table ]
    Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California. All rights reserved.
    Copyright (c) 1995-2007 OpenBSD. All rights reserved. http://www.OpenBSD.org

    OpenBSD 4.1-current (GENERIC) #526: Mon May 21 16:52:46 MDT 2007
    root@hppa2.openbsd.org:/usr/src/sys/arch/hppa/compile/GENERIC
    HP 9000/785/C3600 (Allegro) PA-RISC 2.0a
    real mem = 2147483648 (524288 reserved for PROM, 8310784 used by OpenBSD)
    avail mem = 1874489344
    using 3609 buffers containing 214712320 bytes of memory
    mainbus0 (root) [flex fff80000]
    pdc0 at mainbus0
    power0 at mainbus0 offset 400804
    mem0 at mainbus0 offset ed10200: size 2048MB
    cpu0 at mainbus0 offset ffa0000 irq 31: PCXW L1-A 552MHz, FPU PCXW rev 1
    cpu0: 512K(64b/l) Icache, 1024K(64b/l) wr-back Dcache, 160 coherent TLB
    astro0 at mainbus0 offset ed00000: Astro rev 2.1
    elroy0 at astro0 offset ed3c000: Elroy TR4.0 APIC ver 20, 7 pins
    pci0 at elroy0
    sti2 at pci0 dev 2 function 0 "Hewlett-Packard Visualize FX4" rev 0x02
    sti2: can not initialize (1)
    elroy1 at astro0 offset ed38000: Elroy TR4.0 APIC ver 20, 7 pins
    pci1 at elroy1
    elroy2 at astro0 offset ed32000: Elroy TR4.0 APIC ver 20, 7 pins
    pci2 at elroy2
    elroy3 at astro0 offset ed30000: Elroy TR4.0 APIC ver 20, 7 pins
    pci3 at elroy3
    dc0 at pci3 dev 12 function 0 "DEC 21142/3" rev 0x41: irq 10, address 00:10:83:ff:7f:79
    lxtphy0 at dc0 phy 1: LXT970 10/100 PHY, rev. 3
    "Analog Devices AD1889 Audio" rev 0x00 at pci3 dev 13 function 0 not configured
    pciide0 at pci3 dev 14 function 0 "NS PC87415 IDE" rev 0x03: DMA, channel 0 configured to compatibility, channel 1 configured t
    o compatibility
    pciide0: no compatibility interrupt for use by channel 0
    pciide0: no compatibility interrupt for use by channel 1
    "NS 87560 Legacy I/O" rev 0x01 at pci3 dev 14 function 1 not configured
    ohci0 at pci3 dev 14 function 2 "NS USB" rev 0x02: irq 8, version 1.0, legacy support
    siop0 at pci3 dev 15 function 0 "Symbios Logic 53c896" rev 0x04: irq 9, using 8K of on-board RAM
    scsibus0 at siop0: 16 targets
    siop0: switching to single-ended mode
    siop1 at pci3 dev 15 function 1 "Symbios Logic 53c896" rev 0x04: irq 9, using 8K of on-board RAM
    scsibus1 at siop1: 16 targets
    sd0 at scsibus1 targ 6 lun 0: <FUJITSU, MAJ3182MC, HP11> SCSI2 0/direct fixed
    sd0: 17366MB, 14739 cyl, 5 head, 482 sec, 512 bytes/sec, 35566480 sec total
    usb0 at ohci0: USB revision 1.0
    uhub0 at usb0
    uhub0: NS OHCI root hub, rev 1.00/1.00, addr 1
    uhub0: 3 ports with 3 removable, self powered
    biomask 0x303 netmask 0x703 ttymask 0x713
    bootpath: 10/0/15/1.6 class=1 flags=c0<autoboot,autosearch> hpa=0xf4004000 spa=0x0 io=0x19000
    root on sd0a swap on sd0b dump on sd0b
    siop1: target 6 now using tagged 16 bit 40.0 MHz 31 REQ/ACK offset xfers

  2. By jc (193.253.46.153) jcr@cg43.fr on lab0x1.net

    hy,

    Impressive job for me ...

    Not sure this is the right place ( i know : http://www.openbsd.net/want.html )

    But as you ask the question...

    i have too hppa station :

    - one j5600 (running two PA-8600 552MHz with 512/1024KB)
    currently running Gentoo HPPA 64 Bits ..(boooo) still work fine !
    - one j282 (http://www.openpa.net/systems/j-class.html) off line ..

    if it can help ...i can give the j282 .. but it's huge and hard to send through classic postal service..

    Mail me if you are interest...

    Comments
    1. By Stefan Kraatz (217.147.104.223) stefan.kraatz@kungfu-hackers.net on www.kungfu-hackers.net

      > hy,
      >
      > Impressive job for me ...
      >
      > Not sure this is the right place ( i know : http://www.openbsd.net/want.html )
      >
      > But as you ask the question...
      >
      > i have too hppa station :
      >
      > - one j5600 (running two PA-8600 552MHz with 512/1024KB)
      > currently running Gentoo HPPA 64 Bits ..(boooo) still work fine !
      > - one j282 (http://www.openpa.net/systems/j-class.html) off line ..
      >
      > if it can help ...i can give the j282 .. but it's huge and hard to send through classic postal service..
      >
      > Mail me if you are interest...

      I would be able to donate a C3600 machine to someone interested. Please let me know, if anyone wishes to jump on the train for hppa development.

      I would at least be able to ship it via kd86 from Germany.

      Good job Mark !
      Stefan

      Comments
      1. By wim Vandeputte (88.82.33.37) wim@kd85.com on https://kd85.com/notforsale.html


        > > i have too hppa station :
        > >
        > > - one j5600 (running two PA-8600 552MHz with 512/1024KB)
        > > currently running Gentoo HPPA 64 Bits ..(boooo) still work fine !
        > > - one j282 (http://www.openpa.net/systems/j-class.html) off line ..
        > >
        > > if it can help ...i can give the j282 .. but it's huge and hard to send through classic postal service..
        > >
        > > Mail me if you are interest...
        >
        > I would be able to donate a C3600 machine to someone interested. Please let me know, if anyone wishes to jump on the train for hppa development.
        >
        > I would at least be able to ship it via kd86 from Germany.

        Hey guys,

        these machines are indeed huge, as the person who had to get the two HP machines to Mark, I can confirm that ;-)

        But it's not such a problem, mail me what hardware you have and where it is, I will pick it up or arrange a pickup, France and Germany are just a hop away from here.

        Mail me at wim@kd85.com

  3. By kyle mcmartin (206.248.169.182) kyle@parisc-linux.org on

    hey mark, congrats on getting hppa64 self-hosting. cheers, kyle

    Comments
    1. By kyle mcmartin (206.248.169.182) kyle@parisc-linux.org on

      > hey mark, congrats on getting hppa64 self-hosting. cheers, kyle

      sigh, in my brain that said "hppa" not hppa64.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]