PolyOS 是面向 RISC-V 架构的智能终端和 AIoT 开源操作系统(基于开源鸿蒙)

news/2025/2/23 6:47:54

PolyOS 是面向 RISC-V 架构的智能终端和 AIoT 开源操作系统

官网:PolyOS | PolyOS

PolyOS Mobile,作为一款面向 RISC-V 架构的智能终端操作系统,我们希望能够构建卓越的特性和创新的生态系统来引领未来移动操作系统技术的发展。该操作系统基于开源项目 OpenHarmony,旨在为 RISC-V 潜在的硬件和软件市场构建一个强大的移动操作系统和生态系统。

当前特性与目标​

PolyOS Mobile 是一个处在早期阶段的社区驱动项目,我们目前的特性请求界面还在建设当中,但我们已经有了一些短期和长期未来工作目标。

丰富的虚拟化支持​

目前,PolyOS Mobile 以 QEMU 虚拟化平台为硬件基础,我们正在努力为开发者提供一个强大的开发和测试环境。我们希望帮助开发者可以在虚拟环境中轻松运行和测试他们的应用程序,从而加快开发周期,降低开发成本。

实践

该项目从2023年8月未再更新,很遗憾啊,只能浅尝即止了。

下载软件

下载:

curl --remote-name \
     --location https://polyos.iscas.ac.cn/downloads/polyos-mobile-latest.img.tar.xz

下载qemu编译包

curl --remote-name \
     --location https://polyos.iscas.ac.cn/downloads/polyos-qemu-riscv64-7.1.0-1.x86_64.deb

也可以直接到网站下载:

PolyOS Files

Linux下安装

安装qemu

sudo dpkg -i /path/to/polyos-qemu-riscv64-7.1.0-1.x86_64.deb

Linux下操作类似,可能需要手工添加一些库:

需要的库

sudo apt-get install libpixman-1-0 libepoxy0 libv4l-0 libpng16-16 \
                     libsdl2-2.0-0 libsdl2-image-2.0-0 libglib2.0-0 \
                     libasound2 libpulse0 osspd-alsa \
                     libusb-1.0-0 \
                     libncursesw5 \
                     libgtk-3-0 libgdk-pixbuf2.0-0 \
                     libx11-6
qemu-环境">(可选)配置 QEMU 环境​

您可以选择将 /opt/qemu-7.1.0 加入到您的环境变量中。

cat << EOF >> ~/.bashrc
export PATH=/opt/qemu-7.1.0/bin:$PATH
EOF
source ~/.bashrc

使用 tar 命令来解压 PolyOS Mobile 镜像文件:

tar -Jxvf /path/to/polyos-mobile-latest.img.tar.xz

启动 PolyOS Mobile​

  • 使用脚本启动
  • manual

您可以选择直接使用一个初始化脚本来启动 PolyOS Mobile,该脚本附带在镜像文件中。

sh /path/to/qemu_riscv64_run_linux.sh

手动

手动调用 /opt/qemu-7.1.0/bin/qemu-system-riscv64 的方式来启动 PolyOS Mobile。

/opt/qemu-7.1.0/bin/qemu-system-riscv64 \
    -machine virt \
    -m 8096\
    -smp 8 \
    -drive if=none,file=./updater.img,format=raw,id=updater,index=3 \
    -device virtio-blk-device,drive=updater \
    -drive if=none,file=./system.img,format=raw,id=system,index=2 \
    -device virtio-blk-device,drive=system \
    -drive if=none,file=./vendor.img,format=raw,id=vendor,index=1 \
    -device virtio-blk-device,drive=vendor \
    -drive if=none,file=./userdata.img,format=raw,id=userdata,index=0 \
    -device virtio-blk-device,drive=userdata \
    -append "ip=dhcp loglevel=7 console=ttyS0,115200 init=init root=/dev/ram0 rw rootwait ohos.boot.hardware=riscv64_virt default_boot_device=10007000.virtio_mmio sn=8823456789 ohos.required_mount.system=/dev/block/vdb@/usr@ext4@ro,barrier=1@wait,required ohos.required_mount.vendor=/dev/block/vdc@/vendor@ext4@ro,barrier=1@wait,required ohos.required_mount.data=/dev/block/vdd@/data@ext4@nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc@wait,reservedsize=104857600" \
    -kernel ./Image \
    -initrd ./ramdisk.img \
    -nographic \
    -vga none \
    -device virtio-gpu-pci,xres=550,yres=920,max_outputs=1,addr=08.0 \
    -vnc :20 \
    -device virtio-mouse-pci \
    -netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
    -device virtio-net-pci,netdev=net0 \
    -device virtio-camera-device,v4ldev=/dev/video0 \
    -netdev bridge,id=net0 -device virtio-net-device,netdev=net0,mac=12:22:33:44:55:66\
    -device virtio-keyboard-pci \
    -device ac97 \
    -k en-us \
    -display gtk,gl=off

windows10下仿真使用

安装qemu

点击下方的按钮直接获取 PolyOS 官方站点提供的 QEMU 预构建包。

下载 QEMU

下载后,双击 .exe 文件直接以默认选项进行安装,QEMU 默认将被安装至 C:\Porgram Files\PolyOS QEMU 文件夹。

当然这次是装到e:盘,E:\Porgram Files\PolyOS QEMU 文件夹。

解压polyos-mobile包

解压下载的polyos-mobile包。windows10下也支持tar了

tar -Jxvf /path/to/polyos-mobile-latest.img.tar.xz

Windows下执行仿真虚拟

windows下执行,注意要以管理员身份启动powershell 。进入解压的polyos-mobile的目录,比如是:E:\360Downloads\polyos-mobile-latest.img\images> ,执行:

.\qemu_riscv64_run_windows.ps1

如果报签名错,可以这样执行:

powershell -ExecutionPolicy Bypass -File.\qemu_riscv64_run_windows.ps1

 等待较长时间,就能看到启动画面了

一些组合键

退出用Ctrl+Alt+G组合键

最大化用 Ctrl+Alt+F

速度太慢了,放弃。

尝试一下

修改配置文件,把内存和cpu核数减少,试试

$cpu = [System.Environment]::ProcessorCount / 2
$mem = (Get-CimInstance CIM_ComputerSystem).TotalPhysicalMemory/2MB -as [int]
$cpu = 4
$mem = 4096

速度还是一样慢。

怪不得这个项目没进展了....

另外连浏览器也没有,所以根本没法用啊!

调试

windows下无法执行ps1文件

晕,用错斜线了

E:\360Downloads\polyos-mobile-latest.img\images>./qemu_riscv64_run_linux.sh
'.' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

E:\360Downloads\polyos-mobile-latest.img\images>.\qemu_riscv64_run_linux.sh

用第二条命令就行了

还是不执行,加上这句试试

$env:Path = "E:\Porgram Files\PolyOS QEMU" + $env:Path
[Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine")

后来才知道其实是走了弯路了,需要 以管理员身份启动powershell 。

报错未对文件 E:\360Downloads\polyos-mobile-latest.img\images\qemu_riscv64_run_windows.ps1 进行数字签名

.\qemu_riscv64_run_windows.ps1 : 无法加载文件 E:\360Downloads\polyos-mobile-latest.img\images\qemu_riscv64_run_windows.
ps1。未对文件 E:\360Downloads\polyos-mobile-latest.img\images\qemu_riscv64_run_windows.ps1 进行数字签名。无法在当前系统
上运行该脚本。有关运行脚本和设置执行策略的详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Exe
cution_Policies。
所在位置 行:1 字符: 1
+ .\qemu_riscv64_run_windows.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

可以这样执行就不报签名的错了:

powershell -ExecutionPolicy Bypass -File.\qemu_riscv64_run_windows.ps1

终于执行成功,出来了启动界面

启动输出

dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID

OpenSBI v1.0
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : riscv-virtio,qemu
Platform Features         : medeleg
Platform HART Count       : 12
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 10000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform Reboot Device    : sifive_test
Platform Shutdown Device  : sifive_test
Firmware Base             : 0x80000000
Firmware Size             : 340 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 11
Domain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*,8*,9*,10*,11*
Domain0 Region00          : 0x0000000002000000-0x000000000200ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008007ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x00000000bfe00000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 11
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsuh
Boot HART Features        : scounteren,mcounteren,mcountinhibit,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 16
Boot HART MIDELEG         : 0x0000000000001666
Boot HART MEDELEG         : 0x0000000000f0b509

启动后gui是黑色的,且无法退出

退出用Ctrl+Alt+G组合键

黑色,是因为慢。等待较长时间,就能看到启动画面了


http://www.niftyadmin.cn/n/5863143.html

相关文章

Windows 上源码安装 FastGPT

FastGPT 是一个强大的 AI RAG 平台&#xff0c;值得我们去学习了解。与常见的 Python 体系不同&#xff0c;Fast GPT 采用 Node.js/Next.js 平台&#xff08;对于广大 JS 开发者或前端开发者比较亲切友好&#xff09;&#xff0c;安装或部署比较简单。虽然一般情况下推荐简单的…

微软CEO-纳德拉访谈-AGI计划

在与知名科技播客主播 Dwarkesh Patel 的深度访谈中,微软 CEO 萨提亚・纳德拉围绕 AI、量子计算、微软发展等多方面分享深刻见解,下面是针对访谈内容的介绍,其中还是有很多值得我们学习的地方。 1 AI 领域见解 影响力评估:纳德拉直言行业所标榜的 AGI 里程碑是 “无意义的基…

C++——list模拟实现

目录 前言 一、list的结构 二、默认成员函数 构造函数 析构函数 clear 拷贝构造 赋值重载 swap 三、容量相关 empty size 四、数据访问 front/back 五、普通迭代器 begin/end 六、const迭代器 begin/end 七、插入数据 insert push_back push_front 八、…

A097基于SpringBoot实现的社区博客管理系统

系统介绍 基于SpringBootVue实现的社区博客管理系统设计了超级管理员、系统观察者、用户三种角色&#xff0c;超级管理员可对用户授权&#xff0c;具体实现的功能如下 • 文章采用了比较火的Markdown编辑器。 • 系统集成了邮件发送功能。 • 系统可以自定义友情链接。…

无人机避障——Mid360+Fast-lio感知建图+Ego-planner运动规划(胎教级教程)

电脑配置&#xff1a;Xavier-nx、ubuntu 18.04、ros melodic 激光雷达&#xff1a;Livox_Mid-360 结果展示&#xff1a;左边Mid360Fast-lio感知建图&#xff0c;右边Ego-planner运动规划 1、读取雷达数据并显示 无人机避障——感知篇&#xff08;采用Livox-Mid360激光雷达获…

普通人怎样用好Deepseek?

第一章&#xff1a;准备篇&#xff08;30分钟上手&#xff09; DeepSeek 是一款功能强大的数据处理和分析工具&#xff0c;广泛应用于数据挖掘、机器学习、商业智能等领域。 本文将通过图文结合的方式&#xff0c;详细介绍 DeepSeek 的安装、配置、基本使用、高级功能以及实用…

LLaMA-Factory|微调大语言模型初探索(3),qlora微调deepseek记录

前言 上篇文章记录了使用lora微调llama-1b,微调成功,但是微调llama-8b显存爆炸,这次尝试使用qlora来尝试微调参数体量更大的大语言模型,看看64G显存的极限在哪里。 1.Why QLora? QLoRA 在模型加载阶段通过 4-bit 量化大幅减少了模型权重的显存占用。QLoRA 通过 反量化到 …

XiaoMi Mi5(gemini) 刷入Ubuntu Touch 16.04——安卓手机刷入Linux

最近在研究个人用的小服务器&#xff0c;期间也搞了一台某讯的盒子&#xff0c;s905的芯片&#xff0c;28G&#xff0c;刷入了Armbian&#xff0c;在自己本地当linux服务器用用挺方便的&#xff0c;但总感觉性能不太够。 然后灵机一动&#xff0c;手上还有几台旧的安卓手机&am…