{"id":13599889,"url":"https://github.com/rcore-os/zCore","last_synced_at":"2025-04-10T17:32:55.568Z","repository":{"id":37020159,"uuid":"222648751","full_name":"rcore-os/zCore","owner":"rcore-os","description":"Zircon microkernel reimplemented in Rust.","archived":false,"fork":false,"pushed_at":"2024-04-15T04:21:10.000Z","size":81294,"stargazers_count":1700,"open_issues_count":38,"forks_count":209,"subscribers_count":57,"default_branch":"master","last_synced_at":"2024-08-02T17:39:38.025Z","etag":null,"topics":["microkernel","zircon"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcore-os.png","metadata":{"files":{"readme":"README-arch.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-11-19T08:41:32.000Z","updated_at":"2024-08-02T02:45:59.000Z","dependencies_parsed_at":"2023-02-15T14:46:09.064Z","dependency_job_id":"c51ca9ab-53e2-499f-96e3-ba0741253f58","html_url":"https://github.com/rcore-os/zCore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2FzCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2FzCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2FzCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2FzCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcore-os","download_url":"https://codeload.github.com/rcore-os/zCore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223442740,"owners_count":17145826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microkernel","zircon"],"created_at":"2024-08-01T17:01:16.009Z","updated_at":"2025-04-10T17:32:55.561Z","avatar_url":"https://github.com/rcore-os.png","language":"Rust","readme":"﻿# zCore\n\n[![CI](https://github.com/rcore-os/zCore/workflows/CI/badge.svg?branch=master)](https://github.com/rcore-os/zCore/actions)\n[![Docs](https://img.shields.io/badge/docs-alpha-blue)](https://rcore-os.github.io/zCore/)\n[![Coverage Status](https://coveralls.io/repos/github/rcore-os/zCore/badge.svg?branch=master)](https://coveralls.io/github/rcore-os/zCore?branch=master)\n\nReimplement [Zircon][zircon] microkernel in safe Rust as a userspace program!\n\n## Dev Status\n\n🚧 Working In Progress\n\n- 2020.04.16: Zircon console is working on zCore! 🎉\n\n## Quick start for RISCV64\n\n```sh\nmake riscv-image\ncd zCore\nmake run ARCH=riscv64 LINUX=1\n```\n\n## Getting started\n\nEnvironments：\n\n- [Rust toolchain](http://rustup.rs)\n- [QEMU](https://www.qemu.org)\n\n### Developing environment info\n\n- current rustc -- rustc 1.60.0-nightly (5e57faa78 2022-01-19)\n- current rust-toolchain -- nightly-2022-01-20\n- current qemu -- 5.2.0 -\u003e 6.2.0\n\nClone repo and pull prebuilt fuchsia images:\n\n```sh\ngit clone https://github.com/rcore-os/zCore --recursive\ncd zCore\nmake setup\n```\n\nFor users in China, there's a mirror you can try:\n\n```sh\ngit clone https://github.com.cnpmjs.org/rcore-os/zCore --recursive\n```\n\nUse docker container as standand develop environment, please refer to [tootls/docker](https://github.com/rcore-os/zCore/tree/master/tools/docker).\n\n### Run zcore in libos mode\n\n#### Run zcore in linux-libos mode\n\n- step 1: Prepare Alpine Linux rootfs:\n\n  ```sh\n  make rootfs\n  ```\n\n- step 2: Compile \u0026 Run native Linux program (Busybox) in libos mode:\n\n  ```sh\n  cargo run --release --features \"linux libos\" -- /bin/busybox [args]\n  ```\n\n  You can also add the feature `graphic` to show the graphical output (with [sdl2](https://www.libsdl.org) installed).\n\n  To debug, set the `LOG` environment variable to one of `error`, `warn`, `info`, `debug`, `trace`.\n\n#### Run native Zircon program (shell) in zircon-libos mode:\n\n- step 1: Compile and Run Zircon shell\n\n  ```sh\n  cargo run --release --features \"zircon libos\" -- prebuilt/zircon/x64/bringup.zbi\n  ```\n\n  The `graphic` and `LOG` options are the same as Linux.\n\n### Run zcore in bare-metal mode\n\n#### Run Linux shell in  linux-bare-metal mode:\n\n- step 1: Prepare Alpine Linux rootfs:\n\n  ```sh\n  make rootfs\n  ```\n\n- step 2: Create Linux rootfs image:\n\n  Note: Before below step, you can add some special apps in zCore/rootfs\n\n  ```sh\n  make image\n  ```\n\n- step 3: Build and run zcore in  linux-bare-metal mode:\n\n  ```sh\n  cd zCore \u0026\u0026 make run MODE=release LINUX=1 [LOG=warn] [GRAPHIC=on] [ACCEL=1]\n  ```\n\n#### Run Zircon shell in zircon-bare-metal mode:\n\n- step 1: Build and run zcore in  zircon-bare-metal mode:\n\n  ```sh\n  cd zCore \u0026\u0026 make run MODE=release [LOG=warn] [GRAPHIC=on] [ACCEL=1]\n  ```\n\n- step 2: Build and run your own Zircon user programs:\n\n  ```sh\n  # See template in zircon-user\n  cd zircon-user \u0026\u0026 make zbi MODE=release\n  \n  # Run your programs in zCore\n  cd zCore \u0026\u0026 make run MODE=release USER=1 [LOG=warn] [GRAPHIC=on] [ACCEL=1]\n  ```\n\n## Testing\n\n### LibOS Mode Testing\n\n#### Zircon related\n\nRun Zircon official core-tests:\n\n```sh\npip3 install pexpect\ncd scripts \u0026\u0026 python3 unix-core-testone.py 'Channel.*'\n```\n\nRun all (non-panicked) core-tests for CI:\n\n```sh\npip3 install pexpect\ncd scripts \u0026\u0026 python3 unix-core-tests.py\n# Check `zircon/test-result.txt` for results.\n```\n\n#### Linux related\n\nRun Linux musl libc-tests for CI:\n\n```sh\nmake rootfs \u0026\u0026 make libc-test\ncd scripts \u0026\u0026 python3 libos-libc-tests.py\n# Check `linux/test-result.txt` for results.\n```\n\n### Bare-metal Mode Testing\n\n#### Zircon related\n\nRun Zircon official core-tests on bare-metal:\n\n```sh\ncd zCore \u0026\u0026 make test MODE=release [ACCEL=1] TEST_FILTER='Channel.*'\n```\n\nRun all (non-panicked) core-tests for CI:\n\n```sh\npip3 install pexpect\ncd scripts \u0026\u0026 python3 core-tests.py\n# Check `zircon/test-result.txt` for results.\n```\n\n#### x86-64 Linux related\n\nRun Linux musl libc-tests for CI:\n\n```sh\n##  Prepare rootfs with libc-test apps\nmake baremetal-test-img\n## Build zCore kernel\ncd zCore \u0026\u0026 make build MODE=release LINUX=1 ARCH=x86_64\n## Testing\ncd scripts \u0026\u0026 python3 baremetal-libc-test.py\n##\n```\n\nYou can use [`scripts/baremetal-libc-test-ones.py`](./scripts/baremetal-libc-test-ones.py) \u0026 [`scripts/linux/baremetal-test-ones.txt`](./scripts/linux/baremetal-test-ones.txt) to test specified apps.\n\n[`scripts/linux/baremetal-test-fail.txt`](./scripts/linux/baremetal-test-fail.txt) includes all failed x86-64 apps (We need YOUR HELP to fix bugs!)\n\n#### riscv-64 Linux related\n\nRun Linux musl libc-tests for CI:\n\n```sh\n##  Prepare rootfs with libc-test \u0026 oscomp apps\nmake riscv-image\n## Build zCore kernel \u0026 Testing\ncd scripts \u0026\u0026 python3 baremetal-test-riscv64.py\n##\n```\n\nYou can use[scripts/baremetal-libc-test-ones-riscv64.py](./scripts/baremetal-libc-test-ones-riscv64.py) \u0026 [`scripts/linux/baremetal-test-ones-rv64.txt`](scripts/linux/baremetal-test-ones-rv64.txt)to test\nspecified apps.\n\n[`scripts/linux/baremetal-test-fail-riscv64.txt`](./scripts/linux/baremetal-test-fail-riscv64.txt)includes all failed riscv-64 apps (We need YOUR HELP to fix bugs!)\n\n## Graph/Game\n\nsnake game: \u003chttps://github.com/rcore-os/rcore-user/blob/master/app/src/snake.c\u003e\n\n### Step1: compile usr app\n\nWe can use musl-gcc compile it in x86_64 mode\n\n### Step2: change zcore for run snake app first.\n\nchange zCore/zCore/main.rs L176\nvec![\"/bin/busybox\".into(), \"sh\".into()]\nTO\nvec![\"/bin/snake\".into(), \"sh\".into()]\n\n### Step3: prepare root fs image, run zcore in linux-bare-metal mode\n\nexec:\n\n```sh\ncd zCore #zCore ROOT DIR\nmake rootfs\ncp ../rcore-user/app/snake rootfs/bin #copy snake ELF file to rootfs/bin\nmake image # build rootfs image\ncd zCore #zCore kernel dir\nmake run MODE=release LINUX=1 GRAPHIC=on\n```\n\nThen you can play the game.\nOperation\n\n- Keyboard\n  - `W`/`A`/`S`/`D`: Move\n  - `R`: Restart\n  - `ESC`: End\n- Mouse\n  - `Left`: Speed up\n  - `Right`: Slow down\n  - `Middle`: Pause/Resume\n\n## Doc\n\n```\nmake doc\n```\n\n### RISC-V 64 porting info\n\n- [porting riscv64 doc](./docs/porting-rv64.md)\n\n## Components\n\n### Overview\n\n![](./docs/structure.svg)\n\n[zircon]: https://fuchsia.googlesource.com/fuchsia/+/master/zircon/README.md\n[kernel-objects]: https://github.com/PanQL/zircon/blob/master/docs/objects.md\n[syscalls]: https://github.com/PanQL/zircon/blob/master/docs/syscalls.md\n\n### Hardware Abstraction Layer\n\n|                           | Bare Metal | Linux / macOS     |\n| :------------------------ | ---------- | ----------------- |\n| Virtual Memory Management | Page Table | Mmap              |\n| Thread Management         | `executor` | `async-std::task` |\n| Exception Handling        | Interrupt  | Signal            |\n\n### Small Goal \u0026 Little Plans\n\n- \u003chttps://github.com/rcore-os/zCore/wiki/Plans\u003e\n","funding_links":[],"categories":["Rust","Uncategorized","Rust 程序设计","General Operating System","库"],"sub_categories":["Uncategorized","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2FzCore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcore-os%2FzCore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2FzCore/lists"}