Chapter 22 · Part IX
FreeBSD through U-Boot EFI
Course progress: chapter 22 is 23 of the 26 chapters written so far (numbering starts at 00)
Warm-up: three questions from earlier chapters
Answer each one in your head or on paper before you open its answer. They change on each visit.
From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
U-Boot's word
0xa9010d22faults with ISV = 0 and the exit reports IPA0x12c678. Which accesses must the VMM perform, at which addresses, and which registers change afterwards?Show answer
Bits 31:30 are
10(8-byte elements), mode10(plain offset), L = 0 (store), imm7 = 2 (times 8 = 16), Rt2 = 3, Rn = 9, Rt = 2:stp x2, x3, [x9, #16]. Two 8-byte stores,x2at the exit IPA0x12c678andx3at0x12c680(exit IPA plus the element size). No register changes except the PC, which advances by 4: offset mode has no writeback. In flash, both stores are ignored.From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
A guest's
TCR_EL1saysT0SZ = 25with 4 KiB pages. How many address bits does a walk resolve, at which levels, and which level-1 entry does the virtual address0x8008_1828use?Show answer
64 - 25 = 39 bits. A 4 KiB page leaves 12 offset bits, and each level resolves 9 bits, so 27 bits need three levels: 1, 2 and 3. The level-1 index is VA bits 38:30,
0x80081828 >> 30 = 2.From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
Why is our stage-1 walker a loop of at most four table reads instead of "follow table descriptors until you reach a page"?
Show answer
The tables are guest memory, written by the guest, so they are hostile input. A descriptor can point at its own table, or tables can form a cycle; "until a page" would never end, and recursion would exhaust the stack. The architecture never needs more than four levels (0 to 3), so the walk stops after four reads whatever the tables say, and a table outside RAM is a refusal, not a read.
From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
ldp x0, x1, [x2]faults with ISV = 0 at exit IPA0x0b00_0ff8, the last 8 bytes of the 4 KiB test device window. What does the VMM do, and what does the guest see?Show answer
The second element would be at
0x0b00_1000, outside the test device's window, so the plan is refused before any access: a pair is emulated only inside one device. The VMM injects a synchronous external abort: the guest takes a data abort at its own level (EC0x25from EL1), DFSC0x10,FAR_EL1= the faulting virtual address,x0andx1unchanged, and the PC not advanced.From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
Give the PC,
x0and what RAM holds at the first instruction for a firmware boot and for a direct Linux boot, with 512 MiB of RAM on ourvirtmachine.Show answer
Firmware boot:
PC = 0x0(the firmware's first word in flash),x0 = 0x4000_0000, and RAM holds only the DTB, at its start. Direct boot:PC = 0x4020_0000(the kernel),x0 = 0x4000_0000, and RAM holds the DTB, the kernel and the initramfs. Both start at EL1h with interrupts masked (0x3c5).From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
Why is the firmware ROM kept out of the guest-memory API, and how does the ISV = 0 path still read U-Boot's instructions from it?
Show answer
Everything that writes guest memory on the guest's behalf (virtio devices doing DMA, loaders) goes through that API; keeping the ROM out of it means no guest request can ever change the firmware. The ISV = 0 path gets a separate, read-only hook: when the PC's IPA is not RAM, it asks the ROM for one aligned, bounds-checked 4-byte word.
From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
At the U-Boot prompt on the reference, you type
mw.l 0x4000000 0xdeadbeef, thenmd.l 0x4000000 1. What doesmdprint, and what appears on standard error?Show answer
04000000: 00000000. The store was a data abort on flash bank 1, answered by the write-ignore flash device, which logsflash: ignored 4-byte write of 0xdeadbeef at offset 0x0 (flash is read-only, write 1 to this bank). The offset is 0 because each bank has its own device.From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
The ISV = 0 path has decoded
str x1, [x2], and its own walk ofx2gives an IPA different from the exit's. Why not perform the store at the walked address?Show answer
The exit's IPA is where the guest really faulted, and the hardware checked permissions only for that access. Our walk reads the tables in memory after the fault, while the hardware used its TLB: another vCPU may have rewritten the instruction or the tables since, or this vCPU may have changed a descriptor without a
TLBI, so the walk can describe a different page the guest may not even be allowed to touch. The decoded address is only a cross-check: any disagreement is refused with an injected abort.From chapter 21: Firmware: a stricter guest (U-Boot, flash, ISV=0)
The VMM emulates
ldp x3, x4, [x5], #16on a device. In what order do the accesses and register writes happen, and what if the second read fails?Show answer
Both reads happen first, on the exit IPA and exit IPA plus 8. Only then are
x3andx4written, thenx5gets its old value plus 16, then the PC advances by 4. If either read fails, no register changes at all (the reference then applies the unhandled-MMIO policy, by default a fatal stop). For pairs this rarely arises, because the plan already refused any pair not wholly inside one device window.From chapter 19: virtio-net without a networking entitlement
A guest posts a transmit chain of two readable descriptors, 12 bytes and 1600 bytes. What does our virtio-net do with it, and what goes in the used ring?
Show answer
It drops the frame and counts it in
tx_dropped: the total, 1612 bytes, is over the 1526-byte cap (a 12-byte header plus a 1514-byte frame), so nothing is allocated or sent. The chain still goes back on the used ring, with length 0, as every transmit chain does; the device never stops or resets over one bad frame.From chapter 19: virtio-net without a networking entitlement
A frame arrives from the peer while the guest's receive queue is empty. What does the device do, and which counter changes?
Show answer
It drops the frame and adds one to
rx_dropped_no_buffer, with a rate-limited warning. It never waits for the guest to post a buffer: a waiting RX thread holds the device lock, and anything the guest does that needs that lock (such as resetting the device) then waits for it, which deadlocks the VM.From chapter 19: virtio-net without a networking entitlement
A transmit chain's header starts with the bytes
00 04. Which field is non-zero, and what happens to the frame on our device?Show answer
Byte 1 is
gso_type, here 4, which asks for segmentation offload. We negotiated no offloads, so the driver must send 0 there; the device drops the frame and counts it intx_dropped. Byte 0,flags, is 0 and fine.From chapter 19: virtio-net without a networking entitlement
A guest posts a receive chain with one 64-byte writable descriptor, and a 60-byte frame arrives. What does the device write, and what does it report?
Show answer
Nothing is written: the chain needs room for 12 + 60 = 72 bytes. The device puts the chain on the used ring with length 0 and counts
rx_dropped_small. Had the buffer been 72 bytes or more, it would have written a 12-byte header (all zero exceptnum_buffers = 1) then the frame, and reported 72.From chapter 19: virtio-net without a networking entitlement
You start a VM with
--net unixgram:$T/b.sock,peer=$T/a.sock, and$T/b.sockalready exists. List the outcomes for: a regular file; a socket owned by another user; a socket another running VM is bound to; a socket left behind by a VM that crashed.Show answer
The regular file, the other user's socket and the live socket are all refused with exit code 2, before any VM exists, and left untouched. Only the last, a stale socket of yours (a test
connectfails withECONNREFUSED), is removed and bound again.From chapter 19: virtio-net without a networking entitlement
A third program binds
$T/c.sockand sends ARP frames to VM B's$T/b.sock, while B was started withpeer=$T/a.sock. What does B's guest see, and where do you look to prove it?Show answer
Nothing. B's backend compares every datagram's source path with the peer's, byte for byte, drops the mismatch and counts it in
rx_dropped_foreign(shown by--stats), with a rate-limited warning naming the sender's path. Connecting the socket would not have helped: on macOS a connected datagram socket still receives from other senders.From chapter 19: virtio-net without a networking entitlement
The device strips 10 header bytes from each transmitted frame while the driver writes 12. What destination MAC address does the receiver read for a broadcast frame?
Show answer
Two bytes too early: the last two header bytes (
num_buffers, which the driver writes as 0 on transmit) followed by the first fourffbytes, so00 00 ff ff ff ff. That is not a broadcast and not the receiver's address, so its network stack discards the frame silently; every other field is shifted by two bytes as well.From chapter 19: virtio-net without a networking entitlement
macvmmholds no networking entitlement. Does that stop a compromisedmacvmmfrom opening a connection to the internet? Why or why not?Show answer
No. On macOS an ordinary process needs no entitlement to open network connections; "no network entitlement" only says what we asked for. Stopping it takes containment: a sandbox the kernel enforces on the process (chapter 25).
vmnet.frameworkis gated by root or the restrictedcom.apple.vm.networking, but plain sockets are not.From chapter 15: Rings and a doorbell: the virtio-mmio transport
On our board, a driver reads the 32-bit word at
0x0a00_0608and gets 0. Which register of which slot is that, what must the driver conclude, and should the device tree have a node at0x0a000600?Show answer
Slots start at
0x0a00_0000and are0x200apart, so0x0a00_0600is slot 3 and offset0x008isDeviceID. 0 means "no device here": the specification says the driver MUST ignore it. There is no node, because only populated slots are listed; the empty slot still answers on the bus so that a guest which scans the fixed addresses gets a defined answer rather than an unhandled-MMIO fault.From chapter 15: Rings and a doorbell: the virtio-mmio transport
A driver writes
Status= 0, 1, 3, then0xb, and reads back0x3. What happened, and what should the driver do next?Show answer
FEATURES_OKdid not latch: the device refused the accepted feature set, because it contained a bit the device never offered or lackedVIRTIO_F_VERSION_1. The driver must treat the device as unusable (it may set FAILED) rather than carry on.From chapter 15: Rings and a doorbell: the virtio-mmio transport
A driver writes
DriverFeaturesSel= 0,DriverFeatures= 0,DriverFeaturesSel= 1,DriverFeatures= 1. Which feature bits did it accept?Show answer
Only bit 32: the selector picks which 32-bit half of the 64 feature bits a write covers, so value 1 in the high half (selector 1) is bit 32,
VIRTIO_F_VERSION_1, and the low half is empty.From chapter 15: Rings and a doorbell: the virtio-mmio transport
A guest reads 2 bytes at offset
0x000of a populated slot, then 2 bytes at offset0x100of the same slot, whose device has an 8-byte config space. What does each read return?Show answer
The first is a control register, which accepts only aligned 32-bit accesses: it reads as zero, with a rate-limited warning (RAZ/WI). The second is config space, which accepts 1, 2, 4 or 8 bytes inside the device's config length, so it returns the device's first two config bytes.
From chapter 15: Rings and a doorbell: the virtio-mmio transport
Queue 0 is not ready. The driver writes
QueueDescLow=0x10, thenQueueDescHigh=0xffff_ffff. What is the descriptor table's address, and is anything checked yet?Show answer
0xffff_ffff_0000_0010, assembled ashigh << 32 | low. Nothing about it is checked when the halves are written; the transport only records it. It is checked once, atDRIVER_OK, and this one lies far outside RAM, so the device would setDEVICE_NEEDS_RESET.From chapter 15: Rings and a doorbell: the virtio-mmio transport
Linux's 12,093-byte boot log cost 32,795 MMIO exits at the PL011, and one exit costs at least 1.4 µs. Estimate the exits and the time for one 4 KiB block sent the same way.
Show answer
32,795 / 12,093 is about 2.7 exits per byte (one write of the data register, plus reads of the flag register). 4096 × 2.7 is about 11,000 exits, and 11,000 × 1.4 µs is at least 15 ms for one block, before any real work (an MMIO exit costs more than the bare round trip chapter 03 measured).
From chapter 15: Rings and a doorbell: the virtio-mmio transport
After
DRIVER_OK, the driver selects a queue that was never made ready and writesQueueNum= 8 andQueueReady= 1. What does our transport do, and why?Show answer
It ignores both writes with a warning:
DRIVER_OKfreezes every queue register. The rings were validated atDRIVER_OK; a queue configured afterwards would have addresses nobody checked.From chapter 15: Rings and a doorbell: the virtio-mmio transport
The driver sets
DRIVER_OKwhile queue 0's used ring straddles the end of RAM. What does it read fromStatusandInterruptStatus, and what is the interrupt line doing?Show answer
Statusreads0x4f(0xfplusDEVICE_NEEDS_RESET, 64),InterruptStatusreads 2 (configuration change), and the line is high. The device was never activated; it does nothing more until the driver writes 0 toStatus.From chapter 15: Rings and a doorbell: the virtio-mmio transport
InterruptStatusis 3, and the driver writes 1 toInterruptACK. Is the line high or low afterwards?Show answer
Still high: bit 0 is cleared, bit 1 remains, and the line is level-triggered, high exactly while
InterruptStatusis not zero. It drops only when the driver also acknowledges bit 1.
Concepts you'll need
Chapters before this one: chapter 21, Firmware: a stricter guest (U-Boot, flash, ISV=0); chapter 20, SMP: many vCPUs, many threads.
- Core, taught here: compatibility of a virtual machine monitor (VMM) measured guest by guest; reading a boot transcript link by link to find which program spoke last; deciding "our machine or the guest?" from primary sources, with QEMU
virtas the reference machine; an offered feature bit as a promise a driver may refuse; recording findings in a compatibility log. - Core, from earlier: the firmware boot protocol, U-Boot and flash that ignores writes (chapter 21); one thread per virtual CPU (vCPU) and the power state coordination interface (PSCI) call
CPU_ON(chapter 20); virtio-blk and the raw disk image (chapter 18); feature negotiation (chapter 15); the device tree blob (DTB) as the VMM's promise,compatibleand theapb_pclkclock (chapter 10); the exit trace (chapter 03). - Primers (review):
uefi(boot and runtime services, the configuration table, the default path\EFI\BOOT\BOOTAA64.EFI);u-boot(standard boot,bootefi);block-storage(raw images, partitions as guest business, Apple File System clones withcp -c);primecell-ids(how Linux and FreeBSD bind a PrimeCell, and theapb_pclkclock);linux-boot-sequence(the early console and how a node finds its driver);smccc(Arm's call convention for hypervisor calls, and its feature queries). - Pointers: the FreeBSD boot chain (
loader.efi,loader(8)) and the Unix File System (UFS), an Aside; xz as a compression container, an Aside; EDK2ArmVirtQemuas the second firmware, a Production note; pointer authentication, MTE and other CPU features FreeBSD probes, one sentence (no capture shows one matters). - Forward definitions: none.
One virtio-blk device, three drivers. U-Boot's virtio driver reads the FreeBSD image, and FreeBSD's loader reads its kernel through U-Boot. In a separate run, Linux's driver reads a whole disk image through the very same device code. Then FreeBSD's own kernel driver looks at the device and says this, and never gets further:
cargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 60 --on-reset exitU-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000)FreeBSD/arm64 EFI loader, Revision 3.0FreeBSD 15.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC arm64virtio_mmio0: <VirtIO MMIO adapter> mem 0xa000000-0xa0001ff irq 6 on ofwbus0vtblk0: <VirtIO Block Adapter> on virtio_mmio0vtblk0: host requires unsupported maximum segment size featuredevice_attach: vtblk0 attach returned 45Trying to mount root from ufs:/dev/gpt/rootfs [rw,noatime]...mountroot: waiting for device /dev/gpt/rootfs...Mounting from ufs:/dev/gpt/rootfs failed with error 19. vfs.root.mountfrom=ufs:/dev/gpt/rootfs vfs.root.mountfrom.options=rw,noatime eg. ufs:/dev/da0s1a (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /) <empty line> Abort manual inputmountroot> random: unblocking device.macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)macvmm: timeout: the guest was still running after --timeout 60sThis is our VMM with one extra feature bit switched on, the way the reference shipped until the first time it booted FreeBSD. You will switch it on yourself in Deliberate breakage 2. Standard error holds no complaint from the VMM: chapter 21's five ignored flash writes, then the timeout we asked for. The device works for U-Boot's driver and for Linux's, not for FreeBSD's. Is our machine wrong, or is FreeBSD?
Chapter 18 told you how this story ends, in one sentence about the features it does not offer. Here you work out why, from primary sources, as if nobody had told you. The next guest's refusal will not come with a note.
Predict Before we chase that one, a smaller version of the same question. Remove apb_pclk from the PL011 node of our device tree and boot Linux, then FreeBSD. Which operating system complains first, and what does each print?
Write your guess and one sentence of reasoning under ## Predict in your journal. Deliberate breakage 1 runs both.
This chapter re-tests row 10 of chapter 00's problem ledger, a boot chain, with a second operating system: chapters 13 and 14 closed the row with our VMM as the bootloader, chapter 21 with U-Boot, and here FreeBSD walks the whole chain, firmware, Unified Extensible Firmware Interface (UEFI), its own loader, its kernel, on our virtio disk with two CPUs. Like chapter 21, this is an Open chapter: a brief, the tests that judge it, then the reference's path for comparison. About 6 hours in one or two sittings, most of it reading transcripts; the natural break is after the first login.
Objectives: by the end you can
- Boot the pinned FreeBSD 15.1-RELEASE arm64 image, verified by its checksum and used only through Apple File System (APFS) clones, through U-Boot's EFI path to
login:with--cpus 2, and name what each link of the chain did. - Diagnose a guest-specific failure by comparing what FreeBSD and Linux expect of our machine (the interrupt controller, the PL011's clocks, virtio-blk's features, the device tree against QEMU
virt), using primary sources rather than which guest boots. - Predict, then observe, how each guest reacts to a missing
apb_pclk, and explain the difference from their binding rules. - Record what you found in a compatibility log: how far the guest gets, the transcript and trace at any blocker, the root cause, and a ranked list of what could go wrong next.
Before you start. From the repository root, run scripts/learner start 22; it copies this chapter's journal to learner/journal/22.md. Your VMM from chapter 21 boots U-Boot to its prompt; nothing new is required of it before the first run, which is the point. As in chapter 20, our captures ran the reference from the repository root, so their paths start at .cache/. Run your own VMM from inside learner/ with the same cargo run lines, and prefix each .cache/ path with ../.
The brief
Brief. Boot stock FreeBSD 15.1-RELEASE for 64-bit Arm on your VMM, through stock U-Boot, with two vCPUs and the image on virtio-blk. Fix whatever stops it in your VMM, not in the guest. Write learner/docs/compat/freebsd.md as you go.
Acceptance. At login: type root (the image has no root password), run uname -sr, and see FreeBSD 15.1-RELEASE; shutdown -p now ends the run with exit code 0. On the way the console shows U-Boot 2026.04, FreeBSD/arm64 EFI loader and FreeBSD 15.1-RELEASE, and standard error never says unhandled MMIO, unknown SMCCC, not emulated or guest fatal.
This chapter is a SHOULD: the course promises Linux, and FreeBSD only if the evidence says so. The rule we hold ourselves to: never write "FreeBSD boots" unless the login test passed on a real Mac. For the reference, it did.
A disk image you can trust, and throw away
You need Homebrew's xz (brew install xz; scripts/setup.sh checks its version) and about 4 GB of free space. FreeBSD publishes ready-made virtual-machine images. The project pins one by its SHA-256 hash, and the fetch script refuses anything else:
scripts/fetch.sh uboot freebsdscripts/fetch.sh uboot freebsdfetch: cached u-boot-qemu-2026.04-r1.apkfetch: cached u-boot.binfetch: cached FreeBSD-15.1-RELEASE-arm64-aarch64-ufs.raw.xzfetch: cached freebsd-15.1-ufs.rawOur run found everything cached and re-hashed it. A first run downloads about 600 MB, checks the hash, then unpacks it with xz into a raw disk of 6.5 GB, of which about 3.2 GB is real data. You can check the pin yourself. The hash of the download, then the project's pinned lines:
shasum -a 256 .cache/macvmm/FreeBSD-15.1-RELEASE-arm64-aarch64-ufs.raw.xz; grep -F ufs.raw.xz scripts/fetch-manifest.txt | cut -d ' ' -f 2,336028829cbd5a74a050d9964cd5fd391c9d12edca1c3d520cbcce257e1d999c8 .cache/macvmm/FreeBSD-15.1-RELEASE-arm64-aarch64-ufs.raw.xzFreeBSD-15.1-RELEASE-arm64-aarch64-ufs.raw.xz 36028829cbd5a74a050d9964cd5fd391c9d12edca1c3d520cbcce257e1d999c8freebsd-15.1-ufs.raw d7a05077131d07a17c3fb2faf803ff34edf511ddbf796c35934d6d2afc44b959The first value must equal the line for FreeBSD-15.1-RELEASE-arm64-aarch64-ufs.raw.xz in FreeBSD's own CHECKSUM.SHA256, published next to the image on download.freebsd.org. The second pin is for the unpacked file.
Aside
xz is a compression container, like the gzip inside chapter 13's zboot kernel, but denser and slower. The fetch script refuses xz 5.6.0 and 5.6.1, the two releases that shipped with a planted backdoor in 2024, and never runs anything it unpacked. See the .xz file format specification at tukaani.org/xz.
The raw file is sparse: its long runs of zeros take no space. Never boot it directly. FreeBSD writes to its disk on every boot (logs, a random seed, a check that the root partition fills the disk), so the cached file would drift from its pin. Clone it instead, once per run, into .cache/, which git ignores. cp -c makes an APFS clone (the block-storage primer): instant, and it costs only the blocks the guest changes.
cp -c .cache/macvmm/freebsd-15.1-ufs.raw .cache/f.rawcargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 240 --on-reset exit--timeout 240 stops a run that hangs; with it, exit code 5 means the timer fired, not that FreeBSD failed. Drop it when you want to explore. Delete .cache/f.raw when you are done.
The boot chain, link by link
Here is the reference, all the way to a login and back to the shell. A script typed the three commands; the capture's header says when. U-Boot's EFI text console follows every character it prints with an escape sequence that shows the cursor, so escape sequences are removed below. The one very long line in the middle is FreeBSD's boot menu, drawn with cursor moves.
cargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 240 --on-reset exitBloblist at 0 not found (err=-2)alloc space exhausted ptr 400 limit 0Bloblist at 0 not found (err=-2)U-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000)DRAM: 2 GiBusing memory 0xbe65a000-0xbf69a000 for malloc()Core: 15 devices, 9 uclasses, devicetree: boardFlash: 0 BytesLoading Environment from Flash... *** Warning - bad CRC, using default environmentIn: serial,usbkbdOut: serial,vidconsoleErr: serial,vidconsoleNo USB controllers foundNet: No ethernet found.Hit any key to stop autoboot: 2Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0Scanning for bootflows in all bootdevsSeq Method State Uclass Part Name Filename--- ----------- ------ -------- ---- ------------------------ ----------------Scanning global bootmeth 'efi_mgr':No EFI variables loadedMissing TPMv2 device for EFI_TCG_PROTOCOLMissing RNG device for EFI_RNG_PROTOCOL 0 efi_mgr ready (none) 0 <NULL> ** Booting bootflow '<NULL>' with efi_mgrBooting: Label: virtio 0 Device path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)Consoles: EFI console Reading loader env vars from /efi/freebsd/loader.envSetting currdev to disk0p1:FreeBSD/arm64 EFI loader, Revision 3.0 Command line arguments: loader.efi Image base: 0xbd460000 EFI version: 2.110 EFI Firmware: Das U-Boot (rev 8230.1024) Console: efi,comconsole (0) Load Path: /\EFI\BOOT\BOOTAA64.EFI Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418) BootCurrent: 0000 BootOrder: 0000[*] BootInfo Path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)Ignoring Boot0000: Only one DP foundTrying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418)Setting currdev to disk0p1:|\x08Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(2,GPT,155e46ae-665c-11f1-1d08-61407e6af4da,0x1043a,0x200000)Setting currdev to disk0p2:/\x08Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(3,GPT,155e46ae-665c-11f1-17a5-d14fff7c5968,0x21043a,0xa00000)Setting currdev to disk0p3:-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x08Loading /boot/defaults/loader.confLoading /boot/defaults/loader.confLoading /boot/device.hintsLoading /boot/loader.conf|\x08Loading /boot/loader.conf.local/\x08-\x08c\\x08|\x08 ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ╔╚╗╝════════════════════════════════════════════════════════════════════════════║║║║║║║║║║║║║║║║║║║║║║║║║║ Welcome to FreeBSD ++++----------------------------------------------------------------------------|||||||||||||||||||||||||| Welcome to FreeBSD 1. Boot Multi user [Enter]2. Boot Single user3. Escape to loader prompt4. Reboot5. Cons: VideoKernel:/\x08-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x086. kernel (1 of 1)Options:7. Boot OptionsAutoboot in 10 seconds. [Space] to pause Autoboot in 9 seconds. [Space] to pause Autoboot in 8 seconds. [Space] to pause Autoboot in 7 seconds. [Space] to pause Autoboot in 6 seconds. [Space] to pause Autoboot in 5 seconds. [Space] to pause Autoboot in 4 seconds. [Space] to pause Autoboot in 3 seconds. [Space] to pause Autoboot in 2 seconds. [Space] to pause Autoboot in 1 seconds. [Space] to pause Autoboot in 0 seconds. [Space] to pause Loading kernel...|\x08/boot/kernel/kernel text=0x318 text=0xa7d088 /\x08-\x08\\x08|\x08/\x08-\x08text=0x284f00 \\x08data=0x16c978 |\x08data=0x0+0x2c2000 0x8+0x1625d0+0x8+0x18bc59/\x08Loading configured modules...-\x08can't find '/boot/entropy'can't find '/etc/hostid'Using DTB provided by EFI at 0xbd600000.\\x08Loading splash okLoading shutdown splash ok---<<BOOT>>---WARNING: Cannot find freebsd,dts-version property, cannot check DTB complianceCopyright (c) 1992-2025 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.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC arm64FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)VT: init without driver.real memory = 2147483648 (2048 MB)avail memory = 2074775552 (1978 MB)Starting CPU 1 (1)FreeBSD/SMP: Multiprocessor System Detected: 2 CPUsarc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.random: entropy device external interfacekbd0 at kbdmux0ofwbus0: <Open Firmware Device Tree>psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0smccc0: <ARM SMCCC v1.1> on psci0cpulist0: <Open Firmware CPU Group> on ofwbus0cpu0: <Open Firmware CPU> on cpulist0gic0: <ARM Generic Interrupt Controller v3.0> mem 0x8000000-0x800ffff,0x80a0000-0x80dffff on ofwbus0generic_timer0: <ARMv8 Generic Timer> irq 0,1,2,3 on ofwbus0Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000smbios0: <System Management BIOS>smbios0: Entry point: v3 (64-bit), Version: 3.7uart0: <PrimeCell UART (PL011)> mem 0x9000000-0x9000fff irq 4 on ofwbus0uart0: console (115200,n,8,1)pl0310: <PL031 RTC> mem 0x9010000-0x9010fff irq 5 on ofwbus0pl0310: registered as a time-of-day clock, resolution 1.000000svirtio_mmio0: <VirtIO MMIO adapter> mem 0xa000000-0xa0001ff irq 6 on ofwbus0vtblk0: <VirtIO Block Adapter> on virtio_mmio0vtblk0: 6176MB (12649563 512 byte sectors)armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>Timecounters tick every 1.000 msecusb_needs_explore_all: no devclassCPU 0: Apple Unknown CPU r0p0 (midr: 610f0000) affinity: 0 Cache Type = <IDC,64 byte CWG,64 byte ERG,64 byte D-cacheline,PIPT I-cache,64 byte I-cacheline,0x900000000> Instruction Set Attributes 0 = <TLBI-OSR,CondM-8.5,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL> Instruction Set Attributes 1 = <I8MM,EBF16,PredInv v8.9,SB,FRINTTS,GPI,RCPC-8.4,FCMA,JSCVT,Impl PAuth+FPAC+Combined,DCCVADP> Instruction Set Attributes 2 = <RPRES> Processor Features 0 = <CSV3,CSV2,PSTATE.DIT,RAS,GIC,AdvSIMD+HP,FP+HP,EL1,EL0> Processor Features 1 = <MTE_frac,CSV2 p2,SME2,BTI> Processor Features 2 = <> Memory Model Features 0 = <ExS,TGran4,TGran16,16bit ASID,1TB PA> Memory Model Features 1 = <AFP,XNX,SpecSEI,EPAN,LO,HPD+TTPBHA,8bit VMID> Memory Model Features 2 = <E0PD,TTL,IDS,AT,NV v8.4,32bit CCIDX,48bit VA,IESB,UAO,CnP> Memory Model Features 3 = <> Memory Model Features 4 = <> Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,Debugv8> Debug Features 1 = <> Auxiliary Features 0 = <> Auxiliary Features 1 = <>AArch32 Instruction Set Attributes 5 = <>AArch32 Media and VFP Features 0 = <>AArch32 Media and VFP Features 1 = <>CPU 1: Apple Unknown CPU r0p0 (midr: 610f0000) affinity: 1gic0: using for IPIsRelease APs...doneTCP_ratelimit: Is now initializedTrying to mount root from ufs:/dev/gpt/rootfs [rw,noatime]...random: randomdev_wait_until_seeded unblock waitrandom: unblocking device.Setting hostuuid: deac865b-a76e-41e6-9e8e-49d403a9276f.Setting hostid: 0xda939c4c.Starting file system checks:/dev/gpt/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS/dev/gpt/rootfs: clean, 699397 free (5 frags, 87424 blocks, 0.0% fragmentation)/dev/gpt/efiboot0: FILESYSTEM CLEAN; SKIPPING CHECKSGrowing root partition to fill devicevtbd0 recovering is not neededvtbd0p3 resizedgrowfs: requested size 5.0GB is equal to the current filesystem size 5.0GBMounting local filesystems:.Setting up harvesting: RANDOMDEV,[CALLOUT],[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHEDFeeding entropy: .ELF ldconfig path: /lib /usr/lib /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkgSetting hostname: freebsd.lo0: link state changed to UPStarting Network: lo0.lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 groups: lo nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>Starting devd.route: message indicates error: File existsadd host 127.0.0.1: gateway lo0 fib 0: route already in tableroute: message indicates error: File existsadd host ::1: gateway lo0 fib 0: route already in tableadd net fe80::: gateway ::1add net ff02::: gateway ::1add net ::ffff:0.0.0.0: gateway ::1add net ::0.0.0.0: gateway ::1Clearing /tmp (X related).Updating motd:.Updating /var/run/os-release done.Creating and/or trimming log files.Starting syslogd.Mounting late filesystems:.Starting cron.Starting background file system checks in 60 seconds.Fri Nov 20 10:00:32 UTC 2026FreeBSD/arm64 (freebsd) (ttyu0)login: rootFreeBSD 15.1-RELEASE (GENERIC) releng/15.1-n283562-96841ea08dcfWelcome 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/Nov 20 10:00:58 freebsd login[1057]: ROOT LOGIN (root) ON ttyu0Questions List: https://www.FreeBSD.org/lists/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-docFor other languages, replace "en" with a language code like de or fr.Show the version of FreeBSD installed: freebsd-version ; uname -aPlease include that output and any error messages when posting questions.Introduction to manual pages: man manFreeBSD directory layout: man hierTo change this login announcement, see motd(5).resizewin: timeout reading from terminalroot@freebsd:~ # uname -srFreeBSD 15.1-RELEASEroot@freebsd:~ # shutdown -p nowShutdown NOW!shutdown: [pid 1062]root@freebsd:~ # \x07*** FINAL System shutdown message from root@freebsd *** System going down IMMEDIATELY Stopping cron.Waiting for PIDS: 1000.Stopping devd.Waiting for PIDS: 537.Writing entropy file: .Writing early boot entropy file: ..TerminatedNov 20 10:01:06 freebsd syslogd: exiting on signal 15Waiting (max 60 seconds) for system process `vnlru' to stop... doneWaiting (max 60 seconds) for system process `syncer' to stop... Syncing disks, vnodes remaining... 0 doneAll buffers synced.Uptime: 36smacvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)Read it as four programs taking turns, each handing the next what it needs. Only macvmm runs on the host; the other three run inside the guest:
host | guest macvmm | U-Boot (flash) loader.efi (RAM) FreeBSD kernel ------ | -------------- ---------------- -------------- DTB at RAM -|> copies the DTB, base, PC=0 | finds the disk, | runs BOOTAA64.EFI -> reads UFS through | U-Boot's block I/O, | DTB from the EFI -> attaches drivers | config table from the DTB <- PSCI SYSTEM_OFF <- U-Boot's EFI ResetSystem <----------- shutdown -p nowEach arrow is a hand-over; the last line runs right to left, back through U-Boot's code and across the line into the host.
- U-Boot starts from flash exactly as in chapter 21. Its countdown expires, and standard boot scans for something to run. The
efi_mgrmethod finds no stored EFI boot entries (No EFI variables loaded: our flash forgets every write, so every boot is a first boot), and falls back to the default path theuefiprimer described:\EFI\BOOT\BOOTAA64.EFIon the first disk's EFI system partition (ESP). - That file is FreeBSD's loader.efi. It reports its firmware as
Das U-Bootand its EFI version as2.110, the specification's way of writing 2.11. It tries each partition (disk0p1,disk0p2,disk0p3), finds FreeBSD's file system on the third, reads its settings, waits ten seconds at its menu, and loads/boot/kernel/kernel. Using DTB provided by EFI at 0xbd600000: the loader hands the kernel the device tree it found in the UEFI configuration table. U-Boot put it there: our DTB, copied and lightly edited by U-Boot (it fixes up the memory node and/chosen). That answers chapter 21's open question for this chain.- The kernel attaches what our tree describes, each on
ofwbus0, FreeBSD's name for the device-tree bus:psci0;gic0(the interrupt controller) at our distributor and redistributor addresses;generic_timer0at 24 MHz;uart0on the PL011;pl0310on the real-time clock;virtio_mmio0andvtblk0. It starts CPU 1 (Multiprocessor System Detected: 2 CPUs) and mounts root from/dev/gpt/rootfs, the partition labelledrootfsin the disk's GUID partition table (GPT: the standard list of a disk's partitions, each named by a globally unique identifier). Thengetty, the program that printslogin:and waits for a user, runs onttyu0, FreeBSD's name for its first serial port, here our PL011. shutdown -p nowpowers off, andmacvmmexits 0.
Aside
FreeBSD's boot loader, loader(8), is a small program with its own prompt and scripting; loader.efi is that program packaged to run under UEFI. It reads the kernel from a UFS (Unix File System) partition, FreeBSD's traditional file system. The manual pages loader(8) and loader.efi(8) at man.freebsd.org describe both.
The kernel also prints the CPU's feature registers: PAuth (pointer authentication), MTE_frac (part of the memory tagging extension), SME2. A guest may probe such features and use them; in this boot none of them caused any trouble, so we leave them there.
Try it
Stop at the loader's own prompt. Boot again, and while the menu counts down, press 3 (Escape to loader prompt). At OK, type lsdev, then lsefi, and press space to page through it. Look for the words block io: whose code does the loader call when it reads the disk? Afterwards, type boot to carry on, or press Ctrl-A x to quit (exit code 130, chapter 09).
cargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 40 --on-reset exit/\x08-\x08c\\x08|\x08 ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ╔╚╗╝════════════════════════════════════════════════════════════════════════════║║║║║║║║║║║║║║║║║║║║║║║║║║ Welcome to FreeBSD ++++----------------------------------------------------------------------------|||||||||||||||||||||||||| Welcome to FreeBSD 1. Boot Multi user [Enter]2. Boot Single user3. Escape to loader prompt4. Reboot5. Cons: VideoKernel:/\x08-\x08\\x08|\x08/\x08-\x08\\x08|\x08/\x08-\x08\\x086. kernel (1 of 1)Options:7. Boot OptionsAutoboot in 10 seconds. [Space] to pause Autoboot in 9 seconds. [Space] to pause Autoboot in 8 seconds. [Space] to pause Autoboot in 7 seconds. [Space] to pause Autoboot in 6 seconds. [Space] to pause Autoboot in 5 seconds. [Space] to pause Exiting menu!Type '?' for a list of commands, 'help' for more detailed help.OK lsdevdisk devices: disk0: 12649563 X 512 blocks disk0p1: EFI disk0p2: FreeBSD swap disk0p3: FreeBSD UFShttp: (unknown)net devices:OK lsefiHandle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b) device path device path to text 0379be4e-d706-437d-b037-edb82fb772a4 e617d64c-fe08-46da-f4dc-bbd5870c7300 unicode collation2 HII string HII database HII config routing simple text output simple text input simple text ex inputHandle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/Uart(0,0,D,D) device pathHandle 0xbe67b510 driver bindingHandle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000) device path block io 8cf2f62c-bc9b-4821-808d-ec9ec421a1a0Handle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418) device path block io 8cf2f62c-bc9b-4821-808d-ec9ec421a1a0 --more-- <space> page down <enter> line down <q> quit EFI System partition simple fsHandle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(2,GPT,155e46ae-665c-11f1-1d08-61407e6af4da,0x1043a,0x200000) device path block io 8cf2f62c-bc9b-4821-808d-ec9ec421a1a0Handle for device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(3,GPT,155e46ae-665c-11f1-17a5-d14fff7c5968,0x21043a,0xa00000) device path block io 8cf2f62c-bc9b-4821-808d-ec9ec421a1a0Handle for image /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418)/\EFI\BOOT\BOOTAA64.EFI loaded image device path loaded imageOK macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)macvmm: timeout: the guest was still running after --timeout 40s(Exit code 5: our --timeout 40 stopped it at the prompt.) lsefi lists the handles U-Boot's UEFI layer offers: a text console, device paths, and block io on the whole disk and on each of its three partitions, the first of which also offers simple fs (a file system the firmware can read: the ESP). The unnamed GUID 8cf2f62c-… beside each block io is UEFI's partition-information protocol; ignore it. The last handle is the loader itself, loaded from \EFI\BOOT\BOOTAA64.EFI. The loader never touches our virtio registers. It calls U-Boot, and U-Boot's own virtio driver does the work. Keep that list in mind for journal question 3.
If yours stops. Find the last line a program printed, then read standard error. Each forbidden message points back to a chapter:
unhandled MMIOat an address: compare the address with your DTB and memory map (chapters 05, 07 and 10). Chapter 05's capture05-poke-fatalshows the message.unknown SMCCC function: your PSCI and call-convention dispatch (chapter 08, thesmcccprimer); chapter 08's probe captures show it.not emulated, orguest fatalwith an instruction word: the decoder for syndromes without ISV (chapter 21, whose opening shows U-Boot refused this way).- Silence after
Starting CPU 1:CPU_ONand the per-vCPU thread (chapter 20). We have not been able to check what this looks like with FreeBSD. vtblk0: host requires …and amountroot>prompt: your virtio-blk feature offer (chapter 18, and Deliberate breakage 2 below).
scripts/learner hint 22 gives four hints, from a nudge to the reference's files, and scripts/learner lifeline MODULE borrows one reference module (for example vmm::psci, as in chapter 08).
Good place to stop. The rest compares our machine with QEMU's, breaks it twice, reads the exit trace and writes the log.
Is our machine right? Ask a second machine
Reaching login: shows that this guest found what it needed. It does not show that our machine is correct. Linux boots on it too, but as you will see, the two read different parts of the same device tree. When a guest disagrees with us, there are three primary sources, and a vote among guests is not one of them:
- the specification of the thing the guest read: the virtio specification for a device, the device-tree bindings for a node, the Arm manuals for a register;
- the guest's own source, for what it does with what it read;
- a reference machine: QEMU's
virt, whose memory map ours copies, a machine that FreeBSD and Linux both support as it comes.
So compare our tree with QEMU's. With QEMU installed, qemu-system-aarch64 -machine virt,gic-version=3,dumpdtb=.cache/qemu.dtb -cpu max -smp 2 -m 2G writes its DTB, and our --dry-run --dtb-out .cache/ours.dtb writes ours. If you do not have QEMU, use our captures. First the nodes:
qemu-system-aarch64 --version | head -1; diff <(fdtget -l .cache/qemu.dtb / | sort) <(fdtget -l .cache/ours.dtb / | sort)QEMU emulator version 11.1.21d0< aliases5,7d3< flash@0< fw-cfg@9020000< gpio-keys10d5< pcie@1000000013,15d7< pl061@9030000< platform-bus@c000000< pmu19,49d10< virtio_mmio@a000200< virtio_mmio@a000400< virtio_mmio@a000600< virtio_mmio@a000800< virtio_mmio@a000a00< virtio_mmio@a000c00< virtio_mmio@a000e00< virtio_mmio@a001000< virtio_mmio@a001200< virtio_mmio@a001400< virtio_mmio@a001600< virtio_mmio@a001800< virtio_mmio@a001a00< virtio_mmio@a001c00< virtio_mmio@a001e00< virtio_mmio@a002000< virtio_mmio@a002200< virtio_mmio@a002400< virtio_mmio@a002600< virtio_mmio@a002800< virtio_mmio@a002a00< virtio_mmio@a002c00< virtio_mmio@a002e00< virtio_mmio@a003000< virtio_mmio@a003200< virtio_mmio@a003400< virtio_mmio@a003600< virtio_mmio@a003800< virtio_mmio@a003a00< virtio_mmio@a003c00< virtio_mmio@a003e00Every < line is a node only QEMU has: its flash (flash@0), a PCI Express host (pcie@10000000), QEMU's own configuration device (fw-cfg@9020000), a performance-monitor node (pmu), a general-purpose input/output (GPIO) controller with a power button, a platform bus for devices added on QEMU's command line (platform-bus@c000000), serial port aliases, and 31 more virtio slots. There is no > line: we describe nothing QEMU lacks. Then four properties side by side (each address and size in reg is two cells, as in chapter 10):
for f in .cache/qemu.dtb .cache/ours.dtb; do echo "== $f"; fdtget -t s $f /pl011@9000000 clock-names; fdtget $f /virtio_mmio@a000000 interrupts; fdtget -t x $f /intc@8000000 reg; fdtget -t s $f /cpus/cpu@0 compatible; done== .cache/qemu.dtbuartclk apb_pclk0 16 10 8000000 0 10000 0 80a0000 0 f60000arm,cortex-a57== .cache/ours.dtbuartclk apb_pclk0 16 40 8000000 0 10000 0 80a0000 0 40000arm,arm-v8The PL011 clocks agree. The virtio-mmio interrupt's last cell does not: QEMU says 1 (edge-triggered), we say 4 (level-high). The redistributor regions differ in size. Each vCPU needs 128 KiB of redistributor (chapter 12); ours sizes the region for the two we create (0x40000), while QEMU reserves room for 123 CPUs (0xf60000). FreeBSD's gic0 line, 0x80a0000-0x80dffff, shows it read our size. QEMU also names its CPU model, arm,cortex-a57, where we say only arm,arm-v8, an Armv8 CPU of no particular model.
Each difference is a hypothesis to test, not a bug. Ours declares level because our device drives a level line that stays high until the driver acknowledges (chapter 15); the tree tells the truth about our machine, which is its job:
/// `<GIC_SPI n IRQ_TYPE_LEVEL_HIGH>` for an SPI INTID (32..=1019, GIC spec IHI 0069 §2.2).pub fn spi_cells(intid: u32) -> Result<[u32; 3], FdtError> { match intid.checked_sub(32) { Some(n) if intid <= 1019 => Ok([GIC_SPI, n, IRQ_TYPE_LEVEL_HIGH]), _ => Err(bad(format!("INTID {intid} is not an SPI"))), }}FreeBSD 15.1 booted with every one of these differences, and so does Linux. That is a measurement for two guests. Question 1 of your journal asks which of them might matter to a third.
Breaking it on purpose
Two breaks, each a one-line change, each run against both guests. Commit your working VMM in learner/ first (git commit -am "boots FreeBSD"), make the change there, and run both guests from learner/: FreeBSD with the cargo run line above, Linux with chapter 14's cargo run line (scripts/run-linux.sh always runs the reference, never your tree). Undo each change with git checkout -- FILE before the next. Our captures come from a copy of the reference with the same one-line change.
Deliberate breakage 1: remove apb_pclk from the PL011 node. Chapter 10 gave every PrimeCell node a fixed clock named apb_pclk. Here is the PL011's call; change its clock names to &["uartclk"]:
primecell( &mut w, row(layout, PL011_BASE)?, &["arm,pl011", "arm,primecell"], &["uartclk", "apb_pclk"], with_gic,)?;Check your Predict entry. First, Linux on the reference, to know what normal looks like:
scripts/run-linux.sh --test boot --timeout 30[ 0.000000] Machine model: macvmm-virt[ 0.000000] printk: legacy bootconsole [pl11] enabled[ 0.000000] Kernel command line: console=ttyAMA0 earlycon=pl011,0x09000000 macvmm.test=boot[ 0.034637] Serial: AMBA PL011 UART driver[ 0.035153] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 13, base_baud = 0) is a PL011 rev1[ 0.035801] printk: console [ttyAMA0] enabled[ 0.035801] printk: console [ttyAMA0] enabled[ 0.036503] printk: legacy bootconsole [pl11] disabled[ 0.036503] printk: legacy bootconsole [pl11] disabledmacvmm-initramfs: ready 6.18.60-0-virt[ 0.176755] reboot: Power downThen Linux without the clock:
scripts/run-linux.sh --test boot --timeout 30[ 0.000000] Machine model: macvmm-virt[ 0.000000] printk: legacy bootconsole [pl11] enabled[ 0.000000] Kernel command line: console=ttyAMA0 earlycon=pl011,0x09000000 macvmm.test=boot[ 0.032977] Serial: AMBA PL011 UART driver[ 0.169812] Warning: unable to open an initial console.[ 0.174058] reboot: Power downThen FreeBSD without the clock, filtered to the lines that matter:
cargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 240 --on-reset exitU-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000)FreeBSD/arm64 EFI loader, Revision 3.0FreeBSD 15.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC arm64uart0: <PrimeCell UART (PL011)> mem 0x9000000-0x9000fff irq 4 on ofwbus0uart0: console (115200,n,8,1)pl0310: <PL031 RTC> mem 0x9010000-0x9010fff irq 5 on ofwbus0pl0310: registered as a time-of-day clock, resolution 1.000000slogin: rootNov 20 10:04:21 freebsd login[1057]: ROOT LOGIN (root) ON ttyu0FreeBSD 15.1-RELEASE (GENERIC) releng/15.1-n283562-96841ea08dcfShow the version of FreeBSD installed: freebsd-version ; uname -aTo change this login announcement, see motd(5).root@freebsd:~ # uname -srFreeBSD 15.1-RELEASEUptime: 37smacvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)Linux lost its console without a word about the clock or the PL011. The driver loaded (Serial: AMBA PL011 UART driver), but the device was never bound: no ttyAMA0 line, and the early console was never retired. When the kernel went to start the first program, it printed Warning: unable to open an initial console. The test program's own line, macvmm-initramfs: ready, never appeared.
The primecell-ids primer has the rule. Linux's AMBA bus (Arm's on-chip bus family) asks for a clock named apb_pclk before it reads a PrimeCell's ID registers, and without it never matches a driver. FreeBSD binds its PL011 driver by compatible and does not ask; it logged in as if nothing had changed.
What you saw: one OS silently loses its console, the other notices nothing. The misconception it exposes: "if one OS boots, the machine is correct". The tool that finds it: running every guest you claim to support, and diffing each boot log against a known-good one, because an absence never shows up as an error.
Deliberate breakage 2: offer VIRTIO_BLK_F_SIZE_MAX again. This is the opening puzzle, and it is history, not invention: the reference offered this feature until the first time it booted FreeBSD. Here is the device's offer today:
fn device_features(&self) -> u64 { let mut f = features::VERSION_1 | features::INDIRECT_DESC | blk_features::SEG_MAX | blk_features::BLK_SIZE | blk_features::FLUSH; if self.read_only { f |= blk_features::RO; } f}Add | blk_features::SIZE_MAX to the list. The feature bit promises that no single data segment (one data buffer of a request, one descriptor in chapter 18's terms) is larger than size_max, which our config space reports as 64 KiB, one bounce buffer (chapter 18).
Predict You already know who refuses. So: does the virtio specification oblige FreeBSD to accept this device, and does it oblige us to offer the bit? And U-Boot and FreeBSD's loader read this disk through whose driver: will this change touch them?
Decide before reading on; your answer to journal question 2 builds on it.
Our FreeBSD run is the opening's capture. Linux, same build, reading a disk through the same device:
scripts/run-linux.sh --test vda --disk .cache/macvmm/rootfs.img,ro --timeout 120[ 0.000000] Machine model: macvmm-virt[ 0.000000] Kernel command line: console=ttyAMA0 earlycon=pl011,0x09000000 macvmm.test=vdamacvmm-initramfs: ready 6.18.60-0-virt[ 0.146328] virtio_blk virtio0: 1/0/0 default/read/poll queues[ 0.146415] virtio_blk virtio0: [vda] 524288 512-byte logical blocks (268 MB/256 MiB)macvmm-vda: /dev/vda 524288 sectors ro=1macvmm-vda: sha256=a43f12e076f9dbd70803951713b4d4e1e77af39089a8c62e91d5eb16103b8300[ 1.090510] reboot: Power downNow diagnose it the way you would without being told. Who spoke last? Standard error holds nothing from the VMM but the flash writes and our timeout, so no exit went unhandled: whatever happened, happened inside the guest. The guest says vtblk0: host requires unsupported maximum segment size feature, then attach returned 45. FreeBSD's error 45 is EOPNOTSUPP (operation not supported), and the later error 19 is ENODEV (no such device): no disk, so no /dev/gpt/rootfs, so the mountroot prompt.
U-Boot and the loader both read fine. The loader's banner and the kernel banner in the opening capture prove the kernel came off this disk, through U-Boot's own virtio driver (the block io you saw in lsefi). Only FreeBSD's kernel driver reads our feature bits itself. Then the three sources:
- The guest's source. FreeBSD's
vtblk_attach, insys/dev/virtio/block/virtio_blk.c, refuses a device that offers VIRTIO_BLK_F_SIZE_MAX with asize_maxbelow the kernel's largest transfer, 1 MiB on arm64. Its comment says why: FreeBSD's scatter-gather lists (the lists of memory pieces that make up one transfer) merge physically adjacent pages into one segment, so it cannot promise to keep each segment small. It refuses rather than risk corrupting a transfer. - The specification. Virtio 1.2, section 5.2.3, lists the feature as one a device may offer. Nothing obliges a device to offer it, and nothing obliges a driver to work with every device.
- The reference machine. QEMU's virtio-blk does not offer it.
So nobody broke a rule. Linux and U-Boot accept the small limit, which is why they worked, and the guest that refused was reasonable. Our device was the odd one out, making a promise it never needed: chapter 18's data path copies through 64 KiB buffers piece by piece whatever the segment size. Dropping the bit cost nothing, and that is the fix in the reference.
What you saw: one guest refuses a device the others drive. The misconception: "the device works, so the guest is wrong". The tool: the guest's own message, read against its source and the specification.
Security
Dropping the feature moved a limit, it did not remove one. Without SIZE_MAX, a compliant driver may send a request larger than the 126 × 64 KiB our device accepts, and the driver is never told. Our device still enforces its own cap, answering such a request with an I/O error and staying usable, never trusting a length the guest wrote. Every limit you stop advertising must still be enforced on the device side.
What the exits say
A transcript shows what the guest chose to print. The exit trace shows what it asked of our VMM. Run the login again with a trace of the power, hypervisor-call and system-register exits:
cargo run -q -p macvmm -- run --bios .cache/macvmm/u-boot.bin --disk .cache/f.raw --mem 2G --cpus 2 --timeout 240 --on-reset exit --trace exits:.cache/t.jsonl:psci,hvc,sysregStarting CPU 1 (1)FreeBSD/SMP: Multiprocessor System Detected: 2 CPUslogin: rootShow the version of FreeBSD installed: freebsd-version ; uname -aroot@freebsd:~ # uname -srFreeBSD 15.1-RELEASEUptime: 37smacvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)sed -E s/.*"vcpu":([0-9]+).*"pc":"([^"]*)".*"(fn|sysreg)":"([^"]*)".*/vcpu \1 pc=\2 \4/ .cache/t.jsonlvcpu 0 pc=0xffff00000093242c OSLAR_EL1vcpu 0 pc=0xffff0000009d510c PSCI_CPU_ONvcpu 0 pc=0xffff0000009d510c PSCI_VERSIONvcpu 0 pc=0xffff0000009d510c PSCI_FEATURESvcpu 0 pc=0xffff0000009d510c SMCCC_VERSIONvcpu 0 pc=0xffff0000009d510c PSCI_FEATURESvcpu 0 pc=0xffff0000009d510c SMCCC_VERSIONvcpu 0 pc=0xffff0000009d510c SMCCC_ARCH_FEATURESvcpu 0 pc=0xffff0000009d510c SMCCC_ARCH_FEATURESvcpu 0 pc=0xffff0000009d510c SMCCC_ARCH_FEATURESvcpu 1 pc=0xffff0000009d510c SMCCC_ARCH_FEATURESvcpu 1 pc=0xffff000000932618 OSLAR_EL1vcpu 0 pc=0xbf69a1b8 PSCI_SYSTEM_OFFThirteen exits of those three kinds in the whole boot, and every one has a reason. Each CPU unlocks the debug OS lock once (OSLAR_EL1, a system register Hypervisor.framework hands to us). The calls come in an order you might not expect: FreeBSD starts CPU 1 with an early PSCI_CPU_ON, before its psci0 driver attaches and asks PSCI_VERSION. vCPU 1, on its own host thread (chapter 20), then makes one SMCCC_ARCH_FEATURES call of its own, the query a kernel uses to ask which optional calls exist (the smccc primer). Every call comes from the same pc because FreeBSD makes all of them through one helper, so they share one hvc instruction.
The last exit is the interesting one: PSCI_SYSTEM_OFF from pc=0xbf69a1b8. That is not a kernel address (FreeBSD's are the 0xffff… ones). It is inside U-Boot, which copied itself to the top of RAM at start-up and, as UEFI requires, marked its runtime code in the memory map it handed over as off-limits to the operating system. FreeBSD powered off by calling UEFI's runtime service ResetSystem, and U-Boot's code, still resident after the operating system took over, made the PSCI call. Firmware is not finished when the kernel starts.
Writing it down
A compatibility log answers, for one guest version on one VMM version:
- how far it gets, in one line at the top, with the date and the Mac it was run on;
- the boot chain, link by link, as you read it above;
- the latest transcript and trace, and at any blocker, the last lines before it;
- the root cause of each blocker, with the primary source that decided it;
- a ranked list of what could go wrong next. The reference's has four: boot entries cannot persist, there is no random-number device at boot (
Missing RNG device for EFI_RNG_PROTOCOL, and FreeBSD'sarc4randomwarning), the device-side request cap from the Security note, and a terminal-size query that our serial filter drops (resizewin: timeout reading from terminal, a one-second wait at login).
That list is the model for yours; the reference keeps its own record in docs/compat/freebsd.md. Write it even when everything works. The next guest, or the next FreeBSD release, starts from your list.
Production note
The other stock firmware for this machine is chapter 21's alternative, EDK2's ArmVirtQemu. As that chapter's decision weighed, it keeps its UEFI variables in the second flash bank, which must accept Common Flash Interface (CFI) write and erase commands (it may also want QEMU's configuration device); our flash ignores writes. The project's decision to start with U-Boot is docs/adr/0007-firmware-path-for-freebsd.md; booting FreeBSD through EDK2 is a stretch goal, documented and not required.
Your turn
Before the checkpoint, check in learner/:
- Your VMM boots FreeBSD from a fresh clone to
login:,uname -srprintsFreeBSD 15.1-RELEASE, andshutdown -p nowexits 0, with nothing on standard error but the flash writes. - Your journal has the Predict entry from before you ran breakage 1, and question 2 answered from the sources, not from which guest booted.
learner/docs/compat/freebsd.mdexists, with every item from the list above, including the ranked list.
Checkpoint
Checkpoint
Needs a MacRun this from the repository root:
scripts/checkpoint.sh 22You should see, as the last line:
CHECKPOINT 22 PASSIt builds your VMM, boots a fresh clone of the image in a private directory with the run line above, waits for login: , types root, uname -sr and shutdown -p now, and demands exit code 0. It removes U-Boot's escape sequences before it compares the console with its list of required lines, in order, and forbidden ones (vtblk0: host requires unsupported, mountroot>, panic: and the four standard-error messages from the brief). The reference's run:
/bin/bash -c set -euo pipefail; cp -c "<repo>/.cache/macvmm/freebsd-15.1-ufs.raw" "{out}/f.raw"; "{macvmm}" run --bios "<repo>/.cache/macvmm/u-boot.bin" --disk "{out}/f.raw" --mem 2G --cpus 2 --timeout 240 --on-reset exit | /usr/bin/perl -e '$|=1; my $c=q(); while (sysread(STDIN, my $b, 4096)) { $b = $c . $b; $c = ($b =~ s/(\e(\[[0-9;?]*)?)\z//) ? $1 : q(); $b =~ s/\e\[[0-9;?]*[A-Za-z]|\e[78]|\r//g; print $b }'Bloblist at 0 not found (err=-2)alloc space exhausted ptr 400 limit 0Bloblist at 0 not found (err=-2)U-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000)DRAM: 2 GiBusing memory 0xbe65a000-0xbf69a000 for malloc()Core: 15 devices, 9 uclasses, devicetree: boardFlash: 0 BytesLoading Environment from Flash... *** Warning - bad CRC, using default environmentIn: serial,usbkbdOut: serial,vidconsoleErr: serial,vidconsoleNo USB controllers foundNet: No ethernet found.Hit any key to stop autoboot: 2Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0Scanning for bootflows in all bootdevsSeq Method State Uclass Part Name Filename--- ----------- ------ -------- ---- ------------------------ ----------------Scanning global bootmeth 'efi_mgr':No EFI variables loadedMissing TPMv2 device for EFI_TCG_PROTOCOLMissing RNG device for EFI_RNG_PROTOCOL 0 efi_mgr ready (none) 0 <NULL> ** Booting bootflow '<NULL>' with efi_mgrBooting: Label: virtio 0 Device path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)Consoles: EFI console Reading loader env vars from /efi/freebsd/loader.envSetting currdev to disk0p1:FreeBSD/arm64 EFI loader, Revision 3.0 Command line arguments: loader.efi Image base: 0xbd460000 EFI version: 2.110 EFI Firmware: Das U-Boot (rev 8230.1024) Console: efi,comconsole (0) Load Path: /\EFI\BOOT\BOOTAA64.EFI Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418) BootCurrent: 0000 BootOrder: 0000[*] BootInfo Path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)Ignoring Boot0000: Only one DP foundTrying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(1,GPT,155e469a-665c-11f1-067b-ff9d86f8dced,0x22,0x10418)Setting currdev to disk0p1:|\u{8}Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(2,GPT,155e46ae-665c-11f1-1d08-61407e6af4da,0x1043a,0x200000)Setting currdev to disk0p2:/\u{8}Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8b00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,17008b0000000000)/HD(3,GPT,155e46ae-665c-11f1-17a5-d14fff7c5968,0x21043a,0xa00000)Setting currdev to disk0p3:-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}Loading /boot/defaults/loader.confLoading /boot/defaults/loader.confLoading /boot/device.hintsLoading /boot/loader.conf|\u{8}Loading /boot/loader.conf.local/\u{8}-\u{8}c\\u{8}|\u{8} ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ``` ` s` `.....---.......--.``` -/ +o .--` /y:` +. yo`:. :o `+- y/ -/` -o/ .- ::/sy+:. / `-- / `: :` `: :` / / .- -. -- -. `:` `:` .-- `--. .---.....----. ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ╔╚╗╝════════════════════════════════════════════════════════════════════════════║║║║║║║║║║║║║║║║║║║║║║║║║║ Welcome to FreeBSD ++++----------------------------------------------------------------------------|||||||||||||||||||||||||| Welcome to FreeBSD 1. Boot Multi user [Enter]2. Boot Single user3. Escape to loader prompt4. Reboot5. Cons: VideoKernel:/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}\\u{8}6. kernel (1 of 1)Options:7. Boot OptionsAutoboot in 10 seconds. [Space] to pause Autoboot in 9 seconds. [Space] to pause Autoboot in 8 seconds. [Space] to pause Autoboot in 7 seconds. [Space] to pause Autoboot in 6 seconds. [Space] to pause Autoboot in 5 seconds. [Space] to pause Autoboot in 4 seconds. [Space] to pause Autoboot in 3 seconds. [Space] to pause Autoboot in 2 seconds. [Space] to pause Autoboot in 1 seconds. [Space] to pause Autoboot in 0 seconds. [Space] to pause Loading kernel...|\u{8}/boot/kernel/kernel text=0x318 text=0xa7d088 /\u{8}-\u{8}\\u{8}|\u{8}/\u{8}-\u{8}text=0x284f00 \\u{8}data=0x16c978 |\u{8}data=0x0+0x2c2000 0x8+0x1625d0+0x8+0x18bc59/\u{8}Loading configured modules...-\u{8}can't find '/boot/entropy'can't find '/etc/hostid'Using DTB provided by EFI at 0xbd600000.\\u{8}Loading splash okLoading shutdown splash ok---<<BOOT>>---WARNING: Cannot find freebsd,dts-version property, cannot check DTB complianceCopyright (c) 1992-2025 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.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC arm64FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)VT: init without driver.real memory = 2147483648 (2048 MB)avail memory = 2074775552 (1978 MB)Starting CPU 1 (1)FreeBSD/SMP: Multiprocessor System Detected: 2 CPUsarc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.random: entropy device external interfacekbd0 at kbdmux0ofwbus0: <Open Firmware Device Tree>psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0smccc0: <ARM SMCCC v1.1> on psci0cpulist0: <Open Firmware CPU Group> on ofwbus0cpu0: <Open Firmware CPU> on cpulist0gic0: <ARM Generic Interrupt Controller v3.0> mem 0x8000000-0x800ffff,0x80a0000-0x80dffff on ofwbus0generic_timer0: <ARMv8 Generic Timer> irq 0,1,2,3 on ofwbus0Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000smbios0: <System Management BIOS>smbios0: Entry point: v3 (64-bit), Version: 3.7uart0: <PrimeCell UART (PL011)> mem 0x9000000-0x9000fff irq 4 on ofwbus0uart0: console (115200,n,8,1)pl0310: <PL031 RTC> mem 0x9010000-0x9010fff irq 5 on ofwbus0pl0310: registered as a time-of-day clock, resolution 1.000000svirtio_mmio0: <VirtIO MMIO adapter> mem 0xa000000-0xa0001ff irq 6 on ofwbus0vtblk0: <VirtIO Block Adapter> on virtio_mmio0vtblk0: 6176MB (12649563 512 byte sectors)armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>Timecounters tick every 1.000 msecusb_needs_explore_all: no devclassCPU 0: Apple Unknown CPU r0p0 (midr: 610f0000) affinity: 0 Cache Type = <IDC,64 byte CWG,64 byte ERG,64 byte D-cacheline,PIPT I-cache,64 byte I-cacheline,0x900000000> Instruction Set Attributes 0 = <TLBI-OSR,CondM-8.5,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL> Instruction Set Attributes 1 = <I8MM,EBF16,PredInv v8.9,SB,FRINTTS,GPI,RCPC-8.4,FCMA,JSCVT,Impl PAuth+FPAC+Combined,DCCVADP> Instruction Set Attributes 2 = <RPRES> Processor Features 0 = <CSV3,CSV2,PSTATE.DIT,RAS,GIC,AdvSIMD+HP,FP+HP,EL1,EL0> Processor Features 1 = <MTE_frac,CSV2 p2,SME2,BTI> Processor Features 2 = <> Memory Model Features 0 = <ExS,TGran4,TGran16,16bit ASID,1TB PA> Memory Model Features 1 = <AFP,XNX,SpecSEI,EPAN,LO,HPD+TTPBHA,8bit VMID> Memory Model Features 2 = <E0PD,TTL,IDS,AT,NV v8.4,32bit CCIDX,48bit VA,IESB,UAO,CnP> Memory Model Features 3 = <> Memory Model Features 4 = <> Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,Debugv8> Debug Features 1 = <> Auxiliary Features 0 = <> Auxiliary Features 1 = <>AArch32 Instruction Set Attributes 5 = <>AArch32 Media and VFP Features 0 = <>AArch32 Media and VFP Features 1 = <>CPU 1: Apple Unknown CPU r0p0 (midr: 610f0000) affinity: 1gic0: using for IPIsRelease APs...doneTrying to mount root from ufs:/dev/gpt/rootfs [rw,noatime]...TCP_ratelimit: Is now initializedrandom: randomdev_wait_until_seeded unblock waitrandom: unblocking device.Setting hostuuid: dc6be26c-5262-4f68-aa97-f708daee03e8.Setting hostid: 0xddaafb83.Starting file system checks:/dev/gpt/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS/dev/gpt/rootfs: clean, 699397 free (5 frags, 87424 blocks, 0.0% fragmentation)/dev/gpt/efiboot0: FILESYSTEM CLEAN; SKIPPING CHECKSGrowing root partition to fill devicevtbd0 recovering is not neededvtbd0p3 resizedgrowfs: requested size 5.0GB is equal to the current filesystem size 5.0GBMounting local filesystems:.Setting up harvesting: RANDOMDEV,[CALLOUT],[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHEDFeeding entropy: .ELF ldconfig path: /lib /usr/lib /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkgSetting hostname: freebsd.lo0: link state changed to UPStarting Network: lo0.lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 groups: lo nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>Starting devd.route: message indicates error: File existsadd host 127.0.0.1: gateway lo0 fib 0: route already in tableroute: message indicates error: File existsadd host ::1: gateway lo0 fib 0: route already in tableadd net fe80::: gateway ::1add net ff02::: gateway ::1add net ::ffff:0.0.0.0: gateway ::1add net ::0.0.0.0: gateway ::1Clearing /tmp (X related).Updating motd:.Updating /var/run/os-release done.Creating and/or trimming log files.Starting syslogd.Mounting late filesystems:.Starting cron.Starting background file system checks in 60 seconds.Fri Nov 20 09:57:35 UTC 2026FreeBSD/arm64 (freebsd) (ttyu0)login: rootNov 20 09:57:35 freebsd login[1057]: ROOT LOGIN (root) ON ttyu0FreeBSD 15.1-RELEASE (GENERIC) releng/15.1-n283562-96841ea08dcfWelcome 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://www.FreeBSD.org/lists/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-docFor other languages, replace "en" with a language code like de or fr.Show the version of FreeBSD installed: freebsd-version ; uname -aPlease include that output and any error messages when posting questions.Introduction to manual pages: man manFreeBSD directory layout: man hierTo change this login announcement, see motd(5).resizewin: timeout reading from terminalroot@freebsd:~ # uname -srFreeBSD 15.1-RELEASEroot@freebsd:~ # shutdown -p nowShutdown NOW!shutdown: [pid 1062]root@freebsd:~ # \u{7}*** FINAL System shutdown message from root@freebsd *** System going down IMMEDIATELY System shutdown time has arrivedNov 20 09:57:37 freebsd shutdown[1062]: power-down by root: Stopping cron.Waiting for PIDS: 1000.Stopping devd.Waiting for PIDS: 537.Writing entropy file: .Writing early boot entropy file: ..Nov 20 09:57:37 freebsd syslogd: exiting on signal 15Waiting (max 60 seconds) for system process `vnlru' to stop... doneWaiting (max 60 seconds) for system process `syncer' to stop... Syncing disks, vnodes remaining... 3 0 doneAll buffers synced.Uptime: 5smacvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x40000000 at offset 0x12c668 (flash is read-only, write 1 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c670 (flash is read-only, write 2 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c678 (flash is read-only, write 3 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 8-byte write of 0x0 at offset 0x12c680 (flash is read-only, write 4 to this bank)macvmm: warn: [vcpu0] guest: flash: ignored 4-byte write of 0x1 at offset 0xed4 (flash is read-only, write 5 to this bank)What now works:
- a second operating system boots on your VMM through firmware, UEFI and its own loader, on two CPUs, to a login, and powers off cleanly;
- you can follow a boot through four programs and say which one spoke last when it stops;
- you decide "our machine or the guest?" from the specification, the guest's source and QEMU
virt, not from which guest happens to boot; - your compatibility log says exactly how far FreeBSD gets and what could break next.
The next chapter starts from this state (the reference at the end of chapter 22).
What's next
Part X turns to macOS as a guest. Chapter 23 takes the high road first: Apple's own Virtualization.framework, which chapter 00 set aside, where Apple supplies the firmware and every device. You boot chapter 14's kernel and test initramfs on it, see a different machine's contract change the result, and list what a VMM like ours would have to provide before macOS would run on it.
Open question
The checkpoint logs in, runs one command and powers off. It never writes a file and reads it back after a reboot, never sleeps for a measured time, never runs for an hour. What evidence would convince you that a FreeBSD boot is "working" and not merely "printing"?
Spec hunt
- Virtio 1.2 specification, section 2.2 Feature Bits and section 5.2.3 (virtio-blk Feature bits): who decides which features a device offers, and what may a driver do with a device whose offer it cannot honour?
- UEFI specification 2.11, section 3.5.1.1 Removable Media Boot Behavior, and the runtime service ResetSystem(): why is FreeBSD's loader at
\EFI\BOOT\BOOTAA64.EFI, and what did U-Boot do when FreeBSD asked it to power off? - FreeBSD source,
sys/dev/virtio/block/virtio_blk.c, functionvtblk_attach, and Linux'sDocumentation/devicetree/bindings/arm/primecell.yaml: which properties and features does each guest require, and which does it ignore?