NetBSD 6.1.5 Sparc64 on Qemu

Yes, really!

I thought I’d try it for the heck of it, and it’s working enough to go multiuser, but it has some issues with hitting the disk & network pretty hard.  But it does let you install!

I just started it up like this:

qemu-system-sparc64.exe -cdrom NetBSD-6.1.5-sparc64.iso -net nic,model=ne2k_pci -net user -boot c -hda netbsd-615-sparc64.raw -nographic -serial mon:telnet:127.0.0.1:23,server,wait -m 2048 -boot d

And in no time I was booting up!

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 15 2014 12:59
Type ‘help’ for detailed information
Trying cdrom:f…
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image…
Loaded 7478 bytes
entry point is 0x4000
NetBSD IEEE 1275 Multi-FS Bootblock
Version $NetBSD: bootblk.fth,v 1.13 2010/06/24 00:54:12 eeh Exp $
..
Jumping to entry point 0000000000100000 for type 0000000000000001…
switching to new context: entry point 0x100000 stack 0x00000000ffe8aa09
>> NetBSD/sparc64 OpenFirmware Boot, Revision 1.16
=0x8870a0
Loading netbsd: 8072208+553056+339856 [601032+393301]=0x9cd528
Unimplemented service set-symbol-lookup ([2] — [0])

Unexpected client interface exception: -1
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 6.1.5 (GENERIC)
total memory = 2048 MB
avail memory = 1997 MB
mainbus0 (root): OpenBiosTeam,OpenBIOS: hostid 80123456
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 100 MHz, UPA id 0
cpu0: 256K instruction (64 b/l), 16K data (32 b/l), 256K external (64 b/l)
psycho0 at mainbus0
psycho0: SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0
pci0 at psycho0
ppb0 at pci0 dev 1 function 0: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci2 at ppb1 bus 2
genfb0 at pci0 dev 2 function 0: unmatched vendor 0x1234 product 0x1111 (rev. 0x02)
ebus0 at pci0 dev 3 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
fdthree at ebus0 addr 0-ffffffff not configured
com0 at ebus0 addr 3f8-3ff ipl 2b: ns16550a, working fifo
com0: console
kb_ps2 at ebus0 addr 60-67 not configured
ne0 at pci0 dev 4 function 0: Realtek 8029 Ethernet
ne0: Ethernet address 52:54:00:12:34:56
ne0: 10base2, 10baseT, 10baseT-FDX, auto, default [0x40 0x40] 10baseT-FDX
ne0: interrupting at ivec 3010
cmdide0 at pci0 dev 5 function 0: CMD Technology PCI0646 (rev. 0x07)
cmdide0: primary channel configured to native-PCI mode
cmdide0: using ivec 14 for native-PCI interrupt
atabus0 at cmdide0 channel 0
cmdide0: secondary channel configured to native-PCI mode
atabus1 at cmdide0 channel 1
NULL phandle
Unexpected client interface exception: -1
pcons at mainbus0 not configured
No counter-timer — using %tick at 100MHz as system clock.
wd0 at atabus0 drive 0
wd0: <QEMU HARDDISK>
wd0: 2048 MB, 4161 cyl, 16 head, 63 sec, 512 bytes/sect x 4194304 sectors
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <QEMU DVD-ROM, QM00003, 2.2.50> cdrom removable
wd0: no disk label
wd0: no disk label
FATAL: boot device not found, check your firmware settings!
root device: cd0c
dump device (default cd0b):
file system (default generic):
root on cd0c dumps on cd0b
root file system type: cd9660
WARNING: no TOD clock present
WARNING: using default initial time
warning: no /dev/console
init path (default /sbin/init):
init: trying /sbin/init
Created tmpfs /dev (622592 byte, 1184 inodes)
init: kernel security level changed from 0 to 1

You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:

vt100
ansi
xterm

Terminal type (just hit ENTER for ‘vt220’): xterm

NetBSD/sparc64 6.1.5

This menu-driven tool is designed to help you install NetBSD to a hard disk,
or upgrade an existing NetBSD system, with a minimum of work.
In the following menus type the reference letter (a, b, c, …) to select an
item, or type CTRL+N/CTRL+P to select the next/previous item.
The arrow keys and Page-up/Page-down may also work.
Activate the current selection from the menu by typing the enter key.

┌─────────────────────────────────────────────┐
│>a: Installation messages in English │
│ b: Installation auf Deutsch │
│ c: Mensajes de instalacion en castellano │
│ d: Messages d’installation en français │
│ e: Komunikaty instalacyjne w jezyku polskim │
└─────────────────────────────────────────────┘

Wow, how’s that for cool?

A few notes though, if you use a VMDK disk access is dreadfully slow during the install, raw disk images are MUCH MUCH faster (36Kb/sec vs 3+MB/sec).  The kernel cannot figure out the root disk, so you have to tell it on every boot.  When installing it’s cd0c, when booting off the harddisk it’s wd0a. The e1000 adapter causes the kernel to go crazy, and on bootup the system indexes the man pages, which seems to kill the machine.

makemandb

makemandb indexing like crazy

As you can see this is what happens when you hit the disk too hard..

# dd if=/dev/wd0c of=/dev/null bs=1m
^Ccmdide0:0:0: lost interrupt
type: ata tc_bcount: 2048 tc_skip: 0
463+0 records in
463+0 records out
485490688 bytes transferred in 59.701 secs (8132036 bytes/sec)

and if you don’t incur the rage of the disk controller it’s the same speed:

# dd if=/dev/wd0c of=/dev/null bs=1m count=10
10+0 records in
10+0 records out
10485760 bytes transferred in 1.217 secs (8616072 bytes/sec)

But yeah, I can’t complain!

 

11 thoughts on “NetBSD 6.1.5 Sparc64 on Qemu

  1. Very good!

    I’d be interested to know how you get on with Sparc32. I can boot with graphics, the screen starts as black on white but then switches to an almost unreadable gray on black. Once it’s booted I see numerous
    esp0: !TC on DATA XFER
    errors. If I try and boot nographic, NetBSD crashes to a db> prompt.
    ne2k_pci is’t recognised by this build either.
    NetBSD 5.2.5 installs and runs without problem. This is all on Qemu 2.1.2 on Fedora 21(x86_64).

    • I just installed NetBSD on the regular sparc… and yeah a bazillion esp errors.

      qemu-system-sparc.exe -hda sparc.disk -cdrom NetBS
      D-6.1.5-sparc.iso -nographic -serial mon:telnet:127.0.0.1:23,server,nowait –
      boot c

      Same deal as far as raw disk, and using OpenBIOS.

      initialized boothowt from bootloader: 0
      Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
      2006, 2007, 2008, 2009, 2010, 2011, 2012
      The NetBSD Foundation, Inc. All rights reserved.
      Copyright (c) 1982, 1986, 1989, 1991, 1993
      The Regents of the University of California. All rights reserved.

      NetBSD 6.1.5 (GENERIC)
      total memory = 111 MB
      avail memory = 105 MB
      timecounter: Timecounters tick every 10.000 msec
      bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0
      mainbus0 (root): SUNW,SPARCstation-5: hostid 80123456
      cpu0 at mainbus0: MB86904 @ 170 MHz, MB86910 or WTL1164/5 FPU
      cpu0: 16K instruction (32 b/l), 8K data (16 b/l), 512K external (32 b/l): cache enabled
      obio0 at mainbus0
      clock0 at obio0 slot 0 offset 0x200000: mk48t08
      timer0 at obio0 slot 0 offset 0xd00000: delay constant 27, frequency = 2000000 Hz
      timecounter: Timecounter “timer-counter” frequency 2000000 Hz quality 100
      zs0 at obio0 slot 0 offset 0x100000 level 12 softpri 6
      zstty0 at zs0 channel 0 (console i/o)
      zstty1 at zs0 channel 1
      zs1 at obio0 slot 0 offset 0x0 level 12 softpri 6
      zstty4 at zs1 channel 0
      kbd0 at zstty4
      zstty5 at zs1 channel 1
      ms0 at zstty5
      wsmouse0 at ms0 mux 0
      fdc0 at obio0 slot 0 offset 0x400000 level 11: no drives attached
      auxreg0 at obio0 slot 0 offset 0x900000
      power0 at obio0 slot 0 offset 0x910000 level 2
      slavioconfig at obio0 slot 0 offset 0x800000 not configured
      iommu0 at mainbus0 addr 0x10000000: version 0x5/0x0, page-size 4096, range 64MB
      sbus0 at iommu0: clock = 21.250 MHz
      dma0 at sbus0 slot 5 offset 0x8400000: DMA rev 2
      esp0 at dma0 slot 5 offset 0x8800000 level 4: ESP200, 40MHz, SCSI ID 7
      scsibus0 at esp0: 8 targets, 8 luns per target
      ledma0 at sbus0 slot 5 offset 0x8400010: DMA rev 2
      le0 at ledma0 slot 5 offset 0x8c00000 level 6: address 52:54:00:12:34:56
      le0: 8 receive buffers, 2 transmit buffers
      tcx0 at sbus0 slot 3 offset 0x800000 level 5 (ipl 9) (8bit only TCX)tcx0: SUNW,tcx, 1024 x 768, id 0, rev 0, sense 0
      tcx0: attached to /dev/fb0
      wsdisplay1 at tcx0 kbdmux 1
      wsmux1: connecting to wsdisplay1
      audiocs0 at sbus0 slot 4 offset 0xc000000 level 5 (ipl 9): CS4231A
      audio0 at audiocs0: full duplex, playback, capture
      power-management at sbus0 slot 4 offset 0xa000000 not configured
      timecounter: Timecounter “clockinterrupt” frequency 100 Hz quality 0
      scsibus0: waiting 2 seconds for devices to settle…
      wskbd0 at kbd0 mux 1
      sd0 at scsibus0 target 0 lun 0: disk fixed
      sd0: 2048 MB, 4161 cyl, 16 head, 63 sec, 512 bytes/sect x 4194304 sectors
      cd0 at scsibus0 target 2 lun 0: cdrom removable
      kbd0: reset failed
      wskbd0: connecting to wsdisplay1
      Kernelized RAIDframe activated
      root on sd0a dumps on sd0b
      root file system type: ffs
      esp0: !TC on DATA XFER [intr 18, stat 82, step 4] prevphase 2, resid 0

      Maybe try it with SUN firmware? Or a different model of sparc I guess. At a minimum I’d rebiuld the kernel to shut that bloody message up!

      • > Maybe try it with SUN firmware? Or a different model of sparc I guess.

        Unlikely. QEMU doesn’t emulate mixing DMA and PIO access in ESP. And for some reason the NetBSD developers keep returning to this pattern since NetBSD 1.6. Maybe it’s more performant on the physical hardware.

        > At a minimum I’d rebiuld the kernel to shut that bloody message up!

        Yes, this should work. Also there were many variants of ESP. Maybe specifying another one would work.

        • I hope there is a good reason, otherwise, it’s a shame to break Qemu compatibility.

          Also, it’s really impressive to see the 64bit stuff starting to work on Qemu!

  2. The bug with the grey framebuffer on SPARC32 should be fixed in QEMU 2.2.

    What happened was that the NetBSD folks rewrote their TCX driver to use hardware acceleration available on a real card around the 6.x series timeframe, and it wasn’t until 2.2 that someone reverse-engineered this driver and provided an upstream patch to allow QEMU’s TCX driver to work in the same way.

    Someone did provide a test patch for the “esp0: !TC on DATA XFER” message but it didn’t really work for me which is why it didn’t get merged.

  3. Just tried the same installation combo with Qemu 2.3 on Windows. Basically everything is the same as described in this post. One extra caveat: OS shutdown is not smooth. Either qemu-system-sparc64 crashes, or the console would go berserk.

Leave a Reply