Port-hppa archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Adding virtio devices and ld(4) for qemu



Hi,

I'm playing NetBSD/hppa on qemu-system-hppa as wiki page:
 https://wiki.netbsd.org/ports/hppa/qemu_hppa/

It works even with qemu 9.1.2 (from pkgsrc-2024Q4) and
NetBSD/hppa 10.1, but it looks esiop(4) SCSI emulation
looks a bit unstable.

I've also tried virtio devices (disk and network) at pci on it to
avoid SCSI emulation trouble, and they just work (though SeaBIOS on
qemu doesn't recognize it so we still have to boot from a SCSI disk).

Is it OK to add ld(4) node to arch/hppa/conf/majors.conf
and virtio devices to arch/hppa/conf/GENERIC?

Thanks,

diff against netbsd-10 (should also work on HEAD):
---
Index: sys/arch/hppa/conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/hppa/conf/GENERIC,v
retrieving revision 1.41
diff -u -p -d -r1.41 GENERIC
--- sys/arch/hppa/conf/GENERIC	29 Sep 2022 10:10:07 -0000	1.41
+++ sys/arch/hppa/conf/GENERIC	8 Feb 2025 16:34:09 -0000
@@ -687,6 +687,15 @@ ucom*	at u3g?
 ugensa* at uhub? port ?
 ucom*	at ugensa?
 
+# Virtio devices
+virtio* at pci? dev ? function ?	# Virtio PCI device
+#viomb*	at virtio?			# Virtio memory balloon device
+ld*	at virtio?			# Virtio disk device
+vioif*	at virtio?			# Virtio network device
+viornd* at virtio?			# Virtio entropy device
+vioscsi* at virtio?			# Virtio SCSI device
+#vio9p*	at virtio?			# Virtio 9P device
+
 # Pseudo-Devices
 
 pseudo-device 	crypto			# /dev/crypto device
Index: sys/arch/hppa/conf/majors.hppa
===================================================================
RCS file: /cvsroot/src/sys/arch/hppa/conf/majors.hppa,v
retrieving revision 1.4
diff -u -p -d -r1.4 majors.hppa
--- sys/arch/hppa/conf/majors.hppa	4 Apr 2020 16:06:14 -0000	1.4
+++ sys/arch/hppa/conf/majors.hppa	8 Feb 2025 16:34:09 -0000
@@ -46,6 +46,7 @@ device-major	ses		char 41			ses
 device-major	pci		char 42			pci
 device-major	wd		char 43  block 11	wd
 device-major	sysmon          char 44                 sysmon
+device-major	ld		char 45  block 12	ld
 
 #device-major	obsolete	char 98			obsolete (nsmb)
 

---

qemu-system-hppa -m 512 -machine B160L \
 -drive file=NetBSD-10.1-hppa-boot.qcow2,media=disk,format=qcow2,if=none,id=disk0 \
 -drive file=NetBSD-10.1-hppa.qcow2,media=disk,format=qcow2,if=none,id=disk1 \
 -device lsi53c895a,id=scsi0 -device scsi-hd,bus=scsi0.0,drive=disk0 \
 -device virtio-blk-pci,drive=disk1 \
 -device scsi-cd,bus=scsi0.0 \
 -netdev user,id=net0,ipv6=off,hostfwd=tcp::10022-:22 \
 -device virtio-net-pci,netdev=net0 \
 -nographic

SeaBIOS PA-RISC 32-bit Firmware Version 16 (QEMU 9.1.2)

Duplex Console IO Dependent Code (IODC) revision 16

------------------------------------------------------------------------------
  (c) Copyright 2017-2024 Helge Deller <deller%gmx.de@localhost> and SeaBIOS developers.
------------------------------------------------------------------------------

  Processor   Speed            State           Coprocessor State  Cache Size
  ---------  --------   ---------------------  -----------------  ----------
      0      250 MHz    Active                 Functional            0 KB


  Emulated machine:     HP B160L (32-bit PA1.1), 32-bit PDC, OS32
  Available memory:     512 MB
  Good memory required: 16 MB
  Primary boot path:    FWSCSI.0.0
  Alternate boot path:  FWSCSI.1.0
  Console path:         SERIAL_1.9600.8.none
  Keyboard path:        SERIAL_1.9600.8.none

  Available boot devices:
  FWSCSI.0.0 : lsi 00:01.0 0:0 Drive QEMU QEMU HARDDISK 2.5+
  FWSCSI.1.0 : DVD/CD [lsi 00:01.0 1:0 Drive QEMU QEMU CD-ROM 2.5+]

Booting from FWSCSI.0.0 ...

Booting...
Boot IO Dependent Code (IODC) revision 153

HARD Booted.


NetBSD/hppa FFS/LFS Primary Bootstrap

32bit firmware

booting from partition a
filesystem: FFS
looking up boot.hp700
looking up boot
loading boot at 0x20800...done

>> NetBSD/hppa LIF/FFS/LFS Boot, Revision 1.4 (Mon Dec 16 13:08:11 UTC 2024)
>> Enter "reset" to reset system.
Boot: [[[dk0a:]netbsd][-a][-c][-d][-s][-v][-q]] :- -s
10978020+299172+339804 [399552+376743]=0xd5ae6c
Start @ 0x200000 [1=0xe9c000-0xf59e6c]...
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[   1.0000000]     2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[   1.0000000]     2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[   1.0000000]     2024
[   1.0000000]     The NetBSD Foundation, Inc.  All rights reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights reserved.

[   1.0000000] NetBSD 10.1 (GENERIC_QEMU) #0: Sun Feb  9 00:03:57 JST 2025
[   1.0000000]  tsutsui@mirage:/s/netbsd-10/src/sys/arch/hppa/compile/GENERIC_QEMU
[   1.0000000] HP9000/778/B160L (Merlin L2 160)
[   1.0000000] real mem = 512 MB (73728 reserved for PROM, 498 MB used by NetBSD)
[   1.0000000] avail mem = 486 MB
[   1.0000000] mainbus0 (root) [flex fff80000]
[   1.0000000] pdc0 at mainbus0
[   1.0000000] power0 at mainbus0
[   1.0000000] cpu0 at mainbus0 hpa 0xfffb0000 path 48 irq 31: PA7300LC (Velociraptor) rev 0
[   1.0000000] cpu0: PCXL2, PA-RISC 1.1e, lev 1, cat A, 250 MHz clk
[   1.0000000] cpu0: shadows, 1K/1K D/I caches, 240 shared TLB, 16 shared BTLB
[   1.0000000] cpu0: VR floating point, rev 1
[   1.0000000] mem0 at mainbus0 hpa 0xfffff000 path 63: size 0MB
[   1.0000000] phantomas0 at mainbus0 hpa 0xffc00000 path 8
[   1.0000000] dino0 at phantomas0 hpa 0xfff80000 path 8/0: Dino V3.1
[   1.0000000] com2 at dino0 hpa 0xfff83000 path 8/0/63: ns16550a, 16-byte FIFO
[   1.0000000] pci0 at dino0 bus 0
[   1.0000000] Hewlett-Packard Diva Serial Multiport (serial communications, generic XT-compat, revision 0x01) at pci0 dev 0 function 0 not configured
[   1.0000000] esiop0 at pci0 dev 1 function 0: Symbios Logic 53c895a (ultra2-wide scsi)
[   1.0000000] esiop0: using on-board RAM
[   1.0000000] esiop0: interrupting at irq 1
[   1.0000000] scsibus0 at esiop0: 16 targets, 8 luns per target
[   1.0000000] virtio0 at pci0 dev 2 function 0
[   1.0000000] virtio0: block device (id 2, rev. 0x00)
[   1.0000000] ld0 at virtio0: features: 0x10000a54<INDIRECT_DESC,CONFIG_WCE,FLUSH,BLK_SIZE,GEOMETRY,SEG_MAX>
[   1.0000000] ld0: max 254 segs of max 65536 bytes
[   1.0000000] virtio0: interrupting at irq 2
[   1.0000000] ld0: 10240 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 20971520 sectors
[   1.0000000] virtio1 at pci0 dev 3 function 0
[   1.0000000] virtio1: network device (id 1, rev. 0x00)
[   1.0000000] vioif0 at virtio1: features: 0x31870020<EVENT_IDX,INDIRECT_DESC,NOTIFY_ON_EMPTY,CTRL_MAC,CTRL_RX,CTRL_VQ,STATUS,MAC>
[   1.0000000] vioif0: Ethernet address 52:54:00:12:34:56
[   1.0000000] virtio1: interrupting at irq 3
[   1.0000000] lasi0 at phantomas0 hpa 0xffc00000 path 8/16 irq 28: rev 0.0
[   1.0000000] gsc0 at lasi0
[   1.0000000] lpt1 at gsc0 hpa 0xffd02000 path 8/16/0 irq 7
[   1.0000000] com3 at gsc0 hpa 0xffd05000 path 8/16/4 irq 5: ns16550a, 16-byte FIFO
[   1.0000000] com3: console
[   1.0000000] WARNING: system needs entropy for security; see entropy(7)
[   1.0264341] scsibus0: waiting 2 seconds for devices to settle...
[   5.0764511] sd0 at scsibus0 target 0 lun 0: <QEMU, QEMU HARDDISK, 2.5+> disk fixed
[   5.0764511] sd0: 2000 MB, 4063 cyl, 16 head, 63 sec, 512 bytes/sect x 4096000 sectors
[   5.0973748] cd0 at scsibus0 target 1 lun 0: <QEMU, QEMU CD-ROM, 2.5+> cdrom removable
[   5.1366328] swwdog0: software watchdog initialized
[   5.2390481] boot device: sd0
[   5.2498281] root on ld0a dumps on ld0b
[   5.2931920] kern.module.path=/stand/hppa/10.1/modules
Enter pathname of shell or RETURN for /bin/sh:
[   7.5876265] entropy: best effort
# 
---

Note I've also committed "build.sh live-image" support for hppa:
 https://mail-index.netbsd.org/source-changes/2025/02/02/msg155413.html

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index