Can't boot arm64 image by qemu-system-aarch64
KIRIYAMA Kazuhiko
kiri at truefc.org
Wed Dec 25 22:56:13 UTC 2019
On Wed, 04 Dec 2019 10:21:51 +0900,
KIRIYAMA Kazuhiko wrote:
>
> Hi, Warner
>
> On Wed, 04 Dec 2019 09:55:30 +0900,
> Warner Losh wrote:
> >
> > [1 <text/plain; UTF-8 (7bit)>]
> >
> > [2 <text/html; UTF-8 (quoted-printable)>]
> >
> >
> >
> >
> > On Tue, Dec 3, 2019, 4:00 PM KIRIYAMA Kazuhiko <kiri at truefc.org> wrote:
> >
> >
> > Hi, all
> >
> > # I've posted freebsd-virtualization,but any responces.
> > # Sorry for same posting.
> >
> > I've installed successfully by qemu-system-aarch64 below:
> >
> > root at vm:/vm/test # truncate -s 16g test.img
> > root at vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu cortex-a57 -name test
> > -bios QEMU_EFI.fd -nographic -hda test.img -hdc
> > FreeBSD-13.0-CURRENT-arm64-aarch64-20191127-r355121-memstick.img
> >
> > and rebooted successfully and login with root:
> >
> > root at test:~ # uname -a
> > FreeBSD test.tfc 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r355121: Wed Nov 27 03:49:21 UTC 2019
> > root at releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
> > root at test:~ # df -h
> > Filesystem Size Used Avail Capacity Mounted on
> > /dev/vtbd0p2 14G 1.3G 12G 10% /
> > devfs 1.0K 1.0K 0B 100% /dev
> > root at test:~ # ifconfig
> > vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> > options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
> > ether 52:54:00:12:34:56
> > inet 192.168.1.196 netmask 0xffffff00 broadcast 192.168.1.255
> > media: Ethernet 10Gbase-T <full-duplex>
> > status: active
> > nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> > options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
> > inet6 ::1 prefixlen 128
> > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
> > inet 127.0.0.1 netmask 0xff000000
> > groups: lo
> > nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> > root at test:~ #
> >
> > So, I shutdowned and run by qemu-system-aarch64:
> >
> > root at vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu cortex-a57 -name test
> > -bios QEMU_EFI.fd -nographic -drive if=none,format=raw,file=test.img,id=hd0 -device
> > virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0 -netdev
> > tap,id=net0,ifname=tap2
> >
> > But failed to boot:
> >
> > BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> > VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> > BdsDxe: failed to load Boot0002 "UEFI Misc Device 2" from
> > VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A00000000): Not Found
> >
> > >>Start PXE over IPv4.
> >
> >
> > where, tap2 is ready to use:
> >
> > root at vm:/vm/test # ifconfig tap2
> > tap2: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
> > description: vmnet-test-0-local
> > options=80000<LINKSTATE>
> > ether 58:9c:fc:10:ec:02
> > groups: tap qemu-port
> > media: Ethernet autoselect
> > status: no carrier
> > nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> > root at vm:/vm/test #
> >
> > What's wrong ?
> >
> >
> >
> >
> >
> > Where did the efi firmware come from?
>
> I've got from [1].
>
> [1] http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_CLANG35/QEMU_EFI.fd
After I've installed by bsdinstall, I copied boot partition
from original FreeBSD boot image [1]:
root at vm:/vm/test # mdconfig -a -t vnode -f FreeBSD-13.0-CURRENT-arm64-aarch64-20191212-r355634-memstick.img
md0
root at vm:/vm/test # mdconfig -a -t vnode -f test.img md1
root at vm:/vm/test # gpart show md0
=> 3 2042648 md0 GPT (997M)
3 66584 1 efi (33M)
66587 1976064 2 freebsd (965M)
root at vm:/vm/test # gpart show md1
=> 40 33554352 md1 GPT (16G)
40 532480 1 efi (260M)
532520 24633344 2 freebsd-ufs (12G)
25165864 8388528 3 freebsd-swap (4.0G)
root at vm:/vm/test # file -s /dev/md0s1
/dev/md0s1: cannot open `/dev/md0s1' (No such file or directory)
root at vm:/vm/test # file -s /dev/md0p1
/dev/md0p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "BSD4.4 ", sectors/track 63, heads 255, sectors 66584 (volumes > 32 MB), FAT (32 bit), sectors/FAT 512, serial number 0xeb6f0ff0, label: "EFISYS "
root at vm:/vm/test # file -s /dev/md1p1
/dev/md1p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "BSD4.4 ", sectors/track 63, heads 16, sectors 532480 (volumes > 32 MB), FAT (32 bit), sectors/FAT 4096, serial number 0x1bbb0f19, label: "EFISYS "
root at vm:/vm/test # dd if=/dev/md0p1 of=/dev/md1p1 bs=10240 conv=sync
3330+0 records in
3330+0 records out
34099200 bytes transferred in 4.216594 secs (8086906 bytes/sec)
root at vm:/vm/test #
And then try to boot by qemu-system-aarch64:
root at vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu cortex-a57 -name test -bios QEMU_EFI.fd -nographic -drive if=none,format=raw,file=test.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0 -netdev tap,id=net0,ifname=tap1 -monitor none
:
(snip)
:
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2019 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 13.0-CURRENT #0 r355634: Thu Dec 12 03:50:52 UTC 2019
root at releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM 9.0.0)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
module firmware already present!
FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs
random: unblocking device.
random: entropy device external interface
MAP 13bd80000 mode 2 pages 80
MAP 13bdd0000 mode 2 pages 80
MAP 13be20000 mode 2 pages 80
MAP 13be70000 mode 2 pages 80
MAP 13bec0000 mode 2 pages 80
MAP 13bf10000 mode 2 pages 80
MAP 13bf60000 mode 2 pages 80
MAP 13bfb0000 mode 2 pages 80
MAP 13c020000 mode 2 pages 192
MAP 13c0e0000 mode 2 pages 80
MAP 13c130000 mode 2 pages 80
MAP 13c180000 mode 2 pages 80
MAP 13f4b0000 mode 2 pages 144
MAP 13f550000 mode 2 pages 288
MAP 4000000 mode 0 pages 16384
MAP 9010000 mode 0 pages 1
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 13.0.
kbd0 at kbdmux0
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 13.0.
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller> mem 0x8000000-0x800ffff,0x8010000-0x801ffff on ofwbus0
gic0: pn 0x0, arch 0x0, rev 0x0, implementer 0x0 irqs 288
gicv2m0: <ARM Generic Interrupt Controller MSI/MSIX> mem 0x8020000-0x8020fff on gic0
generic_timer0: <ARMv8 Generic Timer> irq 36,37,38,39 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 62500000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 62500000 Hz quality 1000
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
virtio_mmio0: <VirtIO MMIO adapter> mem 0xa000000-0xa0001ff irq 0 on ofwbus0
virtio_mmio1: <VirtIO MMIO adapter> mem 0xa000200-0xa0003ff irq 1 on ofwbus0
virtio_mmio2: <VirtIO MMIO adapter> mem 0xa000400-0xa0005ff irq 2 on ofwbus0
virtio_mmio3: <VirtIO MMIO adapter> mem 0xa000600-0xa0007ff irq 3 on ofwbus0
virtio_mmio4: <VirtIO MMIO adapter> mem 0xa000800-0xa0009ff irq 4 on ofwbus0
virtio_mmio5: <VirtIO MMIO adapter> mem 0xa000a00-0xa000bff irq 5 on ofwbus0
virtio_mmio6: <VirtIO MMIO adapter> mem 0xa000c00-0xa000dff irq 6 on ofwbus0
virtio_mmio7: <VirtIO MMIO adapter> mem 0xa000e00-0xa000fff irq 7 on ofwbus0
virtio_mmio8: <VirtIO MMIO adapter> mem 0xa001000-0xa0011ff irq 8 on ofwbus0
virtio_mmio9: <VirtIO MMIO adapter> mem 0xa001200-0xa0013ff irq 9 on ofwbus0
virtio_mmio10: <VirtIO MMIO adapter> mem 0xa001400-0xa0015ff irq 10 on ofwbus0
virtio_mmio11: <VirtIO MMIO adapter> mem 0xa001600-0xa0017ff irq 11 on ofwbus0
virtio_mmio12: <VirtIO MMIO adapter> mem 0xa001800-0xa0019ff irq 12 on ofwbus0
virtio_mmio13: <VirtIO MMIO adapter> mem 0xa001a00-0xa001bff irq 13 on ofwbus0
virtio_mmio14: <VirtIO MMIO adapter> mem 0xa001c00-0xa001dff irq 14 on ofwbus0
virtio_mmio15: <VirtIO MMIO adapter> mem 0xa001e00-0xa001fff irq 15 on ofwbus0
virtio_mmio16: <VirtIO MMIO adapter> mem 0xa002000-0xa0021ff irq 16 on ofwbus0
virtio_mmio17: <VirtIO MMIO adapter> mem 0xa002200-0xa0023ff irq 17 on ofwbus0
virtio_mmio18: <VirtIO MMIO adapter> mem 0xa002400-0xa0025ff irq 18 on ofwbus0
virtio_mmio19: <VirtIO MMIO adapter> mem 0xa002600-0xa0027ff irq 19 on ofwbus0
virtio_mmio20: <VirtIO MMIO adapter> mem 0xa002800-0xa0029ff irq 20 on ofwbus0
virtio_mmio21: <VirtIO MMIO adapter> mem 0xa002a00-0xa002bff irq 21 on ofwbus0
virtio_mmio22: <VirtIO MMIO adapter> mem 0xa002c00-0xa002dff irq 22 on ofwbus0
virtio_mmio23: <VirtIO MMIO adapter> mem 0xa002e00-0xa002fff irq 23 on ofwbus0
virtio_mmio24: <VirtIO MMIO adapter> mem 0xa003000-0xa0031ff irq 24 on ofwbus0
virtio_mmio25: <VirtIO MMIO adapter> mem 0xa003200-0xa0033ff irq 25 on ofwbus0
virtio_mmio26: <VirtIO MMIO adapter> mem 0xa003400-0xa0035ff irq 26 on ofwbus0
virtio_mmio27: <VirtIO MMIO adapter> mem 0xa003600-0xa0037ff irq 27 on ofwbus0
virtio_mmio28: <VirtIO MMIO adapter> mem 0xa003800-0xa0039ff irq 28 on ofwbus0
virtio_mmio29: <VirtIO MMIO adapter> mem 0xa003a00-0xa003bff irq 29 on ofwbus0
virtio_mmio30: <VirtIO MMIO adapter> mem 0xa003c00-0xa003dff irq 30 on ofwbus0
vtnet0: <VirtIO Networking Adapter> on virtio_mmio30
vtnet0: Ethernet address: 52:54:00:12:34:56
virtio_mmio31: <VirtIO MMIO adapter> mem 0xa003e00-0xa003fff irq 31 on ofwbus0
vtblk0: <VirtIO Block Adapter> on virtio_mmio31
vtblk0: 16384MB (33554432 512 byte sectors)
pcib0: <Generic PCI host controller> mem 0x4010000000-0x401fffffff on ofwbus0
pci0: <PCI bus> on pcib0
uart0: <PrimeCell UART (PL011)> mem 0x9000000-0x9000fff irq 34 on ofwbus0
uart0: console (9600,n,8,1)
pmu0: <Performance Monitoring Unit> irq 35 on ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usb_needs_explore_all: no devclass
Trying to mount root from ufs:/dev/vtbd0p2 [rw]...
CPU 0: ARM Cortex-A57 r1p0 affinity: 0
Instruction Set Attributes 0 = <CRC32,SHA2,SHA1,AES+PMULL>
Instruction Set Attributes 1 = <>
Processor Features 0 = <AdvSIMD,FP,EL1 32,EL0 32>
Processor Features 1 = <>
Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,16TB PA>
Memory Model Features 1 = <8bit VMID>
Memory Model Features 2 = <32bit CCIDX,48bit VA>
Debug Features 0 = <2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
Debug Features 1 = <>
Auxiliary Features 0 = <>
Auxiliary Features 1 = <>
WARNING: WITNESS option enabled, expect reduced performance.
Setting hostuuid: 7a897831-26ec-11ea-9a61-01c2a1d8c2f1.
Setting hostid: 0xcac3642f.
Starting file system checks:
/dev/vtbd0p2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/vtbd0p2: clean, 2678333 free (557 frags, 334722 blocks, 0.0% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Setting hostname: tbedfcaa.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: .
lo0: link state changed to UP
vtnet0: link state changed to UP
Starting Network: lo0 vtnet0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
ether 52:54:00:12:34:56
inet 192.168.1.196 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet 10Gbase-T <full-duplex>
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 192.168.1.254
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Starting syslogd.
No core dumps found.
Clearing /tmp (X related).
Updating motd:.
Mounting late filesystems:.
Security policy loaded: MAC/ntpd (mac_ntpd)
Starting ntpd.
Updating /var/run/os-release done.
Starting powerd.
powerd: no cpufreq(4) support -- aborting: No such file or directory
/etc/rc: WARNING: failed to start powerd
Performing sanity check on sshd configuration.
Starting sshd.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.
Starting default mousedmoused: unable to open /dev/psm0: No such file or directory
.
eval: cannot open /dev/ttyv*: No such file or directory
Starting background file system checks in 60 seconds.
Thu Dec 26 07:37:23 JST 2019
FreeBSD/arm64 (tbedfcaa) (ttyu0)
login: root
Password:
Dec 26 07:37:30 tbedfcaa login[811]: ROOT LOGIN (root) ON ttyu0
Last login: Thu Dec 26 07:34:01 on ttyu0
FreeBSD 13.0-CURRENT (GENERIC) #0 r355634: Thu Dec 12 03:50:52 UTC 2019
Welcome to FreeBSD!
Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories: https://www.FreeBSD.org/security/
FreeBSD Handbook: https://www.FreeBSD.org/handbook/
FreeBSD FAQ: https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums: https://forums.FreeBSD.org/
Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.
Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier
Edit /etc/motd.template to change this login announcement.
root at tbedfcaa:~ # uname -a
FreeBSD tbedfcaa 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r355634: Thu Dec 12 03:50:52 UTC 2019 root at releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
root at tbedfcaa:~ # df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/vtbd0p2 11G 1.1G 9.3G 11% /
devfs 1.0K 1.0K 0B 100% /dev
root at tbedfcaa:~ #
Wow! Booted perfectly!!! I think it seems bsdinstall take
place someting strange at install boot partition process or
/boot/boot1.efi in /usr/freebsd-dist/base.txz collapsed ?
[1] FreeBSD-13.0-CURRENT-arm64-aarch64-20191212-r355634-memstick.img
>
> >
> >
> >
> > Warner
> >
> >
> >
> >
> >
> > Best regards.
> > ---
> > Kiriyama Kazuhiko <kiri at truefc.org>
> >
> > _______________________________________________
> > freebsd-arm at freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> > To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
> >
> >
> >
> ---
> Kiriyama Kazuhiko <kiri at truefc.org>
>
More information about the freebsd-arm
mailing list