{"id":13710738,"url":"https://github.com/eastonman/zesty-core","last_synced_at":"2025-04-30T08:20:54.670Z","repository":{"id":107793304,"uuid":"437524575","full_name":"eastonman/zesty-core","owner":"eastonman","description":"A RISC-V OS written in Zig.","archived":false,"fork":false,"pushed_at":"2021-12-21T13:51:33.000Z","size":98,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T09:57:34.623Z","etag":null,"topics":["opreating-systems","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eastonman.png","metadata":{"files":{"readme":"README.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T11:20:51.000Z","updated_at":"2025-04-16T19:58:14.000Z","dependencies_parsed_at":"2024-05-13T00:11:28.122Z","dependency_job_id":"762b14e8-201f-48cf-81ea-47fe426fc90c","html_url":"https://github.com/eastonman/zesty-core","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/eastonman%2Fzesty-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastonman%2Fzesty-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastonman%2Fzesty-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastonman%2Fzesty-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eastonman","download_url":"https://codeload.github.com/eastonman/zesty-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251666638,"owners_count":21624345,"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":["opreating-systems","ziglang"],"created_at":"2024-08-02T23:01:00.376Z","updated_at":"2025-04-30T08:20:54.645Z","avatar_url":"https://github.com/eastonman.png","language":"Zig","funding_links":[],"categories":["Systems Programming"],"sub_categories":["Embedded Development"],"readme":"# Zesty-Core\n\n\u003e Zesty means we embrace new technology!\n\u003e\n\u003e Zesty begins with 'Z', which implies we are using Zig\n\n[![Zig Build Test](https://github.com/eastonman/zesty-core/actions/workflows/main.yml/badge.svg)](https://github.com/eastonman/zesty-core/actions/workflows/main.yml)\n\nZesty-Core is a [RISC-V](https://riscv.org/) kernel written in [Zig](https://ziglang.org/), aiming to be compatible with [POSIX](https://docs.oracle.com/cd/E19048-01/chorus4/806-3328/6jcg1bm05/index.html) (may not be accomplished).\n\n\nCurrently can only run on QEMU with `-machine virt`\n\n## Feature\nIt currently only have kernel, and only print out some naive strings every second.\n\nIt currently don't have any syscall support, and also no userspace development support.\n\nIt just don't have userspace!\n\nHopefully by the time some of the system call is implemented, userspace development can simply use any libc implemention.\n\n## Build\n\n### Requirements\n\n- Zig==0.9.0\n- OpenSBI\u003e=0.9\n\n**Require Zig 0.9.0 Exactly!**\n\nSince Zig is still under development, the API of std library is not stablized, so the exact same version of Zig is required.\n\nSince 2021-12-21, `Zesty-Core` had migrated to Zig 0.9.0.\n\nSome SBI feature used in the kernel is in SBI v0.3, So OpenSBI v0.9 and above is required.\n\nIf you have installed QEMU 6.0.0+, OpenSBI v0.3 is already included.\n\n### Build Command\n\nCurrently, this project is tested against:\n- QEMU 6.2.0 \n- GCC 10.2 with target riscv64-unknown-elf\n- QEMU -machine virt\n\n```\nzig build // Will build the project into build/\n\nzig build run // Will run the kernel with qemu, must have qemu-system-riscv64 installed\n```\n\n## RoadMap\n- [x] Zig 0.9.0 (2021-12-21)\n- [x] spinlock (2021-12-13)\n- [ ] std.log and panic support\n    - [x] UART Driver (2021-12-13)\n    - [ ] initialize using the device tree info\n- [x] migrate to OpenSBI (see [SBI](docs/SBI.md) in this project)\n    - [ ] ~~console related~~ (SBI v0.1 feature, deprecated in SBI specification v0.2 and above)\n    - [x] shutdown (2021-12-14)\n    - [x] hardware timer setup\n- [ ] interrupt\n    - [x] interrupt handler setup (2021-12-14)\n    - [x] clock interrupt (2021-12-14)\n    - [ ] other interrupt handlers\n- [ ] physical memory management\n    - [x] device tree parsing (2021-12-16)\n    - [x] xv6 alike linklist management (2021-12-16)\n    - [x] buddy allocator (2021-12-20)\n    - [ ] std.mem.GerneralPurposeAllocator\n    - [ ] 2-stage initial\n- [ ] pagetable\n    - [x] initial stage kernel pagetable (2021-12-18)\n    - [x] enable paging (2021-12-18)\n    - [ ] KPTI, **K**ernel **P**age-**T**able **I**solation\n    - [ ] user page table\n- [ ] proccess\n    - [ ] process structure\n    - [ ] context switching\n    - [ ] hart status management\n    - [ ] smp env setup\n- [ ] proccess scheduling\n    - [ ] clock interrupt scheduling\n    - [ ] schedule() function\n- [ ] syscall\n    - [ ] fork\n    - [ ] write\n\n## Development\n\n### Environment\n\nTools required:\n- riscv-gnu-toolchain\n- qemu (build with riscv64)\n\n#### GNU toolchain\nClone\n\n```\n$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain\n```\n\nInstall\n\n```\n$ cd riscv-gnu-toolchain\n$ sudo ./configure --prefix=/usr/local\n$ sudo make\n```\n\nnotice: this will install the toolchain into /usr/local, you can change to install location as you wish, but you will need to add it to you `$PATH` mannually.\n\n#### QEMU\n\nDownload, at least QEMU 6.0.0 is required\n\n```\n$ wget https://download.qemu.org/qemu-6.2.0.tar.xz\n$ tar xf qemu-6.2.0.tar.xz\n```\n\nInstall\n\n```\n$ cd qemu-6.2.0\n$ sudo ./configure --disable-kvm --disable-werror --prefix=/usr/local --target-list=\"riscv64-softmmu\"\n$ sudo make\n$ sudo make install\n```\n\n#### Check Installation\n```\n$ riscv64-unknown-elf-gcc --version\nriscv64-unknown-elf-gcc (GCC) 10.2.0\n...\n\n$ qemu-system-riscv64 --version\nQEMU emulator version 6.2.0\n```\n\n#### How to exit QEMU\nCtrl+A and then x, this will terminate QEMU.\n\n\n### What can be used\n- std.log\n- @panic\n- Some architecture independent datastructure container\n\n### What can not be used\nPretty much anything else related to system.\n\n## Credit\n- [https://github.com/AndreaOrru/zen](https://github.com/AndreaOrru/zen)\n- [https://github.com/rcore-os/rCore](https://github.com/rcore-os/rCore)\n- [https://github.com/mit-pdos/xv6-riscv](https://github.com/mit-pdos/xv6-riscv) xv6 from MIT re-written for RISC-V\n\n## Copyright\n`src/dtb` is a project from [@kivikakk](https://github.com/kivikakk/dtb.zig), by the time the code was copied in, the project is licensed under MIT license. All right reserved for [@kivikakk](https://github.com/kivikakk).\n\nAll other files in this project are licensed under the AGPL-3.0 license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastonman%2Fzesty-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feastonman%2Fzesty-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastonman%2Fzesty-core/lists"}