Skip to content

Commit

Permalink
Merge pull request #40 from weilinfox/main
Browse files Browse the repository at this point in the history
提交 0.6.0 新增特性
  • Loading branch information
xijing21 authored Mar 19, 2024
2 parents e4452ec + 2571cb2 commit 7c025fc
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 42 deletions.
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default defineConfig({
items: [
{ text: 'v0.3.0 版本新增特性', link: '/zh/ruyi/updates/0.3.0' },
{ text: 'v0.4.0 版本新增特性', link: '/zh/ruyi/updates/0.4.0' },
{ text: 'v0.5.0 版本新增特性', link: '/zh/ruyi/updates/0.5.0' }
{ text: 'v0.5.0 版本新增特性', link: '/zh/ruyi/updates/0.5.0' },
{ text: 'v0.6.0 版本新增特性', link: '/zh/ruyi/updates/0.6.0' }
]
}
]
Expand Down
5 changes: 3 additions & 2 deletions docs/zh/ruyi/getstarted/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ $ sudo apt-get install wget git tar bzip2 xz-utils zstd
$ sudo apt-get install wget git tar bzip2 xz zstd
```

注意从 v0.6.0 版本开始 RUYI 包管理不再依赖 git,而是使用 pygit2 作为替代方案。

## 安装 RUYI 包管理器

[GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/)[ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases)下载最新版本,选择合适架构的预编译二进制下载,当前 RUYI 包管理支持 amd64 、arm64、 riscv64 架构编译环境。
Expand Down Expand Up @@ -226,7 +228,6 @@ $ ruyi self uninstall --purge -y

执行如下命令并按照引导执行即可下载所需系统镜像,为设备安装系统:

```
bash
```bash
$ ruyi device provision
```
83 changes: 83 additions & 0 deletions docs/zh/ruyi/updates/0.6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# v0.6.0 版本新增特性

+ 使用 pygit2 替代对 git 的依赖
+ SiFive HiFive Unmatched 镜像支持增加到 5 种

## 安装 v0.6.0

在 amd64 架构环境安装:

```bash
$ wget https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/0.6.0/ruyi.amd64
$ chmod +x ./ruyi.amd64
$ sudo cp ./ruyi.amd64 /usr/local/bin/ruyi
```

在 riscv64 架构环境安装:

```bash
$ wget https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/0.6.0/ruyi.riscv64
$ chmod +x ./ruyi.riscv64
$ sudo cp ./ruyi.riscv64 /usr/local/bin/ruyi
```

检查安装版本:

```bash
$ ruyi version
Ruyi 0.6.0
Copyright (C) 2023 Institute of Software, Chinese Academy of Sciences (ISCAS).
All rights reserved.
License: Apache-2.0 <https://www.apache.org/licenses/LICENSE-2.0>
```

## 依赖变化

从 v0.6.0 版本开始 RUYI 包管理不再依赖 git,而是使用 pygit2 作为替代方案。

## 板卡镜像刷写

在 0.6.0 版本, SiFive HiFive Unmatched 镜像支持增加到 5 种。

板卡支持列表:

| 开发板 | 版本 | 镜像 | 刷写方式 |
|:-:|:-:|:-:|:-:|
| Allwinner Nezha D1 | Allwinner Nezha D1 (generic variant) | openEuler RISC-V (base system) for Allwinner D1 | dd |
| | | openEuler RISC-V (XFCE) for Allwinner D1 | dd |
| Canaan Kendryte K230 | Canaan Kendryte K230 (generic variant) | Canaan Kendryte K230 Official CanMV Debian SDK | dd |
| | | Canaan Kendryte K230 Official CanMV Ubuntu SDK | dd |
| Milk-V Duo | Milk-V Duo (64M RAM) | Milk-V Duo Official buildroot SDK (64M RAM) | dd |
| | | Milk-V Duo Official buildroot SDK (64M RAM, with Python) | dd |
| | Milk-V Duo (256M RAM) | Milk-V Duo Official buildroot SDK (256M RAM) | dd |
| | | Milk-V Duo Official buildroot SDK (256M RAM, with Python) | dd |
| Milk-V Pioneer Box | Milk-V Pioneer Box (v1.3) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd |
| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd |
| | | RevyOS for Milk-V Pioneer | dd |
| | Milk-V Pioneer Box (v1.2) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd |
| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd |
| | Milk-V Pioneer Box (v1.1) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd |
| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd |
| SiFive HiFive Unmatched | SiFive HiFive Unmatched (generic variant) | openEuler RISC-V (base system) for SiFive HiFive Unmatched | dd |
| | | openKylin for SiFive HiFive Unmatched | dd |
| | | openEuler RISC-V (XFCE) for SiFive HiFive Unmatched | dd |
| | | OpenWrt for SiFive HiFive Unmatched | dd |
| | | Ubuntu Server for SiFive HiFive Unmatched | dd |
| Sipeed Lichee RV | Sipeed Lichee RV (generic variant) | openEuler RISC-V (base system) for Allwinner D1 | dd |
| | | openEuler RISC-V (XFCE) for Allwinner D1 | dd |
| Sipeed LicheePi 4A | Sipeed LicheePi 4A (8G RAM) | openEuler RISC-V (headless) for Sipeed LicheePi 4A (8G RAM) | fastboot |
| | | openEuler RISC-V (XFCE) for Sipeed LicheePi 4A (8G RAM) | fastboot |
| | | RevyOS for Sipeed LicheePi 4A (8G RAM) | fastboot |
| | Sipeed LicheePi 4A (16G RAM) | openEuler RISC-V (headless) for Sipeed LicheePi 4A (16G RAM) | fastboot |
| | | openEuler RISC-V (XFCE) for Sipeed LicheePi 4A (16G RAM) | fastboot |
| | | RevyOS for Sipeed LicheePi 4A (16G RAM) | fastboot |
| StarFive VisionFive | StarFive VisionFive (generic variant) | openEuler RISC-V (base system) for StarFive VisionFive | dd |
| | | openEuler RISC-V (XFCE) for StarFive VisionFive | dd |
| StarFive VisionFive2 | StarFive VisionFive2 (generic variant) | openEuler RISC-V (base system) for StarFive VisionFive2 | dd |
| | | openEuler RISC-V (XFCE) for StarFive VisionFive2 | dd |

刷写工具根据板卡的不同依赖 ``dd````fastboot`` 命令, RUYI 将自动调用 ``sudo`` 提权。

需要注意的是一些镜像的解包需要占用大量的磁盘空间,使用 RUYI 工具刷写镜像前请务必留足磁盘空间;
一些厂家提供的镜像在刷写后并不会自动扩展分区来充分利用整块磁盘,而需要用户自行扩展磁盘分区大小。

21 changes: 11 additions & 10 deletions docs/zh/usecase/rvbook/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

## ruyi工具的安装

1. [可选] 清除ruyi缓存
1. [可选] 清除当前已经安装的 ruyi 工具及其所有数据

```bash
ruyi self uninstall --purge
```

2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/)[ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。
2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/)[ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。

```bash
# 下载riscv64版本的ruyi,将其放到path路径下,并赋予其可执行权限
Expand Down Expand Up @@ -97,16 +97,16 @@ sed -i 's/\bgcc\b/riscv64-plctxthead-linux-gnu-gcc/g' linux64/core_portme.mak

11. 执行交叉编译和构建,得到可执行程序coremark.exe

```bash
make PORT_DIR=linux64 link
ls -al #新增可执行程序coremark.exe
```
```bash
make PORT_DIR=linux64 link
ls -al #新增可执行程序coremark.exe
```
12. 查看rv64可执行程序文件属性信息。

```bash
file coremark.exe
# 命令回显信息显示了文件的架构相关信息
```
```bash
file coremark.exe
# 命令回显信息显示了文件的架构相关信息
```

## 运行验证

Expand All @@ -115,3 +115,4 @@ sed -i 's/\bgcc\b/riscv64-plctxthead-linux-gnu-gcc/g' linux64/core_portme.mak
```bash
./coremark.exe
```

9 changes: 1 addition & 8 deletions docs/zh/usecase/setupos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ ruyi device provision
该命令将会返回工具目前所支持的RISC-V开发板,选择开发板后将返回所有支持指定开发板的操作系统:

```
RuyiSDK Device Provisioning Wizard
This is a wizard intended to help you install a system on your device for your
Expand Down Expand Up @@ -56,8 +53,6 @@ Choice? (1-9)
以上,以 Sipeed LicheePi 4A 为例,需要为其安装镜像,只需要输入对应的序号:7

```
Choice? (1-9) 7
The device has the following variants. Please choose the one corresponding to your hardware at hand:
Expand All @@ -83,8 +78,6 @@ We are about to download and install the following packages for your device:
Proceed? (y/N)
```


您只需要按照引导提示一步步执行即可。
您只需要按照引导提示一步步执行即可。
30 changes: 15 additions & 15 deletions docs/zh/usecase/x86pc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

硬件环境:x86_64

软件环境:ubuntu 22.04
软件环境:Ubuntu 22.04

## ruyi工具的安装

1. [可选] 清除ruyi缓存
1. [可选] 清除当前已经安装的 ruyi 工具及其所有数据

```bash
ruyi self uninstall --purge
```

2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/)[ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。
2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/)[ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。

```bash

Expand Down Expand Up @@ -55,7 +55,7 @@ ruyi list
ruyi list -v
```

7. 安装gnu:ruyi install `<package-name>`
7. 安装工具链:ruyi install `<package-name>`

```bash
ruyi install gnu-upstream
Expand Down Expand Up @@ -83,13 +83,13 @@ ruyi venv -t gnu-upstream -e qemu-user-riscv-upstream generic venv1
11. 查看虚拟环境bin目录下已安装的工具链、模拟器

```bash
ls venv1/bin
ls venv1/bin
```

12. 激活虚拟环境

```
. venv1/bin/ruyi-activate
. venv1/bin/ruyi-activate
```

13. 检查虚拟环境中编译工具的版本信息
Expand Down Expand Up @@ -117,23 +117,23 @@ sed -i 's/\bgcc\b/riscv64-unknown-linux-gnu-gcc/g' linux64/core_portme.mak

16. 执行交叉编译和构建,得到可执行程序coremark.exe

```bash
make PORT_DIR=linux64 link
ls -al #新增可执行程序coremark.exe
```
```bash
make PORT_DIR=linux64 link
ls -al #新增可执行程序coremark.exe
```
17. 查看rv64可执行程序文件属性信息。

```bash
file coremark.exe
# 命令回显信息显示了文件的架构相关信息
```
```bash
file coremark.exe
# 命令回显信息显示了文件的架构相关信息
```

## qemu-user 模式下运行 riscv64 coremark 可执行程序

18. qemu user模式下执行riscv64 coremark可执行程序

```bash
ruyi-qemu coremark.exe
ruyi-qemu coremark.exe
```

19. 退出虚拟环境
Expand Down
8 changes: 4 additions & 4 deletions docs/zh/usedirection/developmentside/environments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ options:
```bash
# 使用 GNU 上游工具链配置 RISC-V 编译环境:
$ ruyi venv -t gnu-upstream generic venv1
$ ruyi venv -t gnu-upstream generic ./generic-venv
# 使用 PLCT 工具链配置 Milkv-Duo 编译环境:
$ ruyi venv -t gnu-plct milkv-duo ./milkv-venv
# 使用 LLVM 上游工具链配置 RISC-V 编译环境:
$ ruyi venv -t llvm-upstream --sysroot-from gnu-upstream generic ./llvm_venv
$ ruyi venv -t llvm-upstream --sysroot-from gnu-upstream generic ./llvm-venv
# 使用平头哥工具链配置荔枝派 4A 编译环境:
$ ruyi venv -t gnu-plct-xthead-20231212 sipeed-lpi4a ./sipeed-venv
# 使用上游 QEMU 模拟器运行交叉编译的 RISC-V 二进制
$ ruyi venv -t gnu-plct generic -e qemu-user-riscv-upstream ./qemu_venv
$ ruyi venv -t gnu-plct generic -e qemu-user-riscv-upstream ./qemu-venv
# 使用平头哥 QEMU 模拟器运行交叉编译的 RISC-V 二进制
$ ruyi venv -t gnu-plct-xthead sipeed-lpi4a -e qemu-user-riscv-xthead ./qemu_venv
$ ruyi venv -t gnu-plct-xthead sipeed-lpi4a -e qemu-user-riscv-xthead ./xthead-qemu-venv
```
## 在虚拟环境下编译
Expand Down
49 changes: 49 additions & 0 deletions docs/zh/usedirection/developmentside/sources/coremark/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,52 @@ coremark.exe: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, vers
«Ruyi milkv-venv» $ ruyi-deactivate
$
```

## 在最新的 Milkv Duo 镜像上运行

传送 coremark 二进制的 Milkv Duo, Milkv Duo 的 IP 地址请按实际情况更改。

```bash
$ scp -O ./coremark.exe [email protected]:~
```

在 Milkv Duo 上运行

```bash
[root@milkv-duo]~# ./coremark.exe
-sh: ./coremark.exe: not found
```

若出现这样的错误,则需要静态链接的二进制。

```bash
«Ruyi milkv-venv» $ make PORT_DIR=linux64 LFLAGS_END=-static link
riscv64-plct-linux-gnu-gcc -O2 -Ilinux64 -I. -DFLAGS_STR=\""-O2 -static"\" -DITERATIONS=0 core_list_join.c core_main.c core_matrix.c core_state.c core_util.c linux64/core_portme.c -o ./coremark.exe -static
Link performed along with compile
«Ruyi milkv-venv» $ file coremark.exe
coremark.exe: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), statically linked, BuildID[sha1]=1548f6b30560e1ca6f3fa8ba3ef6aea4188feacf, for GNU/Linux 4.15.0, with debug_info, not stripped
```

重新上传后运行

```bash
[root@milkv-duo]~# ./coremark.exe
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 14911
Total time (secs): 14.911000
Iterations/Sec : 2011.937496
Iterations : 30000
Compiler version : GCC13.1.0
Compiler flags : -O2 -static
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x5275
Correct operation validated. See readme.txt for run and reporting rules.
CoreMark 1.0 : 2011.937496 / GCC13.1.0 -O2 -static / Heap
```

3 changes: 1 addition & 2 deletions docs/zh/usedirection/operationside/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

可以通过下载安装最新的 ruyi 包管理器工具并执行以下命令为设备安装系统:

```
bash
```bash
$ ruyi device provision
```

Expand Down

0 comments on commit 7c025fc

Please sign in to comment.