2. OverView in 4hours
● Install NetBSD/amd64 on VirtualBox
– Make earmv6hf cross-compiling toolchain
– Make RPI kernel
● Install NetBSD/earmv6hf on RPI
– Play RPI with NetBSD
– Feel difference between your favorite environment
● Copy your RPI kernel to RPI
– Update NetBSD-current kernel
● Boot RPI with your cross-compiled kernel
3. Hardwares
● Windows 10 PC with VirtualBox
● Raspberry PI
– MicroSD Card: Over 4GB class 10
– HDMI Display
– USB Keyboard/mouse
– USB power supply
– Ethernet Cable
● Internet access via Ethernet Cable
– RPI get IP address via DHCP
– RPI set time via NTP
5. VirtualBox
● NetBSD on VirtualBox
– Assign 2GB mem: Disk 10GB
● NetBSD-7.1-amd64.iso
● Set NetBSD source on /usr/src
– cd /usr
– ftp
http://cdn.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/src.tar
.gz
– tar xzvf src.tar.gz
6. NetBSD RPI Image
● on Windows
● http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry-
pi/2017-07-15-earmv6hf/2017-07-15-netbsd-raspi-
earmv6hf.img.gz
● http://www.netbsd.org/~martin/rawrite32/download.html
● Use rawrite32 to write RPI image to microSD
● Connect RPI:
● Boot
● Wait 15 min to resize partition
10. Reboot and / mount failed
● Power supply cut down failure
– make file system damaged
● Reboot but / read only access
● drop on single usermode
– df
– fsck /dev/ld0a
– reboot
● /etc/fstab
– add “log,noatime”
– man 5 fstab
11. RPI:/boot
● Kernel
– kernel.img – kernel for RPI0/1
– kernel7.img – kernel for RPI2/3
● cmdline.txt
– root=ld0a console=fb
– Add -s to boot single user mode
● config.txt
– http://elinux.org/RPiconfig
– hdmi_group=2
– hdmi_mode=16
14. Kernel cross build for RPI2
● cd /usr/src
● ./build.sh -u -U -m evbarm -a earmv6hf tools
● ./build.sh -u -U -m evbarm -a earmv6hf
kernel=RPI2
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin
● Copy netbsd.bin to RPI:/boot/kernel7.img
● Set over 2GB mem for VirtualBox,if failed
15. Kernel cross build for KOBO
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
tools
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
kernel=KOBO
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin
16. Kernel cross build for NetWalker
● cd /usr/src
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
tools
● ./build.sh -j 6 -u -U -m evbarm -a earmv7hf
kernel=NETWALKER
● Copy netbsd.bin to /boot/kernel7.img
● objdump -D netbsd.bin