YXL76 / zCore

Reimplement Zircon microkernel in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zCore

CI Docs Coverage Status

Reimplement Zircon microkernel in safe Rust as a userspace program!

Dev Status

🚧 Working In Progress

  • 2020.04.16: Zircon console is working on zCore! 🎉

Quick start for RISCV64

make riscv-image
cd zCore
make run arch=riscv64 linux=1

Getting started

Environments:

Developing environment info

  • current rustc -- rustc 1.56.0-nightly (08095fc1f 2021-07-26)
  • current rust-toolchain -- nightly-2021-07-27
  • current qemu -- 5.2.0

Clone repo and pull prebuilt fuchsia images:

git clone https://github.com/rcore-os/zCore --recursive
cd zCore
git lfs install
git lfs pull

For users in China, there's a mirror you can try:

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

Prepare Alpine Linux rootfs:

make rootfs

Run native Linux program (Busybox):

cargo run --release -p linux-loader -- /bin/busybox [args]

Run native Zircon program (shell):

cargo run --release -p zircon-loader -- prebuilt/zircon/x64

Run Linux shell on bare-metal (zCore):

make image
cd zCore && make run mode=release linux=1 [graphic=on] [accel=1]

Run Zircon on bare-metal (zCore):

cd zCore && make run mode=release [graphic=on] [accel=1]

Build and run your own Zircon user programs:

# See template in zircon-user
cd zircon-user && make zbi mode=release

# Run your programs in zCore
cd zCore && make run mode=release user=1

To debug, set RUST_LOG environment variable to one of error, warn, info, debug, trace.

Testing

LibOS Mode Testing

Zircon related

Run Zircon official core-tests:

cd zCore && make test mode=release [accel=1] test_filter='Channel.*'

Run all (non-panicked) core-tests for CI:

pip3 install pexpect
cd scripts && python3 core-tests.py
# Check `zircon/test-result.txt` for results.

Linux related

Run Linux musl libc-tests for CI:

make rootfs && make libc-test
cd scripts && python3 libc-tests.py
# Check `linux/test-result.txt` for results.

Baremetal Mode Testing

x86-64 Linux related

Run Linux musl libc-tests for CI:

##  Prepare rootfs with libc-test apps
make baremetal-test-img
## Build zCore kernel
cd zCore && make build mode=release linux=1 arch=x86_64
## Testing
cd ../scripts && python3 ./baremetal-libc-test.py
## 

You can use scripts/baremetal-libc-test-ones.py & scripts/linux/baremetal-test-ones.txt to test specified apps.

scripts/linux/baremetal-test-fail.txt includes all failed x86-64 apps (We need YOUR HELP to fix bugs!)

riscv-64 Linux related

Run Linux musl libc-tests for CI:

##  Prepare rootfs with libc-test & oscomp apps
make riscv-image
## Build zCore kernel & Testing
cd ../scripts && python3 baremetal-test-riscv64.py
## 

You can use scripts/baremetal-libc-test-ones-riscv64.py & scripts/linux/baremetal-test-ones-rv64.txtto test specified apps.

scripts/linux/baremetal-test-fail-riscv64.txtincludes all failed riscv-64 apps (We need YOUR HELP to fix bugs!)

Doc

make doc

riscv64 porting info

Components

Overview

Hardware Abstraction Layer

Bare Metal Linux / macOS
Virtual Memory Management Page Table Mmap
Thread Management executor async-std::task
Exception Handling Interrupt Signal

Small Goal & Little Plans

About

Reimplement Zircon microkernel in Rust.

License:MIT License


Languages

Language:Rust 95.2%Language:Python 2.1%Language:C 1.4%Language:Makefile 0.9%Language:Assembly 0.1%Language:Shell 0.1%Language:Lua 0.0%