Port-RISCV archive

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

QEMU support available



Hi,

I just updated the wiki to give basic instruction on running
NetBSD/riscv64 under qemu.

https://wiki.netbsd.org/ports/qemu_riscv/

Have fun,
Nick
nick:~/emulators/tmp$ qemu-system-riscv64 \
-kernel netbsd-GENERIC64 \
-M virt \
-m 512 \
-drive if=none,file=riscv64.img,id=hd0 -device virtio-blk-device,drive=hd0 \
-netdev type=user,id=net0 -device virtio-net-device,netdev=net0,mac=00:11:22:55:55:55 \
-append "root=dk1" \
-nographic
WARNING: Image format was not specified for 'riscv64.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : riscv-virtio,qemu
Platform Features         : timer,mfdeleg
Platform HART Count       : 1
Firmware Base             : 0x80000000
Firmware Size             : 100 KB
Runtime SBI Version       : 0.2

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000080000000-0x000000008001ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x000000009f000000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsu
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 0
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109

------------
NetBSD start

sp:      0x0000_0000_80c0_2000
pc:      0x0000_0000_8020_0090
hart:    0x0000_0000_0000_0000
dtb:     0x0000_0000_9f00_0000
l1:      0x0000_0000_80c0_3000
l2:      0x0000_0000_80c0_2000
uspace:  0x0000_0000_80c0_0000
bootstk: 0x0000_0000_80c0_2000
vtopdiff:0xffff_ffbf_7fe0_0000

bss:     0x0000_0000_80b2_482c - 0x0000_0000_80c0_4000

l2pde:   0x0000_0000_80c0_2800:  0x0000_0000_2030_0c01

kern:    0x0000_0000_80c0_3000:  0x0000_0000_2008_00ef
kern:    0x0000_0000_80c0_3008:  0x0000_0000_2010_00ef
kern:    0x0000_0000_80c0_3010:  0x0000_0000_2018_00ef
kern:    0x0000_0000_80c0_3018:  0x0000_0000_2020_00ef
kern:    0x0000_0000_80c0_3020:  0x0000_0000_2028_00ef
kern:    0x0000_0000_80c0_3028:  0x0000_0000_2030_00ef
kern:    0x0000_0000_80c0_3030:  0x0000_0000_2038_00ef
kern:    0x0000_0000_80c0_3038:  0x0000_0000_2040_00ef
kern:    0x0000_0000_80c0_3040:  0x0000_0000_2048_00ef
kern:    0x0000_0000_80c0_3048:  0x0000_0000_2050_00ef
kern:    0x0000_0000_80c0_3050:  0x0000_0000_2058_00ef
kern:    0x0000_0000_80c0_3058:  0x0000_0000_2060_00ef
kern:    0x0000_0000_80c0_3060:  0x0000_0000_2068_00ef
kern:    0x0000_0000_80c0_3068:  0x0000_0000_2070_00ef
kern:    0x0000_0000_80c0_3070:  0x0000_0000_2078_00ef
kern:    0x0000_0000_80c0_3078:  0x0000_0000_2080_00ef
dtb:     0x0000_0000_80c0_3080:  0x0000_0000_27c0_00e7
PM
[   1.0000000] FDT<0xffffffc002000000>
[   1.0000000] devmap 0xffffffc0008042a0
[   1.0000000] bootstrap
[   1.0000000] stdout
[   1.0000000] fdt size 1000/f8a
[   1.0000000] consinit ok
[   1.0000000] NetBSD/riscv (fdt) booting ...
[   1.0000000] FDT /memory @ 0x80000000 size 0x20000000
[   1.0000000] init_riscv: memory start 80000000 end a0000000 (len 20000000)
[   1.0000000] cpu_kernel_vm_init: kernel phys start 0x80200000 end 0x80c00000
[   1.0000000] cpu_kernel_vm_init: init   phys start 0x80c00000 end 0x80c04000
[   1.0000000] dm:   0xffffffc000a02c10 :  0x200000e7
[   1.0000000] bootargs: root=dk1
[   1.0000000] msgbufaddr = 0xffffffe09fff0000
[   1.0000000] ------------------------------------------
[   1.0000000]            kern_vtopdiff = 0xffffffbf7fe00000
[   1.0000000]             memory_start = 0x        80000000
[   1.0000000]               memory_end = 0x        a0000000
[   1.0000000]              memory_size = 0x        20000000
[   1.0000000]           kernstart_phys = 0x        80200000
[   1.0000000]             kernend_phys = 0x        80c00000
[   1.0000000]               msgbufaddr = 0xffffffe09fff0000
[   1.0000000]    VM_MIN_KERNEL_ADDRESS = 0xffffffc000000000
[   1.0000000]           kernstart_mega = 0xffffffc000000000
[   1.0000000]                kernstart = 0xffffffc000000000
[   1.0000000]                  kernend = 0xffffffc000a00000
[   1.0000000]             kernend_mega = 0xffffffc000a00000
[   1.0000000]    VM_MAX_KERNEL_ADDRESS = 0xffffffd000000000
[   1.0000000]         pmap_direct_base = 0xffffffe000000000
[   1.0000000] ------------------------------------------
[   1.0000000] adding       0x80020000 -       0x80200000  to freelist 0
[   1.0000000] adding       0x80c04000 -       0x9f000000  to freelist 0
[   1.0000000] common bs_pde 0xffffffc000a02000 nkmempages limits: ffffffc004000000 - ffffffd000000000
[   1.0000000] kva   : ffffffc004000000 - ffffffc028c00000
[   1.0000000] Loaded initial symtab at 0xffffffc00083c260, strtab at 0xffffffc0008be010, # entries 22137
[   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]     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.99.4 (GENERIC64) #0: Fri May 12 13:29:41 UTC 2023
[   1.0000000]  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/riscv/compile/GENERIC64
[   1.0000000] total memory = 497520 KB
[   1.0000000] avail memory = 481228 KB
[   1.0000000] mainbus0 (root)
[   1.0000000] simplebus0 at mainbus0: riscv-virtio,qemu
[   1.0000000] cpus0 at simplebus0
[   1.0000000] simplebus1 at simplebus0
[   1.0000000] simplebus2 at simplebus0
[   1.0000000] cpu0 at cpus0
[   1.0000000] intc0 at cpu0: local interrupt controller
[   1.0000000] plic0 at simplebus1RISC-V PLIC (53 IRQs)
[   1.0000000] /soc/test@100000 at simplebus1 not configured
[   1.0000000] /fw-cfg@10100000 at simplebus0 not configured
[   1.0000000] /flash@20000000 at simplebus0 not configured
[   1.0000000] gfrtc0 at simplebus1: Google Goldfish RTC
[   1.0000000] com0 at simplebus1: ns16550a, 16-byte FIFO
[   1.0000000] com0: console
[   1.0000000] com0: interrupting on plic0 irq 10
[   1.0000000] /soc/poweroff at simplebus1 not configured
[   1.0000000] /soc/reboot at simplebus1 not configured
[   1.0000000] /soc/pci@30000000 at simplebus1 not configured
[   1.0000000] virtio0 at simplebus1
[   1.0000000] virtio0: block device (id 2, rev. 0x01)
[   1.0000000] ld0 at virtio0: features: 0x10000a54<INDIRECT_DESC,CONFIG_WCE,FLUSH,BLK_SIZE,GEOMETRY,SEG_MAX>
[   1.0000000] virtio0: interrupting on plic0 irq 8
[   1.0000000] ld0: 1065 MB, 2163 cyl, 16 head, 63 sec, 512 bytes/sect x 2181120 sectors
[   1.0000000] virtio1 at simplebus1
[   1.0000000] virtio1: network device (id 1, rev. 0x01)
[   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 00:11:22:55:55:55
[   1.0000000] virtio1: interrupting on plic0 irq 7
[   1.0000000] virtio2 at simplebus1
[   1.0000000] virtio3 at simplebus1
[   1.0000000] virtio4 at simplebus1
[   1.0000000] virtio5 at simplebus1
[   1.0000000] virtio6 at simplebus1
[   1.0000000] virtio7 at simplebus1
[   1.0000000] /soc/clint@2000000 at simplebus1 not configured
[   1.0198328] WARNING: system needs entropy for security; see entropy(7)
[   1.0198328] dk0 at ld0: "EFI", 163840 blocks at 32768, type: msdos
[   1.0198328] dk1 at ld0: "netbsd-root", 1982464 blocks at 196608, type: ffs
[   1.0498714] swwdog0: software watchdog initialized
[   1.0498714] root on dk1
[   1.0498714] mountroot: trying lfs...
[   1.0498714] mountroot: trying ffs...
[   1.0598185] root file system type: ffs
[   1.0598185] kern.module.path=/stand/riscv/10.99.4/modules
[   1.0698903] init: copying out path `/sbin/init' 11
Sat May 13 07:00:12 UTC 2023
Starting root file system check:
/dev/rdk1: file system is clean; not checking
Not resizing / (NAME=netbsd-root): already correct size
Starting devpubd.
Setting sysctl variables:
ddb.onpanic: 1 -> 0
Starting file system checks:
/dev/rdk0: 8 files, 81063 free (81063 clusters)
random_seed: /var/db/entropy-file: Not present; creating
Saved entropy to /var/db/entropy-file.
Setting tty flags.
Starting network.
Hostname: riscv64
IPv6 mode: host
Configuring network interfaces:.
Adding interface aliases:.
Waiting for duplicate address detection to finish...
Starting dhcpcd.
[   5.5098550] vioif0: link state UP (was UNKNOWN)
Starting mdnsd.
Building databases: dev, utmp, utmpx, services.
Starting syslogd.
Mounting all file systems...
Clearing temporary files.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
Starting virecover.
Starting local daemons:.
Updating motd.
Starting ntpd.
May 13 07:00:22 riscv64 ntpd[916]: error resolving pool 2.netbsd.pool.ntp.org: Temporary failure in name resolution (2)
ssh-keygen: 1024 SHA256:q17rlLr4j4zdbySscA/InslrlpfJv+u2L6cBPtQbY/0 root@riscv64 (DSA)
ssh-keygen: 521 SHA256:LF2DQFIqhFZHDt7xcKaW+avmMeBiVj5UTMkjvGKNPwE root@riscv64 (ECDSA)
ssh-keygen: 256 SHA256:2mP0xoCL0RCMgR+DhauWdKOaT68841QUK9pO82hYty4 root@riscv64 (ED25519)
May 13 07:00:24 riscv64 mDNSResponder: CheckNATMappings: Failed to allocate port 5350 UDP multicast socket for PCP & NAT-PMP announcements
ssh-keygen: 3072 SHA256:QwuU3LDwKbEIwM3vvEuTV2Ss6beGkv1njvTQQJrVYMU root@riscv64 (RSA)
Starting sshd.
postfix: rebuilding /etc/mail/aliases (missing /etc/mail/aliases.db)
Starting postfix.
Starting inetd.
Starting cron.
Sat May 13 07:00:38 UTC 2023

NetBSD/riscv (riscv64) (constty)

login: root
May 13 07:00:41 riscv64 login: ROOT LOGIN (root) on tty constty
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
    2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
    2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023
    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 10.99.4 (GENERIC64) #0: Fri May 12 13:29:41 UTC 2023

Welcome to NetBSD!

This is a development snapshot of NetBSD for testing -- user beware!

Bug reports: https://www.NetBSD.org/support/send-pr.html
Donations to the NetBSD Foundation: https://www.NetBSD.org/donations/
-- UNSAFE KEYS WARNING:

        The ssh host keys on this machine have been generated with
        not enough entropy configured, so may be predictable.

        To fix, follow the "Adding entropy" section in the entropy(7)
        man page and after this machine has enough entropy, re-generate
        the ssh host keys by running:

                sh /etc/rc.d/sshd keyregen
We recommend that you create a non-root account and use su(1) for root access.
riscv64# uname -a
NetBSD riscv64 10.99.4 NetBSD 10.99.4 (GENERIC64) #0: Fri May 12 13:29:41 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/riscv/compile/GENERIC64 riscv
riscv64#


Home | Main Index | Thread Index | Old Index