VMware Fusion 发布了新版本 22H2,有官方的 Windows 11 on ARM 支持了:
Windows 11 on Intel and Apple Silicon with 2D GFX and Networking
VMtools installation for Windows 11 GOS on M1
Improved Linux support on M1
3D Graphics HW Acceleration and OpenGL 4.3 in Linux VMs* (Requires Linux 5.19+ & Mesa 22.1.3+)
Virtual TPM Device
Fast Encryption
Universal Binary
并且不需要上面写的网卡的 workaround 了:
vmxnet3 Networking Drivers for Windows on ARM
While Windows does not yet ship with our vmxnet3 networking driver for
Windows on ARM as it now does for Intel, the VMware Tools ISO on ARM
contains the 2 currently supported drivers for graphics and networking.
/** * Address Map * 0x00 - serial out FIFO data * 0x04 - serial out FIFO data available (words) * 0x08 - serial in FIFO data * 0x0C - serial in FIFO space available (words) * 0x10 - system reset * 0x20 - req FIFO data * 0x24 - req FIFO data available (words) * 0x28 - data FIFO data * 0x2C - data FIFO data available (words) * 0x30 - resp FIFO data * 0x34 - resp FIFO space available (words) * 0x38 - nsectors * 0x3C - max request length */
之前省略没说的是上面的第二点,就是让 Rocket Chip 也可以拿到内存用。那问题来了,怎么让 Rocket Chip 和 ARM 上的 Linux 不要打架?把地址空间分成两块就好了:
wire[31:0]mem_araddr;wire[31:0]mem_awaddr;// Memory given to Rocket is the upper 256 MB of the 512 MB DRAMassignS_AXI_araddr={4'd1,mem_araddr[27:0]};assignS_AXI_awaddr={4'd1,mem_awaddr[27:0]};
做了一个 Windows 10 安装 U 盘,想测试一下能不能启动,于是想用 VirtualBox 起一个虚拟机。但是发现,一般情况下要从 ISO 或者把 U 盘克隆成一个 vdi/vmdk etc 再启动。不过找到了 Cem Arslan 的 VirtualBox - Booting From USB (MAC) 实验了一下,确实可以用,以 /dev/disk2 为例方法如下:
$diskutilunmountDisk/dev/disk2
$sudochown$(whoami)/dev/disk2
$VBoxManageinternalcommandscreaterawvmdk-filenamePATH_TO_VMDK-rawdisk/dev/disk2
$# Now boot from VirtualBox
$cathello.c
#include <stdio.h>#include <unistd.h>intmain(){for(;;){printf("Hello, world!\n");}}$gcc-statichello.c-oinit
$echoinit|cpio-o-Hnewc|gzip>initrd
$qemu-system-x86_64-kernel/boot/vmlinuz-linux-initrdinitrd-nographic-append'console=ttyS0'# Use C-a c q u i t <Enter> to exit
接下来,按照教程,先解锁 bootloader。连接手机,进入 USB Debugging Mode,重启进入 bootloader 并且解锁:
$adbrebootbootloader
$fastbootflashingunlock
# Confirm unlocking, and then the data should be wiped
接下来刷入 TWRP。还是进入 bootloader,然后刷入。
$ fastboot flash recovery twrp-3.2.1-0-angler.img
# Select recovery, and enter it
进入 TWRP 后,把我们刚刚下载的 zip 文件都 push 到手机上,并用 TWRP 安装:
# Select Wipe -> Advanced Wipe, Select Cache, System and Data and wipe then
# Install lineageos, opengapps, addonsu and follow on-screen instructions
# Reboot into system
为了测试一个硬件的 terminal,想在 Windows 上向串口开一个 tty,跑各种软件来测试。这件事情在 Linux 上和 macOS 上都有实践,但一直不知道 Windows 上怎么搞。经过了一番搜索,找到了 https://blogs.msdn.microsoft.com/wsl/2017/04/14/serial-support-on-the-windows-subsystem-for-linux/ 和 https://unix.stackexchange.com/a/123559 的方案。