MilvusVisor has support for Raspberry Pi 4 environments. We tested "Raspberry Pi 4 Computer Model B"
To enable Raspberry Pi 4 support, you need to add raspberrypi feature flag on building binaries of hypervisor and
bootloader.
cargo xtask build -r -f raspberrypi(This step assumed that your environment is Ubuntu. Otherwise, please replace the package names to suitable.)
- Install
gcc-aarch64-linux-gnuandlibssl-dev - Clone u-boot and move into the directory
export CROSS_COMPILE=aarch64-linux-gnu-- Set configuration for Raspberry Pi 4:
make rpi_4_defconfig - Build:
make - Copy u-boot.bin
- Create boot.scr with boot script like below:
tools/mkimage -A arm64 -T script -C none -d boot.txt boot.scr
fatload mmc 0:1 ${kernel_addr_r} EFI/BOOT/BOOTAA64.EFI
bootefi ${kernel_addr_r}
fatload mmc 0:1 ${fdt_addr_r} EFI/BOOT/dtb
fdt addr ${fdt_addr_r}
fatload mmc 0:1 ${kernel_addr_r} kernel8.img
setenv kernel_comp_size ${filesize}
setenv kernel_comp_addr_r 0x3800000
booti ${kernel_addr_r} - ${fdt_addr_r}
You can build in the docker with the below shell script(When run docker, don't forget bind directory to get the output binary :) )
#!/bin/sh
apt-get update
apt-get install -y build-essential bison bc flex gcc-aarch64-linux-gnu libssl-dev git make
git clone --depth=1 https://source.denx.de/u-boot/u-boot.git
cd u-boot
export CROSS_COMPILE=aarch64-linux-gnu-
make rpi_4_defconfig
make -j`nproc`
cp u-boot.bin /path/to/bound/
cat <<"EOF" > boot.txt
fatload mmc 0:1 ${kernel_addr_r} EFI/BOOT/BOOTAA64.EFI
bootefi ${kernel_addr_r}
fatload mmc 0:1 ${fdt_addr_r} EFI/BOOT/dtb
fdt addr ${fdt_addr_r}
fatload mmc 0:1 ${kernel_addr_r} kernel8.img
setenv kernel_comp_size ${filesize}
setenv kernel_comp_addr_r 0x3800000
booti ${kernel_addr_r} - ${fdt_addr_r}
EOF
tools/mkimage -A arm64 -T script -C none -d boot.txt boot.scr
cp boot.scr /path/to/bound/Go to https://www.raspberrypi.com/software/operating-systems/ , find "Raspberry Pi OS (64-bit)" section, and download " Raspberry Pi OS with desktop" or "Raspberry Pi OS Lite". (We tested with "Raspberry Pi OS Lite")
- Write the OS image to SD: (For
example:
unxz 20XX-XX-XX-raspios-version-arm64-lite.img.xz && sudo dd if=20XX-XX-XX-raspios-version-arm64-lite.img of=/dev/mmcblk0 bs=10M status=progress) - Mount SD Card:
sudo mount /dev/mmcblk0p1 /mnt - Copy u-boot.bin:
sudo cp u-boot.bin /mnt/ - Copy MilvusVisor:
sudo cp -r /path/to/MlivusVisor/bin/EFI /mnt - Copy boot.scr:
sudo cp boot.scr /mnt/ - Modify config.txt:
sudo sed -i '/arm_64bit=1/akernel=u-boot.bin' /mnt/config.txt - Modify cmdline.txt:
sudo sed -i -e 's/console=serial0,115200 console=tty1//g' /mnt/cmdline.txt - Enable UART(
Optional):
sudo sed -i '/arm_64bit=1/adtoverlay=miniuart-bt\ncore_freq=250' /mnt/config.txt && sudo sed -i -e 's/quiet/console=ttyAMA0/g' /mnt/cmdline.txt - Unmount:
sudo umount /mnt