{"id":22925496,"url":"https://github.com/ringtailsoftware/zig-minirv32","last_synced_at":"2025-04-12T16:34:49.163Z","repository":{"id":136877149,"uuid":"602054912","full_name":"ringtailsoftware/zig-minirv32","owner":"ringtailsoftware","description":"Zig RISC-V32 emulator with Linux and baremetal examples","archived":false,"fork":false,"pushed_at":"2025-01-01T23:14:19.000Z","size":6930,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T22:40:50.421Z","etag":null,"topics":["emulator","linux","risc-v","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ringtailsoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-02-15T12:03:08.000Z","updated_at":"2025-01-21T11:18:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"837c3ac6-3c8c-4fb5-98e9-4e927abd4709","html_url":"https://github.com/ringtailsoftware/zig-minirv32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzig-minirv32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzig-minirv32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzig-minirv32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringtailsoftware%2Fzig-minirv32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ringtailsoftware","download_url":"https://codeload.github.com/ringtailsoftware/zig-minirv32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248596943,"owners_count":21130790,"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":["emulator","linux","risc-v","zig"],"created_at":"2024-12-14T09:00:39.868Z","updated_at":"2025-04-12T16:34:49.157Z","avatar_url":"https://github.com/ringtailsoftware.png","language":"Zig","readme":"# zig-minirv32ima\n\nToby Jaffey https://mastodon.me.uk/@tobyjaffey\n\nA pure zig port of https://github.com/cnlohr/mini-rv32ima\n\nBlog posts documenting some of this:\n\n - https://www.ringtailsoftware.co.uk/zig-rv32/\n - https://www.ringtailsoftware.co.uk/zig-baremetal/\n\nTested with `zig 0.14.0`\n\n![](demo.gif)\n\n# Build emulator\n\n    zig build \u0026\u0026 ./zig-out/bin/zigrv32ima linux.bin\n\nType ctrl-`a` then `x` to exit.\n\n# Samples\n\n## `samples/hello`\n\nMinimal \"Hello world\" in zig\n\n    cd samples/hello\n    zig build\n    ../../zig-out/bin/zigrv32ima zig-out/bin/hello.bin\n\n## `samples/shell`\n\nInteractive shell (https://github.com/ringtailsoftware/zig-embshell/)\n\n    cd samples/shell\n    zig build\n    ../../zig-out/bin/zigrv32ima zig-out/bin/shell.bin\n\n## `samples/mandelbrot`\n\nASCII mandelbrot set\n\n    cd samples/mandelbrot\n    zig build\n    ../../zig-out/bin/zigrv32ima zig-out/bin/mandelbrot.bin\n\n# Notes\n\n## Testing with qemu\n\n    qemu-system-riscv32 -machine virt -nographic -bios foo.bin\n\n## Libc usage\n\nlibc is linked for access to the raw terminal. To remove, comment out `lib.linkSystemLibraryName(\"c\");` in `build.zig`.\nThe `term` struct could be replaced by this minimal stub:\n\n    const term = struct {\n        pub fn init() void {\n        }\n        pub fn getch() ?u8 {\n            return null;\n        }\n    };\n\n","funding_links":[],"categories":["Systems Programming"],"sub_categories":["Emulators"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringtailsoftware%2Fzig-minirv32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fringtailsoftware%2Fzig-minirv32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringtailsoftware%2Fzig-minirv32/lists"}