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 -e

currentDir=$(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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cqdjyy01234

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值