1 pie:/home/br/dev/qemu/build %cat run.sh ./qemu-system-riscv64 -nographic \ -machine virt \ -cpu 'rv64,h=true' \ -smp 8 \ -m 8G \ -bios ../../opensbi/build/platform/generic/firmware/fw_jump.elf \ -kernel /usr/obj/usr/home/br/dev/freebsd/riscv.riscv64/sys/GENERIC/kernel.bin 0 pie:/home/br/dev/qemu/build %sh run.sh OpenSBI v1.4-65-g5186da6 ____ _____ ____ _____ / __ \ / ____| _ \_ _| | | | |_ __ ___ _ __ | (___ | |_) || | | | | | '_ \ / _ \ '_ \ \___ \| _ < | | | |__| | |_) | __/ | | |____) | |_) || |_ \____/| .__/ \___|_| |_|_____/|____/_____| | | |_| Platform Name : riscv-virtio,qemu Platform Features : medeleg Platform HART Count : 8 Platform IPI Device : aclint-mswi Platform Timer Device : aclint-mtimer @ 10000000Hz Platform Console Device : uart8250 Platform HSM Device : --- Platform PMU Device : --- Platform Reboot Device : syscon-reboot Platform Shutdown Device : syscon-poweroff Platform Suspend Device : --- Platform CPPC Device : --- Firmware Base : 0x80000000 Firmware Size : 395 KB Firmware RW Offset : 0x40000 Firmware RW Size : 139 KB Firmware Heap Offset : 0x56000 Firmware Heap Size : 51 KB (total), 3 KB (reserved), 11 KB (used), 36 KB (free) Firmware Scratch Size : 4096 B (total), 336 B (used), 3760 B (free) Runtime SBI Version : 2.0 Domain0 Name : root Domain0 Boot HART : 5 Domain0 HARTs : 0*,1*,2*,3*,4*,5*,6*,7* Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W) Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W) Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: () Domain0 Region03 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: () Domain0 Region04 : 0x0000000080040000-0x000000008007ffff M: (R,W) S/U: () Domain0 Region05 : 0x000000000c400000-0x000000000c5fffff M: (I,R,W) S/U: (R,W) Domain0 Region06 : 0x000000000c000000-0x000000000c3fffff M: (I,R,W) S/U: (R,W) Domain0 Region07 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X) Domain0 Next Address : 0x0000000080200000 Domain0 Next Arg1 : 0x0000000084200000 Domain0 Next Mode : S-mode Domain0 SysReset : yes Domain0 SysSuspend : yes Boot HART ID : 5 Boot HART Domain : root Boot HART Priv Version : v1.12 Boot HART Base ISA : rv64imafdch Boot HART ISA Extensions : sstc,zicntr,zihpm,zicboz,zicbom,sdtrig Boot HART PMP Count : 16 Boot HART PMP Granularity : 2 bits Boot HART PMP Address Bits: 54 Boot HART MHPM Info : 16 (0x0007fff8) Boot HART Debug Triggers : 2 triggers Boot HART MIDELEG : 0x0000000000001666 Boot HART MEDELEG : 0x0000000000f0b509 ---<>--- GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Physical memory chunk(s): 0x80000000 - 0x27fffffff, 8192 MB (2097152 pages) Excluded memory regions: 0x80000000 - 0x801fffff, 2 MB ( 512 pages) NoAlloc NoDump 0x80200000 - 0x83e1afff, 60 MB ( 15387 pages) NoAlloc Found 8 CPUs in the device tree Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #330 bhyve-n269449-2a2ed164e9b0-dirty: Fri Jul 12 22:23:55 BST 2024 br@pie:/usr/obj/usr/home/br/dev/freebsd/riscv.riscv64/sys/GENERIC riscv FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) WARNING: WITNESS option enabled, expect reduced performance. VT: init without driver. Preloaded elf kernel "kernel" at 0xffffffc003b2dc60. SBI: OpenSBI v1.4 SBI Specification Version: 2.0 CPU 0 : Vendor=Unspecified Core=Unspecified (Hart 5) marchid=0, mimpid=0 MMU: 0x7 ISA: 0x11ad S-mode Extensions: 0x1 real memory = 8589934592 (8192 MB) Physical memory chunk(s): 0x0000000083e1b000 - 0x000000027336dfff, 8310304768 bytes (2028883 pages) avail memory = 8267784192 (7884 MB) No static device mappings. Starting CPU 3 (hart 0) Starting CPU 4 (hart 1) Starting CPU 5 (hart 2) Starting CPU 6 (hart 3) Starting CPU 7 (hart 4) Starting CPU 1 (hart 6) Starting CPU 2 (hart 7) FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs CPU 1 : Vendor=Unspecified Core=Unspecified (Hart 6) CPU 2 : Vendor=Unspecified Core=Unspecified (Hart 7) CPU 3 : Vendor=Unspecified Core=Unspecified (Hart 0) CPU 4 : Vendor=Unspecified Core=Unspecified (Hart 1) CPU 5 : Vendor=Unspecified Core=Unspecified (Hart 2) CPU 6 : Vendor=Unspecified Core=Unspecified (Hart 3) CPU 7 : Vendor=Unspecified Core=Unspecified (Hart 4) random: no preloaded entropy cache random: no platform bootloader entropy arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled. VIMAGE (virtualized network stack) enabled hostuuid: using 00000000-0000-0000-0000-000000000000 ULE: setup cpu 0 ULE: setup cpu 1 ULE: setup cpu 2 ULE: setup cpu 3 ULE: setup cpu 4 ULE: setup cpu 5 ULE: setup cpu 6 ULE: setup cpu 7 random: entropy device external interface kbd0 at kbdmux0 mem: null: openfirm: tcp_log: tcp_log device crypto: ofwbus0: simplebus0: on ofwbus0 simplebus1: on ofwbus0 sbi0: intc0: on ofwbus0 sbi_ipi0: on sbi0 plic0: mem 0xc000000-0xc5fffff irq 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 on simplebus1 timer0: Timecounter "RISC-V Timecounter" frequency 10000000 Hz quality 1000 Event timer "RISC-V Eventtimer" frequency 10000000 Hz quality 1000 riscv_syscon0: mem 0x100000-0x100fff on simplebus1 ram0: reserving memory region: 83e1b000-280000000 rcons0: syscon_power0: on ofwbus0 syscon_power1: on ofwbus0 cpulist0: on ofwbus0 cpu0: on cpulist0 cpu0: missing 'clock-frequency' property cpu1: on cpulist0 cpu1: missing 'clock-frequency' property cpu2: on cpulist0 cpu2: missing 'clock-frequency' property cpu3: on cpulist0 cpu3: missing 'clock-frequency' property cpu4: on cpulist0 cpu4: missing 'clock-frequency' property cpu5: on cpulist0 cpu5: missing 'clock-frequency' property cpu6: on cpulist0 cpu6: missing 'clock-frequency' property cpu7: on cpulist0 cpu7: missing 'clock-frequency' property ofwbus0: compat riscv,pmu (no driver attached) ofwbus0: mem 0x10100000-0x10100017 compat qemu,fw-cfg-mmio (no driver attached) ofwbus0: mem 0x20000000-0x21ffffff,0x22000000-0x23ffffff compat cfi-flash (no driver attached) goldfish_rtc0: mem 0x101000-0x101fff irq 0 on simplebus1 goldfish_rtc0: registered as a time-of-day clock, resolution 1.000000s simplebus1: no default resources for rid = 0, type = 4 simplebus1: no default resources for rid = 0, type = 4 uart0: <16550 or compatible> mem 0x10000000-0x100000ff irq 1 on simplebus1 uart0: console (115200,n,8,1) uart0: fast interrupt uart0: PPS capture mode: DCD simplebus1: mem 0x10008000-0x10008fff irq 2 compat virtio,mmio (no driver attached) simplebus1: mem 0x10007000-0x10007fff irq 3 compat virtio,mmio (no driver attached) simplebus1: mem 0x10006000-0x10006fff irq 4 compat virtio,mmio (no driver attached) simplebus1: mem 0x10005000-0x10005fff irq 5 compat virtio,mmio (no driver attached) simplebus1: mem 0x10004000-0x10004fff irq 6 compat virtio,mmio (no driver attached) simplebus1: mem 0x10003000-0x10003fff irq 7 compat virtio,mmio (no driver attached) simplebus1: mem 0x10002000-0x10002fff irq 8 compat virtio,mmio (no driver attached) simplebus1: mem 0x10001000-0x10001fff irq 9 compat virtio,mmio (no driver attached) simplebus1: mem 0x2000000-0x200ffff irq 26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41 compat sifive,clint0 (no driver attached) pcib0: mem 0x30000000-0x3fffffff on simplebus1 pcib0: parsing FDT for ECAM0: pcib0: Bus is cache-coherent pcib0: PCI addr: 0x0, CPU addr: 0x3000000, Size: 0x10000, Type: I/O port pcib0: PCI addr: 0x40000000, CPU addr: 0x40000000, Size: 0x40000000, Type: memory pcib0: PCI addr: 0x400000000, CPU addr: 0x400000000, Size: 0x400000000, Type: memory pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x1b36, dev=0x0008, revid=0x00 domain=0, bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) crypto: assign cryptosoft0 driver id 0, flags 0x6000000 Device configuration finished. procfs registered Timecounters tick every 1.000 msec lo0: bpf attached vlan: initialized, using hash tables with chaining IPsec: Initialized Security Association Processing. tcp_init: net.inet.tcp.tcbhashsize auto tuned to 65536 usb_needs_explore_all: no devclass Trying to mount root from ufs:/dev/md0 []... sbi_ipi0: using for IPIs Release APs Secondary CPU 6 fully online Secondary CPU 7 fully online Secondary CPU 3 fully online Secondary CPU 5 fully online Secondary CPU 1 fully online Secondary CPU 2 fully online Secondary CPU 4 fully online WARNING: WITNESS option enabled, expect reduced performance. md0: Embedded image 50331648 bytes at 0xffffffc000869450 regulator: shutting down unused regulators goldfish_rtc0: providing initial system time failed to load CTF for kernel: 2 start_init: trying /sbin/init 2024-07-14T12:36:30.017774+00:00 - init 16 - - login_getclass: unknown class 'daemon' 2024-07-14T12:36:30.043001+00:00 - init 16 - - can't access /etc/rc: No such file or directory /bin/sh: cannot open /etc/rc: No such file or directory Enter full pathname of shell or RETURN for /bin/sh: # # # # # # bhyve -c 8 -m 2560 -o bootrom=/kernel.bin -o console=stdio -s 4,ahci-hd,/bin/ls test aplic_attach_to_vm ---<>--- GDB: debug ports: uart GDB: current port: uart KDB: debugger backends: ddb gdb KDB: current backend: ddb Physical memory chunk(s): 0x100000000 - 0x19fffffff, 2560 MB ( 655360 pages) Excluded memory regions: random: unblocking device. 0x100000000 - 0x1001fffff, 2 MB ( 512 pages) NoAlloc NoDump 0x100000000 - 0x10141afff, 20 MB ( 5147 pages) NoAlloc Found 8 CPUs in the device tree Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #64 main-n270496-0ead35836149-dirty: Thu Jul 11 13:57:07 BST 2024 br@pie:/usr/obj/usr/home/br/dev/freebsd-generic/riscv.riscv64/sys/GENERIC riscv FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) WARNING: WITNESS option enabled, expect reduced performance. VT: init without driver. Preloaded elf kernel "kernel" at 0xffffffc001326560. SBI: bhyve 1500020 SBI Specification Version: 2.0 CPU 0 : Vendor=Unspecified Core=Unspecified (Hart 0) marchid=0, mimpid=0 MMU: 0x1 ISA: 0x112d S-mode Extensions: 0x1 real memory = 2684354560 (2560 MB) Physical memory chunk(s): 0x000000010141b000 - 0x000000019be70fff, 2594529280 bytes (633430 pages) avail memory = 2578386944 (2458 MB) No static device mappings. Starting CPU 1 (hart 1) Starting CPU 2 (hart 2) Starting CPU 3 (hart 3) Starting CPU 4 (hart 4) Starting CPU 5 (hart 5) Starting CPU 6 (hart 6) Starting CPU 7 (hart 7) FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs CPU 1 : Vendor=Unspecified Core=Unspecified (Hart 1) CPU 2 : Vendor=Unspecified Core=Unspecified (Hart 2) CPU 3 : Vendor=Unspecified Core=Unspecified (Hart 3) CPU 4 : Vendor=Unspecified Core=Unspecified (Hart 4) CPU 5 : Vendor=Unspecified Core=Unspecified (Hart 5) CPU 6 : Vendor=Unspecified Core=Unspecified (Hart 6) CPU 7 : Vendor=Unspecified Core=Unspecified (Hart 7) random: no preloaded entropy cache random: no platform bootloader entropy arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled. VIMAGE (virtualized network stack) enabled hostuuid: using 00000000-0000-0000-0000-000000000000 ULE: setup cpu 0 ULE: setup cpu 1 ULE: setup cpu 2 ULE: setup cpu 3 ULE: setup cpu 4 ULE: setup cpu 5 ULE: setup cpu 6 ULE: setup cpu 7 random: entropy device external interface kbd0 at kbdmux0 mem: null: openfirm: tcp_log: tcp_log device crypto: ofwbus0: sbi0: intc0: on ofwbus0 sbi_ipi0: on sbi0 aplic0: mem 0x2f000000-0x2f00ffff irq 0 on ofwbus0 timer0: Timecounter "RISC-V Timecounter" frequency 10000000 Hz quality 1000 Event timer "RISC-V Eventtimer" frequency 10000000 Hz quality 1000 ram0: reserving memory region: 10141b000-1a0000000 rcons0: cpulist0: on ofwbus0 cpu0: on cpulist0 cpu0: Nominal frequency 825Mhz cpu1: on cpulist0 cpu1: Nominal frequency 825Mhz cpu2: on cpulist0 cpu2: Nominal frequency 825Mhz cpu3: on cpulist0 cpu3: Nominal frequency 825Mhz cpu4: on cpulist0 cpu4: Nominal frequency 825Mhz cpu5: on cpulist0 cpu5: Nominal frequency 825Mhz cpu6: on cpulist0 cpu6: Nominal frequency 825Mhz cpu7: on cpulist0 cpu7: Nominal frequency 825Mhz ofwbus0: no default resources for rid = 0, type = 4 ofwbus0: no default resources for rid = 0, type = 4 ofwbus0: no default resources for rid = 0, type = 4 uart0: <16550 or compatible> mem 0x10000-0x10fff irq 1 on ofwbus0 uart0: console (115200,n,8,1) aplic0: Bind irq 1 to cpu0 (hart 0) new target_cpu 0 irq 1 uart0: fast interrupt uart0: PPS capture mode: DCD pcib0: mem 0xe0000000-0xefffffff on ofwbus0 pcib0: parsing FDT for ECAM0: pcib0: Bus is not cache-coherent pcib0: PCI addr: 0xdf000000, CPU addr: 0xdf000000, Size: 0x1000000, Type: I/O port pcib0: PCI addr: 0xa0000000, CPU addr: 0xa0000000, Size: 0x3f000000, Type: memory pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x8086, dev=0x2821, revid=0x00 domain=0, bus=0, slot=4, func=0 class=01-06-01, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=255 MSI supports 16 messages, 64 bit map[24]: type Memory, range 32, base 0xa0000000, size 13, enabled ahci0: mem 0xa0000000-0xa0001fff at device 4.0 on pci0 ahci0: Failed to allocate MSI/MSI-x, falling back to INTx aplic0: Bind irq 2 to cpu0 (hart 0) new target_cpu 0 irq 2 ahci0: AHCI v1.30 with 32 6Gbps ports, Port Multiplier not supported ahci0: Caps: 64bit NCQ SNTF MPS SS ALP AL CLO 6Gbps PMD SSC PSC 32cmd eSATA 32ports ahci0: Caps2: APST ahcich0: at channel 0 on ahci0 ahcich0: Caps: ahcich1: not probed (disabled) ahcich2: not probed (disabled) ahcich3: not probed (disabled) ahcich4: not probed (disabled) ahcich5: not probed (disabled) ahcich6: not probed (disabled) ahcich7: not probed (disabled) ahcich8: not probed (disabled) ahcich9: not probed (disabled) ahcich10: not probed (disabled) ahcich11: not probed (disabled) ahcich12: not probed (disabled) ahcich13: not probed (disabled) ahcich14: not probed (disabled) ahcich15: not probed (disabled) ahcich16: not probed (disabled) ahcich17: not probed (disabled) ahcich18: not probed (disabled) ahcich19: not probed (disabled) ahcich20: not probed (disabled) ahcich21: not probed (disabled) ahcich22: not probed (disabled) ahcich23: not probed (disabled) ahcich24: not probed (disabled) ahcich25: not probed (disabled) ahcich26: not probed (disabled) ahcich27: not probed (disabled) ahcich28: not probed (disabled) ahcich29: not probed (disabled) ahcich30: not probed (disabled) ahcich31: not probed (disabled) crypto: assign cryptosoft0 driver id 0, flags 0x6000000 Device configuration finished. procfs registered Timecounters tick every 1.000 msec lo0: bpf attached vlan: initialized, using hash tables with chaining IPsec: Initialized Security Association Processing. tcp_init: net.inet.tcp.tcbhashsize auto tuned to 32768 usb_needs_explore_all: no devclass md0: Embedded image 8388608 bytes at 0xffffffc000861dd8 ahcich0: AHCI reset... ahcich0: SATA connect time=0us status=00000133 ahcich0: AHCI reset: device found ahcich0: AHCI reset: device ready after 0ms Trying to mount root from ufs:/dev/md0 []... sbi_ipi0: using for IPIs Release APs Secondary CPU 7 fully online aplic0: Bind irq 1 to cpu1 (hart 1) Snew target_cpu 0 irq 1 econdary CPU 2 fully online aplic0: Bind irq 2 to cpu2 (hart 2) new target_cpu 0 irq 2 Secondary CPU 1 fully online Secondary CPU 4 fully online Secondary CPU 5 fully online Secondary CPU 3 fully online Secondary CPU 6 fully online WARNING: WITNESS option enabled, expect reduced performance. regulator: shutting down unused regulators ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ACS-2 ATA SATA 3.x device ada0: Serial Number BHYVE-1823-044F-303D ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 0MB (100 512 byte sectors) Warning: no time-of-day clock registered, GEOM: new disk ada0 system time will not be set accurately pass0 at ahcich0 bus 0 scbus0 target 0 lun 0 pass0: ACS-2 ATA SATA 3.x device pass0: Serial Number BHYVE-failed to load CTF for kernel: 2 1823-044F-303D pass0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) pass0: Command Queueing enabled start_init: trying /sbin/init 2024-07-11T12:56:47.505421+00:00 - init 17 - - login_getclass: unknown class 'daemon' 2024-07-11T12:56:47.589915+00:00 - init 17 - - can't access /etc/rc: No such file or directory /bin/sh: cannot open /etc/rc: No such file or directory Enter full pathname of shell or RETURN for /bin/sh: Cannot read termcap database; using dumb terminal settings. # # # uname -a FreeBSD 15.0-CURRENT FreeBSD 15.0-CURRENT #64 main-n270496-0ead35836149-dirty: Thu Jul 11 13:57:07 BST 2024 br@pie:/usr/obj/usr/home/br/dev/freebsd-generic/riscv.riscv64/sys/GENERIC riscv # # # sh Cannot read termcap database; using dumb terminal settings. # # sh Cannot read termcap database; using dumb terminal settings. # sh Cannot read termcap database; using dumb terminal settings. # rsandom: unblocking device. h Cannot read termcap database; using dumb terminal settings. # sh Cannot read termcap database; using dumb terminal settings. # # top -n last pid: 25; load averages: 0.00, 0.00, 0.24 up 0+00:00:13 12:56:57 7 processes: 1 running, 6 sleeping CPU: 0.4% user, 0.0% nice, 7.7% system, 0.7% interrupt, 91.2% idle Mem: 4404K Active, 172K Inact, 59M Wired, 3240K Buf, 2410M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 18 0 1 37 0 13M 2556K wait 7 0:01 0.00% sh 24 0 1 34 0 13M 2556K wait 5 0:00 0.00% sh 21 0 1 52 0 13M 2552K wait 5 0:00 0.00% sh 20 0 1 44 0 13M 2560K wait 6 0:00 0.00% sh 22 0 1 61 0 13M 2556K wait 5 0:00 0.00% sh 25 0 1 63 0 14M 2564K CPU5 5 0:00 0.00% top 23 0 1 58 0 13M 2552K wait 6 0:00 0.00% sh #