FreeBSD on RaspberryPi 4 Model B 発動篇

- 2021/08/21 時点での追記
    - [RaspberryPi Imager](https://www.raspberrypi.org/downloads/) でダウンロードしたファイルを SD カードに書き込めることを確認しました
        - 参照: [Raspberry Pi 4B に FreeBSD 13.0-RELEASE ARM64を入れて SSDからブート](https://qiita.com/jibri/items/53529e6bf87f18e8a96a)
- 2021/05/01 時点での追記
    - 13-RELEASE 版に更新しました
        - RELEASE 版が出たので更新はひとまずこれで終わりになります
    - 4G model, 8G model ともに SD カードイメージを書き込むだけで起動できることを確認しました
    - メモリサイズも正しく認識できていることを確認しました
    - 8G model については HDMI 出力がまだうまく対応できていないようです
        - シリアルコンソールでの利用になります

[FreeBSD on RaspberryPi 4 Model B 接触篇](https://qiita.com/bsd-hacker/items/77b2d9b1c8e58e8d7a2b) から16カ月、login できるようになり、Ethernet Driver の対応も入り、[13.0-RELEASE で正式に対応されました](https://www.freebsd.org/releases/13.0R/announce/)。
ネットワークが使えるようになったことで、[RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) で [FreeBSD](https://www.freebsd.org/) をそれなりに遊べるようになってきたと思います。
正式に対応したバージョンがリリースされ、[対応アーキテクチャが Tier1 になった](https://www.freebsd.org/platforms/) ことで今後の改善も期待できます。

# 2021/05/01 時点でできること/できないこと

4G model と 8G model で確認しています。

## できることと
- SDカードからの起動
- Ethernetを使った通信
- USB ストレージの利用
    - USB ストレージ単体からの起動も可能
- USB Keyboard
    - USB Mouse は未確認
- pkg install

## まだできないこと
- 無線LAN, Bluetooth の利用
- 8G model での HDMI 出力
    - 今後改善されると思われます

# 用意するもの

- 作業用PC
- [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/)/4G 一式
- シリアルコンソールケーブル

## 作業用PC

xz形式のファイルの展開、SDカードへの書き込み、FAT領域へのアクセスができるPCならなんでも構いません。
以降はFreeBSD がinstallされているPCを前提として書いています

## [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 一式

- 本体
- 電源
- SDカード
  - 4GiB以上のサイズでClass10対応のもの

## シリアルコンソールケーブル

まだ、USB周り対応ができていないようなので、操作はシリアルコンソールを使って行います。

シリアルコンソールとしては、次のようなものがあります。
- [USB to TTL 4-pin Wire (1m) [WS-7965]](https://www.physical-computing.jp/product/1566)
- [Adafruit　ADA-954 USBシリアル変換ケーブル for Raspberry Pi USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.sengoku.co.jp/mod/sgk_cart/detail.php?code=EEHD-4WXL)

[documentation > usage > gpio](https://www.raspberrypi.org/documentation/usage/gpio/) をみて、GND, TXD(GPIO14), RXD(GPIO15) を接続します。

シリアルコンソールの設定は 115200 bps になります。

# [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) の rpi-eeprom を更新する

購入時期によっては EEPROM イメージが古い場合があります。
EEPROM イメージのバージョンは、SDカードを差さずに電源を入れると確認できます。

[RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) の EEPROM を 2020/04 版より新しいものにしてください。
2021/05/01 時点では [2021/04/29 が最新のリリース版](https://github.com/raspberrypi/rpi-eeprom/releases/tag/v2021.04.29-138a1)になります。

古い場合は [Raspberry Pi 4 boot EEPROM](https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md) の `Using Raspberry Pi Imager to update the bootloader (recommended)` の記述に従って更新してください。

# 起動用 SD カードを作成する

[RaspberryPI 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) , [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 共通 SD カードイメージを SD カードに書き込むことで [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 4G model, 8G model の起動用 SD カードを作成します。

## [RaspberryPI 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) , [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 共通 SD カードイメージを取得する

2021/04/13 に [13.0-RELEASE がリリースされました](https://www.freebsd.org/releases/13.0R/announce/)。
13.0-RELEASE から [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) がサポートされました。
SD カード用イメージは 13.0-RELEASE 以降のものを取得してください。

- [https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/](https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/)
    - [FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz](https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz)

```shell:fetch_image
fetch https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz
```

## SDカードにイメージを書き込む

Windows/MacOS/Ubunts(x86) の場合、[RaspberryPi Imager](https://www.raspberrypi.org/downloads/) を使って取得したイメージをSDカードに書き込みます。

- 参照: [Raspberry Pi 4B に FreeBSD 13.0-RELEASE ARM64を入れて SSDからブート](https://qiita.com/jibri/items/53529e6bf87f18e8a96a)

それ以外の環境では dd や [DD for Windows](https://www.si-linux.co.jp/techinfo/index.php?DD%20for%20Windows) などを使って取得したイメージをSDカードに書き込みます。

```
xzcat FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz | dd of=/dev/da0 bs=8k
```

## 4G model の場合

[RaspberryPI 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) , [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 共通 SD カードイメージがそのまま利用できるようになりました。
SDカードにイメージを書き込むだけで起動します。

## 8G model の場合

[RaspberryPI 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) , [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 共通 SD カードイメージがそのまま利用できるようになりました。
SDカードにイメージを書き込むだけで起動します。

# 作成したSDカードを差して [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) を起動する

作成した SD カードを [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) に差して起動します。

成功した場合、シリアルコンソールに boot message が出力されます。

## 起動メッセージ

### SDカードイメージを書いただけの 4G model の起動メッセージ

```shell:RaspberryPi_4B_4GB
U-Boot 2020.10 (Apr 09 2021 - 03:55:54 +0000)

DRAM:  3.9 GiB
RPI 4 Model B (0xc03112)
MMC:   mmc@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p1:
FreeBSD/arm64 EFI loader, Revision 1.1

   Command line arguments: loader.efi
   Image base: 0x39dfc000
   EFI version: 2.80
   EFI Firmware: Das U-Boot (rev 8224.4096)
   Console: comconsole (0)
   Load Path: /efi\boot\bootaa64.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0xf3941113,0x81f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0xf3941113,0x81f,0x18fa8)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0xf3941113,0x197c7,0x5e6821)
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
Loading kernel...
/boot/kernel/kernel text=0x2a8 text=0x8a7b2c text=0x1e9934 data=0x1a31c8 data=0x0+0x37f000 syms=[0x8+0x117420+0x8+0x13cea2]
Loading configured modules...
/boot/kernel/umodem.ko text=0x21a0 text=0x1450 data=0x6f0+0x10 syms=[0x8+0xf78+0x8+0xb8d]
loading required module 'ucom'
/boot/kernel/ucom.ko text=0x21bf text=0x3740 data=0x888+0x858 syms=[0x8+0x1188+0x8+0xb1b]
can't find '/boot/entropy'
can't find '/etc/hostid'

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...
Using DTB provided by EFI at 0x7ef0000.
EFI framebuffer information:
addr, size     0x3eac2000, 0x103000
dimensions     592 x 448
stride         592
masks          0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
---<<BOOT>>---
Copyright (c) 1992-2021 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-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
VT(efifb): resolution 592x448
module firmware already present!
real memory  = 4147916800 (3955 MB)
avail memory = 4023054336 (3836 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
arc4random: 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 interface
MAP 39f38000 mode 2 pages 1
MAP 39f3c000 mode 2 pages 3
MAP 39f40000 mode 2 pages 4
MAP 3b350000 mode 2 pages 16
MAP fe100000 mode 0 pages 1
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 14.0.
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 14.0.
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
ofw_clkbus0: <OFW clocks bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofw_clkbus0
clk_fixed1: <Fixed clock> on ofw_clkbus0
clk_fixed2: <Fixed clock> on ofwbus0
clk_fixed3: <Fixed clock> on ofwbus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
simplebus2: <Flattened device tree simple bus> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
simplebus3: <Flattened device tree simple bus> on ofwbus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0x7d5d2000-0x7d5d2eff on simplebus0
bcm2835_firmware0: <BCM2835 Firmware> on simplebus0
ofw_clkbus1: <OFW clocks bus> on bcm2835_firmware0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller> mem 0x40041000-0x40041fff,0x40042000-0x40043fff,0x40044000-0x40045fff,0x40046000-0x40047fff irq 30 on simplebus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 256
gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 14,15 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Raspberry Pi Firmware GPIO controller> on bcm2835_firmware0
gpiobus1: <GPIO bus> on gpio1
regfix0: Cannot set GPIO pin: 6
REGNODE_INIT failed: 6
regfix0: Cannot register regulator.
mbox0: <BCM2835 VideoCore Mailbox> mem 0x7e00b880-0x7e00b8bf irq 13 on simplebus0
gpioregulator0: <GPIO controlled regulator> on ofwbus0
generic_timer0: <ARMv8 Generic Timer> irq 4,5,6,7 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 54000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 54000000 Hz quality 1000
usb_nop_xceiv0: <USB NOP PHY> on ofwbus0
gpioc0: <GPIO controller> on gpio0
uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e2011ff irq 16 on simplebus0
uart0: console (115200,n,8,1)
spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e2041ff irq 18 on simplebus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 1 mode 0
iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 26 on simplebus0
bcm_dma0: <BCM2835 DMA Controller> mem 0x7e007000-0x7e007aff irq 31,32,33,34,35,36,37,38,39,40,41 on simplebus0
bcmwd0: <BCM2708/2835 Watchdog> mem 0x7e100000-0x7e100113,0x7e00a000-0x7e00a023,0x7ec11000-0x7ec1101f on simplebus0
gpioc1: <GPIO controller> on gpio1
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x7e300000-0x7e3000ff irq 73 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
fb0: <BCM2835 VT framebuffer driver> on simplebus0
fb0: keeping existing fb bpp of 32
fbd0 on fb0
WARNING: Device "fb" is Giant locked and may be deleted before FreeBSD 14.0.
VT: Replacing driver "efifb" with new "fb".
fb0: 592x448(592x448@0,0) 32bpp
fb0: fbswap: 1, pitch 2368, base 0x3eac2000, screen_size 1060864
sdhci_bcm1: <Broadcom 2708 SDHCI controller> mem 0x7e340000-0x7e3400ff irq 79 on simplebus1
mmc1: <MMC/SD bus> on sdhci_bcm1
pmu0: <Performance Monitoring Unit> irq 0,1,2,3 on ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
pcib0: <BCM2838-compatible PCI-express controller> mem 0x7d500000-0x7d50930f irq 80,81 on simplebus2
pcib0: hardware identifies as revision 0x304.
pci1: <PCI bus> on pcib0
pcib1: <PCI-PCI bridge> irq 91 at device 0.0 on pci1
pci2: <PCI bus> on pcib1
bcm_xhci0: <VL805 USB 3.0 controller (on the Raspberry Pi 4b)> irq 92 at device 0.0 on pci2
bcm_xhci0: 32 bytes context size, 64-bit DMA
usbus0 on bcm_xhci0
pci0: <PCI bus> on pcib0
pci0: failed to allocate bus number
device_attach: pci0 attach returned 6
genet0: <RPi4 Gigabit Ethernet> mem 0x7d580000-0x7d58ffff irq 82,83 on simplebus2
genet0: GENET version 5.0 phy 0x0000
miibus0: <MII bus> on genet0
brgphy0: <BCM54213PE 1000BASE-T media interface> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
genet0: Ethernet address: dc:a6:32:70:d8:01
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
armv8crypto0: CPU lacks AES instructions
Timecounters tick every 1.000 msec
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
usbus0: 5.0Gbps Super Speed USB v3.0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
ugen0.1: <0x1106 XHCI root HUB> at usbus0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
uhub0 on usbus0
uhub0: <0x1106 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
mmc0: No compatible cards found on bus
mmcsd0: 16GB <SDHC 00000 0.0 SN 0002E51A MFG 09/2019 by 159 TI> at mmc1 25.0MHz/4bit/65535-block
bcm2835_cpufreq0: ARM 600MHz, Core 200MHz, SDRAM 400MHz, Turbo OFF
Release APs...Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
done
CPU  0: ARM Cortex-A72 r0p3 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32>
 Instruction Set Attributes 1 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,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 = <>
CPU  1: ARM Cortex-A72 r0p3 affinity:  1
CPU  2: ARM Cortex-A72 r0p3 affinity:  2
CPU  3: ARM Cortex-A72 r0p3 affinity:  3
uhub0: 5 ports with 4 removable, self powered
Warning: no time-of-day clock registered, system time will not be set accurately
Dual Console: Serial Primary, Video Secondary
ugen0.2: <vendor 0x2109 USB2.0 Hub> at usbus0
uhub1 on uhub0
uhub1: <vendor 0x2109 USB2.0 Hub, class 9/0, rev 2.10/4.21, addr 1> on usbus0
Growing root partition to fill device
random: randomdev_wait_until_seeded unblock wait
uhub1: 4 ports with 4 removable, self powered
random: randomdev_wait_until_seeded unblock wait
random: unblocking device.
GEOM_PART: mmcsd0s2 was automatically resized.
  Use `gpart commit mmcsd0s2` to save changes or `gpart undo mmcsd0s2` to revert them.
mmcsd0s2 resized
mmcsd0s2a resized
gpart: arg0 'ufs/rootfs': Invalid argument
super-block backups (for fsck_ffs -b #) at:
 6402432, 7682880, 8963328, 10243776, 11524224, 12804672, 14085120, 15365568,
 16646016, 17926464, 19206912, 20487360, 21767808, 23048256, 24328704,
 25609152, 26889600, 28170048, 29450496, 30730944
Setting hostuuid: 30303031-3030-3030-3365-643165336237.
Setting hostid: 0x218625b4.
Starting file system checks:
/dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufs/rootfs: clean, 3061826 free (194 frags, 382704 blocks, 0.0% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Building /boot/kernel/linker.hints
Setting hostname: generic.
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
genet0: link state changed to DOWN
Starting Network: lo0 genet0.
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>
genet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether dc:a6:32:70:d8:01
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
genet0: link state changed to UP
Starting dhclient.
DHCPDISCOVER on genet0 to 255.255.255.255 port 67 interval 3
DHCPOFFER from 192.168.1.2
DHCPREQUEST on genet0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.2
bound to 192.168.1.228 -- renewal in 1800 seconds.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
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
Updating /var/run/os-release done.
Creating and/or trimming log files.
Clearing /tmp (X related).
Updating motd:.
Starting syslogd.
Mounting late filesystems:.
Generating RSA host key.
2048 SHA256:pdeCUiyBJnzUpJDptyAPDShfsN2wCl4iUBXrPUV6wYY root@generic (RSA)
Generating ECDSA host key.
256 SHA256:A7H6qSepv20kmm5y8g6s/g6tUHvUQCUQDztYt0gfFdU root@generic (ECDSA)
Generating ED25519 host key.
256 SHA256:l9wKBPgJNaWXlImje2/3U3HM2Xb6s9SvYuj/0lChaXg root@generic (ED25519)
Performing sanity check on sshd configuration.
Starting sshd.
Configuring vt: blanktime.
Starting cron.
Starting background file system checks in 60 seconds.

Fri Apr  9 06:47:11 UTC
FreeBSD/arm64 (generic) (ttyu0)

login: root
Password:
Apr  9 06:49:54 generic login[1213]: ROOT LOGIN (root) ON ttyu0
FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021

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

To change this login announcement, see motd(5).
root@generic:~ #
```

### SDカードイメージを書いただけの 8G model の起動メッセージ

```shell:RaspberryPi_4B_8GB
U-Boot 2020.10 (Apr 09 2021 - 03:55:54 +0000)

DRAM:  7.9 GiB
RPI 4 Model B (0xd03114)
MMC:   mmc@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p1:
FreeBSD/arm64 EFI loader, Revision 1.1

   Command line arguments: loader.efi
   Image base: 0x39dfc000
   EFI version: 2.80
   EFI Firmware: Das U-Boot (rev 8224.4096)
   Console: comconsole (0)
   Load Path: /efi\boot\bootaa64.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0xf3941640,0x81f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0xf3941640,0x81f,0x18fa8)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0xf3941640,0x197c7,0x5e6821)
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
Loading kernel...
/boot/kernel/kernel text=0x2a8 text=0x8a7b2c text=0x1e9934 data=0x1a31c8 data=0x0+0x37f000 syms=[0x8+0x117420+0x8+0x13cea2]
Loading configured modules...
/boot/kernel/umodem.ko text=0x21a0 text=0x1450 data=0x6f0+0x10 syms=[0x8+0xf78+0x8+0xb8d]
loading required module 'ucom'
/boot/kernel/ucom.ko text=0x21bf text=0x3740 data=0x888+0x858 syms=[0x8+0x1188+0x8+0xb1b]
can't find '/boot/entropy'
can't find '/etc/hostid'

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...
Using DTB provided by EFI at 0x7ef0000.
EFI framebuffer information:
addr, size     0x3eaf5000, 0x103000
dimensions     592 x 448
stride         592
masks          0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
---<<BOOT>>---
Copyright (c) 1992-2021 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-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
VT(efifb): resolution 592x448
module firmware already present!
real memory  = 8442884096 (8051 MB)
avail memory = 8211169280 (7830 MB)
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
arc4random: 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 interface
MAP 39f38000 mode 2 pages 1
MAP 39f3c000 mode 2 pages 3
MAP 39f40000 mode 2 pages 4
MAP 3b350000 mode 2 pages 16
MAP fe100000 mode 0 pages 1
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 14.0.
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 14.0.
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
ofw_clkbus0: <OFW clocks bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofw_clkbus0
clk_fixed1: <Fixed clock> on ofw_clkbus0
clk_fixed2: <Fixed clock> on ofwbus0
clk_fixed3: <Fixed clock> on ofwbus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
simplebus2: <Flattened device tree simple bus> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
simplebus3: <Flattened device tree simple bus> on ofwbus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0x7d5d2000-0x7d5d2eff on simplebus0
bcm2835_firmware0: <BCM2835 Firmware> on simplebus0
ofw_clkbus1: <OFW clocks bus> on bcm2835_firmware0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller> mem 0x40041000-0x40041fff,0x40042000-0x40043fff,0x40044000-0x40045fff,0x40046000-0x40047fff irq 30 on simplebus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 256
gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 14,15 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Raspberry Pi Firmware GPIO controller> on bcm2835_firmware0
gpiobus1: <GPIO bus> on gpio1
regfix0: Cannot set GPIO pin: 6
REGNODE_INIT failed: 6
regfix0: Cannot register regulator.
mbox0: <BCM2835 VideoCore Mailbox> mem 0x7e00b880-0x7e00b8bf irq 13 on simplebus0
gpioregulator0: <GPIO controlled regulator> on ofwbus0
generic_timer0: <ARMv8 Generic Timer> irq 4,5,6,7 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 54000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 54000000 Hz quality 1000
usb_nop_xceiv0: <USB NOP PHY> on ofwbus0
gpioc0: <GPIO controller> on gpio0
uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e2011ff irq 16 on simplebus0
uart0: console (115200,n,8,1)
spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e2041ff irq 18 on simplebus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 1 mode 0
iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 26 on simplebus0
bcm_dma0: <BCM2835 DMA Controller> mem 0x7e007000-0x7e007aff irq 31,32,33,34,35,36,37,38,39,40,41 on simplebus0
bcmwd0: <BCM2708/2835 Watchdog> mem 0x7e100000-0x7e100113,0x7e00a000-0x7e00a023,0x7ec11000-0x7ec1101f on simplebus0
gpioc1: <GPIO controller> on gpio1
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x7e300000-0x7e3000ff irq 73 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
fb0: <BCM2835 VT framebuffer driver> on simplebus0
fb0: keeping existing fb bpp of 32
fbd0 on fb0
WARNING: Device "fb" is Giant locked and may be deleted before FreeBSD 14.0.
VT: Replacing driver "efifb" with new "fb".
fb0: 592x448(592x448@0,0) 32bpp
fb0: fbswap: 1, pitch 2368, base 0x3eaf5000, screen_size 1060864
sdhci_bcm1: <Broadcom 2708 SDHCI controller> mem 0x7e340000-0x7e3400ff irq 79 on simplebus1
mmc1: <MMC/SD bus> on sdhci_bcm1
pmu0: <Performance Monitoring Unit> irq 0,1,2,3 on ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
pcib0: <BCM2838-compatible PCI-express controller> mem 0x7d500000-0x7d50930f irq 80,81 on simplebus2
pcib0: hardware identifies as revision 0x304.
pci1: <PCI bus> on pcib0
pcib1: <PCI-PCI bridge> irq 91 at device 0.0 on pci1
pci2: <PCI bus> on pcib1
bcm_xhci0: <VL805 USB 3.0 controller (on the Raspberry Pi 4b)> irq 92 at device 0.0 on pci2
bcm_xhci0: 32 bytes context size, 64-bit DMA
usbus0 on bcm_xhci0
pci0: <PCI bus> on pcib0
pci0: failed to allocate bus number
device_attach: pci0 attach returned 6
genet0: <RPi4 Gigabit Ethernet> mem 0x7d580000-0x7d58ffff irq 82,83 on simplebus2
genet0: GENET version 5.0 phy 0x0000
miibus0: <MII bus> on genet0
brgphy0: <BCM54213PE 1000BASE-T media interface> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
genet0: Ethernet address: dc:a6:32:b0:42:cf
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
armv8crypto0: CPU lacks AES instructions
Timecounters tick every 1.000 msec
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
usbus0: 5.0Gbps Super Speed USB v3.0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
ugen0.1: <0x1106 XHCI root HUB> at usbus0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
uhub0 on usbus0
uhub0: <0x1106 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x000001aa | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
sdhci_bcm0-slot0: Got command interrupt 0x00030000, but there is no active command.
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x000f0000 | Host ctl: 0x00000001
sdhci_bcm0-slot0: Power:    0x0000000f | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00003947
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000000
sdhci_bcm0-slot0: Int enab: 0x01ff00bb | Sig enab: 0x01ff00bb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000
sdhci_bcm0-slot0: ===========================================
mmc0: No compatible cards found on bus
mmcsd0: 16GB <SDHC 00000 0.0 SN 0002E51A MFG 09/2019 by 159 TI> at mmc1 25.0MHz/4bit/65535-block
bcm2835_cpufreq0: ARM 600MHz, Core 200MHz, SDRAM 400MHz, Turbo OFF
Release APs...Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
done
CPU  0: ARM Cortex-A72 r0p3 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32>
 Instruction Set Attributes 1 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,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 = <>
CPU  1: ARM Cortex-A72 r0p3 affinity:  1
CPU  2: ARM Cortex-A72 r0p3 affinity:  2
CPU  3: ARM Cortex-A72 r0p3 affinity:  3
uhub0: 5 ports with 4 removable, self powered
Warning: no time-of-day clock registered, system time will not be set accurately
Dual Console: Serial Primary, Video Secondary
ugen0.2: <vendor 0x2109 USB2.0 Hub> at usbus0
uhub1 on uhub0
uhub1: <vendor 0x2109 USB2.0 Hub, class 9/0, rev 2.10/4.21, addr 1> on usbus0
Growing root partition to fill device
random: randomdev_wait_until_seeded unblock wait
uhub1: 4 ports with 4 removable, self powered
random: randomdev_wait_until_seeded unblock wait
random: unblocking device.
GEOM_PART: mmcsd0s2 was automatically resized.
  Use `gpart commit mmcsd0s2` to save changes or `gpart undo mmcsd0s2` to revert them.
mmcsd0s2 resized
mmcsd0s2a resized
gpart: arg0 'ufs/rootfs': Invalid argument
super-block backups (for fsck_ffs -b #) at:
 6402432, 7682880, 8963328, 10243776, 11524224, 12804672, 14085120, 15365568,
 16646016, 17926464, 19206912, 20487360, 21767808, 23048256, 24328704,
 25609152, 26889600, 28170048, 29450496, 30730944
Setting hostuuid: 30303031-3030-3030-3538-666130316438.
Setting hostid: 0x15520ef3.
Starting file system checks:
/dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufs/rootfs: clean, 3061826 free (194 frags, 382704 blocks, 0.0% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Building /boot/kernel/linker.hints
Setting hostname: generic.
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
genet0: link state changed to DOWN
Starting Network: lo0 genet0.
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>
genet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether dc:a6:32:b0:42:cf
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
genet0: link state changed to UP
Starting dhclient.
DHCPDISCOVER on genet0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 192.168.1.2
DHCPREQUEST on genet0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.2
bound to 192.168.1.237 -- renewal in 1800 seconds.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
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
Updating /var/run/os-release done.
Creating and/or trimming log files.
Clearing /tmp (X related).
Updating motd:.
Starting syslogd.
Mounting late filesystems:.
Generating RSA host key.
2048 SHA256:JKWB00KsyoR5opVzFkb3uIYOpTuKM32rXDKb/ptV2sQ root@generic (RSA)
Generating ECDSA host key.
256 SHA256:hdbiGYChqE+oSSzM2rjQg23IDdWtZuHTpf9lqIjZusI root@generic (ECDSA)
Generating ED25519 host key.
256 SHA256:6mEKkLXy8c6h0cglaOx2UDakRZCCncUTOKvLUQ/S3Zk root@generic (ED25519)
Performing sanity check on sshd configuration.
Starting sshd.
Configuring vt: blanktime.
Starting cron.
Starting background file system checks in 60 seconds.

Fri Apr  9 06:47:09 UTC
FreeBSD/arm64 (generic) (ttyu0)

login: root
Password:
Apr  9 06:47:34 generic login[1213]: ROOT LOGIN (root) ON ttyu0
FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021

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

To change this login announcement, see motd(5).
root@generic:~ #
```

# pkg binary のインストール

ネットワークが利用できるようになったため、pkg binary のインストールもできます。

```shell:pkg_install
root@generic:~ # pkg install -y screen sudo ca_root_nss
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:aarch64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.16.3...
Extracting pkg-1.16.3: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB   6.1MB/s    00:01
Processing entries: 100%
FreeBSD repository update completed. 28965 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ca_root_nss: 3.63
        gettext-runtime: 0.21
        indexinfo: 0.3.1
        screen: 4.8.0_3
        sudo: 1.9.6p1

Number of packages to be installed: 5

The process will require 9 MiB more space.
2 MiB to be downloaded.
[1/5] Fetching screen-4.8.0_3.txz: 100%  471 KiB 482.0kB/s    00:01
[2/5] Fetching sudo-1.9.6p1.txz: 100%    1 MiB   1.3MB/s    00:01
[3/5] Fetching ca_root_nss-3.63.txz: 100%  275 KiB 282.1kB/s    00:01
[4/5] Fetching indexinfo-0.3.1.txz: 100%    5 KiB   5.4kB/s    00:01
[5/5] Fetching gettext-runtime-0.21.txz: 100%  158 KiB 161.7kB/s    00:01
Checking integrity... done (0 conflicting)
[1/5] Installing indexinfo-0.3.1...
[1/5] Extracting indexinfo-0.3.1: 100%
[2/5] Installing gettext-runtime-0.21...
[2/5] Extracting gettext-runtime-0.21: 100%
[3/5] Installing screen-4.8.0_3...
[3/5] Extracting screen-4.8.0_3: 100%
[4/5] Installing sudo-1.9.6p1...
[4/5] Extracting sudo-1.9.6p1: 100%
[5/5] Installing ca_root_nss-3.63...
[5/5] Extracting ca_root_nss-3.63: 100%
=====
Message from screen-4.8.0_3:

--
As of GNU Screen 4.4.0:

Note that there was fix to screen message structure field
responsible for $TERM handling, making it impossible
to attach to older versions.
=====
Message from ca_root_nss-3.63:

--
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.


This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem
root@generic:~ #
```

```shell:pkg_info
root@generic:~ # pkg info
ca_root_nss-3.63               Root certificate bundle from the Mozilla Project
gettext-runtime-0.21           GNU gettext runtime libraries and programs
indexinfo-0.3.1                Utility to regenerate the GNU info page index
pkg-1.16.3                     Package manager
screen-4.8.0_3                 Multi-screen window manager
sudo-1.9.6p1                   Allow others to run commands as root
root@generic:~ #
```

# USB ストレージを接続

```
root@generic:~ # usbconfig list
ugen0.1: <0x1106 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x2109 USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.3: <ASMT ASM105x> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (0mA)
root@generic:~ #
```

```
root@generic:~ # camcontrol devlist
<ASMT ASM105x 0>                   at scbus0 target 0 lun 0 (da0,pass0)
root@generic:~ #
```

```
root@generic:~ # gpart list da0
gpart: Class 'PART' does not have an instance named 'da0'.
root@generic:~ # gpart create -s GPT da0
da0 created
root@generic:~ # gpart list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 976773127
first: 40
entries: 128
scheme: GPT
Consumers:
1. Name: da0
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r0w0e0

root@generic:~ # gpart add -t efi -a 8k -s 50M -l rpi4-boot da0
da0p1 added
root@generic:~ # gpart add -t freebsd-swap -a 8k -s 8g -l rpi4-swap00 da0
da0p2 added
root@generic:~ # gpart add -t freebsd-swap -a 8k -s 8g -l rpi4-swap01 da0
da0p3 added
root@generic:~ # gpart add -t freebsd-zfs -a 8k -s 64g -l rpi4-zroot00 da0
da0p4 added
root@generic:~ # gpart list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 976773127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: da0p1
   Mediasize: 52428800 (50M)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 24576
   Mode: r0w0e0
   efimedia: HD(1,GPT,bda48759-d7e3-11ea-8e88-dca63270d801,0x30,0x19000)
   rawuuid: bda48759-d7e3-11ea-8e88-dca63270d801
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: rpi4-boot
   length: 52428800
   offset: 24576
   type: efi
   index: 1
   end: 102447
   start: 48
2. Name: da0p2
   Mediasize: 8589934592 (8.0G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 52453376
   Mode: r0w0e0
   efimedia: HD(2,GPT,eabfad23-d7e3-11ea-8e88-dca63270d801,0x19030,0x1000000)
   rawuuid: eabfad23-d7e3-11ea-8e88-dca63270d801
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: rpi4-swap00
   length: 8589934592
   offset: 52453376
   type: freebsd-swap
   index: 2
   end: 16879663
   start: 102448
3. Name: da0p3
   Mediasize: 8589934592 (8.0G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 8642387968
   Mode: r0w0e0
   efimedia: HD(3,GPT,ed0723b7-d7e3-11ea-8e88-dca63270d801,0x1019030,0x1000000)
   rawuuid: ed0723b7-d7e3-11ea-8e88-dca63270d801
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: rpi4-swap01
   length: 8589934592
   offset: 8642387968
   type: freebsd-swap
   index: 3
   end: 33656879
   start: 16879664
4. Name: da0p4
   Mediasize: 68719476736 (64G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17232322560
   Mode: r0w0e0
   efimedia: HD(4,GPT,05afd905-d7e4-11ea-8e88-dca63270d801,0x2019030,0x8000000)
   rawuuid: 05afd905-d7e4-11ea-8e88-dca63270d801
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: rpi4-zroot00
   length: 68719476736
   offset: 17232322560
   type: freebsd-zfs
   index: 4
   end: 167874607
   start: 33656880
Consumers:
1. Name: da0
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r0w0e0

root@generic:~ #
```

# 終わりに

[FreeBSD](https://www.freebsd.org/) [13.0-RELEASE](https://www.freebsd.org/releases/13.0R/announce/) で正式に [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) がサポートされました。
まだまだ使えないデバイスがありますが、SDカードからの起動とネットワークが利用できるようになったため、とりあえず [FreeBSD](https://www.freebsd.org/) / [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) で遊べるようになりました。

4G model, 8G model ともに SD カードイメージを書き込むだけで起動することを確認できました。
メモリサイズも正しく認識できていることを確認できました。

最新の情報が気になる方は、[FreeBSD armRaspberry Pi](https://wiki.freebsd.org/arm/Raspberry%20Pi) や [freebsd-arm ML](https://docs.freebsd.org/mail/current/freebsd-arm.html) をチェックしてみてください。

[FreeBSD on RaspberryPi 4 Model B 接触篇](https://qiita.com/bsd-hacker/items/77b2d9b1c8e58e8d7a2b) から ほぼ一年半、これで塩漬け状態だった [RaspberryPi 4 Model B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) で遊べそうです。

正式版がリリースされ、SD カードイメージを書き込むだけで起動できるため、「とりあえず [FreeBSD](https://www.freebsd.org/) を触ってみよう」という人も手を出しやすくなったのではないでしょうか。

# おまけ

公式が提供している SD カードイメージは xz で圧縮されていますが、これを一回展開して、zip でアーカイブしなおしておくと [RaspberryPi Imager](https://www.raspberrypi.org/downloads/) で書き込みが行えるようになります。
一度 zip ファイルに変換しておくと xz がない Windows マシンでも SD カードに書き込みができるようになるので便利だと思います。

```shell:convert_xz_to_zip
root@generic:~ # ntpdate ntp.jst.mfeed.ad.jp
 1 May 10:14:03 ntpdate[1782]: adjust time server 210.173.160.87 offset -0.029190 sec
root@generic:~ #
root@generic:~ # pkg install -y zip ca_root_nss
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ca_root_nss: 3.63
        zip: 3.0_1

Number of packages to be installed: 2

The process will require 1 MiB more space.
275 KiB to be downloaded.
[1/1] Fetching ca_root_nss-3.63.txz: 100%  275 KiB 282.1kB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing zip-3.0_1...
[1/2] Extracting zip-3.0_1: 100%
[2/2] Installing ca_root_nss-3.63...
[2/2] Extracting ca_root_nss-3.63: 100%
=====
Message from ca_root_nss-3.63:

--
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.


This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem
root@generic:~ #
root@generic:~ # fetch https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz
FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz          443 MB 5550 kBps 01m21s
root@generic:~ #
root@generic:~ # xz -d -v FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz
FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz (1/1)
  100 %      443.1 MiB / 3072.0 MiB = 0.144    11 MiB/s       4:32
root@generic:~ #
oot@generic:~ # zip -v FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.zip FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img
  adding: FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img ....................................................................................................................................................................................................................................................................................................................       (in=3221225472) (out=764456253) (deflated 76%)
total bytes=3221225472, compressed=764456253 -> 76% savings
root@generic:~ #
root@generic:~ # unzip -l FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.zip
Archive:  FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
 3221225472  04-09-21 06:46   FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img
root@generic:~ #
```

作った unofficial な zip ファイルを転がしておきます。

- [unofficial 13.0-RELEASE files](https://github.com/bsd-hacker/freebsd_unofficial_files/releases/tag/13.0-RELEASE)
    - [FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.zip](https://github.com/bsd-hacker/freebsd_unofficial_files/releases/download/13.0-RELEASE/FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.zip)