本文主要是介绍MacOS qemu运行loongarch linux,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
本文章参考了
https://github.com/LeisureLinux/bilibili/blob/master/scripts/qemu-busybox.sh#L205
windows qemu安装飞腾Aarch64 Loongarch64 操作系统 亲测_qemu安装arm系统-CSDN博客
https://www.cnblogs.com/missed-forest/p/17667862.html
1. 安装qemu
brew install qemu
qemu-system-loongarch64 -version
2. 下载bios文件和archlinux镜像
bios: http://mirror.nju.edu.cn/loongarch/archlinux/images/QEMU_EFI_8.1.fd
archlinux: http://mirror.nju.edu.cn/loongarch/archlinux/images/archlinux-mate-2023.05.10-loong64.qcow2.zst
注:bios和镜像可根据需要使用其它版本。
3. 解压镜像
zstd -d -o archlinux-mate-2023.05.10-loong64.qcow2 archlinux-mate-2023.05.10-loong64.qcow2.zst
4. 启动镜像
#!/usr/bin/env bash
set -ecurrentDir=$(cd $(dirname "$0") && pwd)qemu=qemu-system-loongarch64
bios=${currentDir}/QEMU_EFI_8.1.fd
disk=${currentDir}/archlinux-mate-2023.05.10-loong64.qcow2"${qemu}" -machine virt -m 8G \-smp 4,sockets=4,cores=1,threads=1 \-cpu la464-loongarch-cpu \-accel tcg,thread=multi \-bios "${bios}" \-serial stdio \-device virtio-gpu-pci \-nic user,hostfwd=tcp::2222-:22 \-device nec-usb-xhci,id=xhci,addr=0x1b \-device usb-tablet,id=tablet,bus=xhci.0,port=1 \-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \-display default,show-cursor=on \-hda "${disk}"
输入口令:loongarch
这篇关于MacOS qemu运行loongarch linux的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!