1 Star 0 Fork 0

乱雪丶 / zcore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

zCore

CI Docs Coverage Status issue forks stars license

基于 zircon 并提供 Linux 兼容操作系统内核。

构建项目

项目构建采用 xtask 模式,常用操作被封装成 cargo 命令,再通过 Makefile 提供 make 调用,以兼容一些旧脚本。

开发者和用户可以按以下步骤设置 zCore 项目。

  1. 先决条件

    目前已测试的开发环境包括 Ubuntu20.04、Ubuntu22.04 和 Debian11, Ubuntu22.04 不能正确编译 x86_64 的 libc 测试。 若不需要烧写到物理硬件,使用 WSL2 或其他虚拟机的操作与真机并无不同之处。

    在开始之前,确保你的计算机上安装了 git、git lfs 和 rustup。要在虚拟环境开发或测试,需要 QEMU。

  2. 克隆项目

    git clone https://github.com/rcore-os/zCore.git

    NOTICE 此处不必递归,因为后续步骤会自动拉取子项目

  3. 初始化存储库

    cargo initialize
  4. 保持更新

    cargo update-all
  5. 探索更多操作

    cargo xtask

命令参考指南

如果下面的命令描述与行为不符,或怀疑此文档更新不及时,亦可直接查看内联文档。 如果发现 error: no such subcommand: ...,查看命令简写为哪些命令设置了别名。

NOTICE 内联文档也是中英双语

常用功能

  • dump

打印构建信息。

cargo dump

项目构建和管理

  • initialize

初始化项目。转换 git lfs 并更新子项目。

cargo initialize
  • update-all

更新工具链、依赖和子项目。

cargo update-all
  • check-style

静态检查。设置多种编译选项,检查代码能否编译。

cargo check-style

开发和调试

  • asm

反汇并保存编指定架构的内核。默认保存到 target/zcore.asm

cargo asm --arch riscv64 --output riscv64.asm
  • bin

生成内核 raw 镜像到指定位置。默认输出到 target/{arch}/release/zcore.bin

cargo bin --arch riscv64 --output zcore.bin
  • qemu

在 qemu 中启动 zCore。这需要 qemu 已经安装好了。

cargo qemu --arch riscv64 --smp 4

支持将 qemu 连接到 gdb:

cargo qemu --arch riscv64 --smp 4 --gdb 1234
  • gdb

启动 gdb 并连接到指定端口。

cargo gdb --arch riscv64 --port 1234

管理 linux rootfs

  • rootfs

重建 Linux rootfs。这个命令会清除已有的为此架构构造的 rootfs 目录,重建最小的 rootfs。

cargo rootfs --arch riscv64
  • musl-libs

将 musl 动态库拷贝到 rootfs 目录对应位置。

cargo musl-libs --arch riscv64
  • ffmpeg

将 ffmpeg 动态库拷贝到 rootfs 目录对应位置。

cargo ffmpeg --arch riscv64
  • opencv

将 opencv 动态库拷贝到 rootfs 目录对应位置。如果 ffmpeg 已经放好了,opencv 将会编译出包含 ffmepg 支持的版本。

cargo opencv --arch riscv64
  • libc-test

将 libc 测试集拷贝到 rootfs 目录对应位置。

cargo libc-test --arch riscv64
  • other-test

将其他测试集拷贝到 rootfs 目录对应位置。

cargo other-test --arch riscv64
  • image

构造 Linux rootfs 镜像文件。

cargo image --arch riscv64

Libos 模式

  • linux-libos

在 linux libos 模式下启动 zCore 并执行位于指定路径的应用程序。

NOTICE libos 模式只能执行单个应用程序,完成就会退出。

cargo linux-libos --args /bin/busybox
MIT License Copyright (c) 2019-2020 rCore Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Reimplement Zircon microkernel in safe Rust as a userspace program! 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/Luanxue1999/zcore.git
git@gitee.com:Luanxue1999/zcore.git
Luanxue1999
zcore
zcore
master

搜索帮助