On Msys2 MINGW64
cf. https://wiki.qemu.org/Hosts/W32
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-glib2 mingw-w64-x86_64-gettext-runtime mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils mingw-w64-x86_64-pixman mingw-w64-x86_64-SDL2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-riscv64-unknown-elf-gcc mingw-w64-x86_64-gdb-multiarch git diffutils zsh vim)
Please enable Developer Mode to support soft link without Administrator permission, otherwise it prompts
Found ninja-1.12.1 at D:/msys64/usr/bin/ninja.exe
Running postconf script 'D:/ZJUI/ECE391/qemu/build/pyvenv/bin/python3.exe D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py'
Please enable Developer Mode to support soft link without Administrator permission
error making symbolic link D:/msys64/opt/toolchains/riscv/lib/libfdt.a
Traceback (most recent call last):
File "D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py", line 35, in <module>
raise e
File "D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py", line 28, in <module>
os.symlink(source, bundle_dest)
OSError: [WinError 1314] 客户端没有所需的特权。: 'D:/ZJUI/ECE391/qemu/build/subprojects/dtc/libfdt/libfdt.a' -> 'qemu-bundle/msys64/opt/toolchains/riscv/lib/libfdt.a'
./configure --prefix=/opt/toolchains/riscv --target-list=riscv32-softmmu,riscv64-softmmu --enable-gtk --enable-system --disable-werror
make -j
make install
Change zsh for MINGW session https://superuser.com/questions/961699/change-default-shell-on-msys2
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Set in mingw64.ini
:
SHELL=/usr/bin/zsh
There is no PTS on windows so use telnet instead
source:https://www.uni-koeln.de/~pbogusze/posts/QEMU_serial_console.html
qemu-system-riscv64 -machine virt -bios none -kernel cp1.elf -m 8M -nographic -serial mon:stdio -serial telnet:localhost:4321,server,nowait
Add D:\msys64\mingw64\bin
to PATH of Windows
Then telnet to attach to con1
telnet localhost 4321