{"id":13994656,"url":"https://github.com/cloud-hypervisor/rust-hypervisor-firmware","last_synced_at":"2025-10-07T06:08:15.599Z","repository":{"id":37241496,"uuid":"181578726","full_name":"cloud-hypervisor/rust-hypervisor-firmware","owner":"cloud-hypervisor","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-25T03:29:04.000Z","size":668,"stargazers_count":631,"open_issues_count":16,"forks_count":59,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-04-07T03:14:50.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud-hypervisor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-04-15T23:16:15.000Z","updated_at":"2025-04-01T04:48:56.000Z","dependencies_parsed_at":"2023-10-03T09:00:25.655Z","dependency_job_id":"2a64800b-e960-46fd-af23-36d239910ca9","html_url":"https://github.com/cloud-hypervisor/rust-hypervisor-firmware","commit_stats":{"total_commits":625,"total_committers":21,"mean_commits":"29.761904761904763","dds":0.6496,"last_synced_commit":"a329e06394e4f79171f870f7e1ba655dea49f256"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Frust-hypervisor-firmware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Frust-hypervisor-firmware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Frust-hypervisor-firmware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Frust-hypervisor-firmware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-hypervisor","download_url":"https://codeload.github.com/cloud-hypervisor/rust-hypervisor-firmware/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248889985,"owners_count":21178335,"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":[],"created_at":"2024-08-09T14:03:01.349Z","updated_at":"2025-10-07T06:08:10.552Z","avatar_url":"https://github.com/cloud-hypervisor.png","language":"Rust","readme":"# Rust Hypervisor Firmware\n\nThis repository contains a simple firmware that is designed to be launched from\nanything that supports loading ELF binaries and running them with the\nPVH booting standard\n\nThe purpose is to be able to use this firmware to be able to load a\nbootloader from within a disk image without requiring the use of a complex\nfirmware such as TianoCore/edk2 and without requiring the VMM to reuse\nfunctionality used for booting the Linux kernel.\n\nCurrently it will directly load a kernel from a disk image that follows the\n[Boot Loader Specification](https://uapi-group.org/specifications/specs/boot_loader_specification)\n\nThere is also minimal EFI compatibility support allowing the boot of some\nimages that use EFI (shim + GRUB2 as used by Ubuntu).\n\nThe firmware is primarily developed against [Cloud\nHypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) but there is\nalso support for using QEMU's PVH loader.\n\nThis project was originally developed using\n[Firecracker](https://github.com/firecracker-microvm) however as it does not\ncurrently support resetting the virtio block device it is not possible to boot\nall the way into the OS.\n\n## Features\n\n* virtio (PCI) block support\n* GPT parsing (to find EFI system partition)\n* FAT12/16/32 directory traversal and file reading\n* bzImage loader\n* \"Boot Loader Specification\" parser\n* PE32+ loader\n* Minimal EFI environment (sufficient to boot shim + GRUB2 as used by Ubuntu)\n\n## x86-64 Support\n\n### Building\n\nTo compile:\n\n```\ncargo build --release --target x86_64-unknown-none.json -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem\n```\n\nThe result will be in:\n\n```\ntarget/x86_64-unknown-none/release/hypervisor-fw\n```\n\n### Running\n\nWorks with Cloud Hypervisor and QEMU via their PVH loaders as an alternative to\nthe Linux kernel.\n\nCloud Hypervisor and QEMU are currently the primary development targets for the\nfirmware although support for other VMMs will be considered.\n\n#### Cloud Hypervisor\n\nAs per [getting\nstarted](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/master/README.md#2-getting-started)\n\nHowever instead of using the binary firmware for the parameter to `--kernel`\ninstead use the binary you build above.\n\n```\n$ pushd $CLOUDH\n$ sudo setcap cap_net_admin+ep ./cloud-hypervisor/target/release/cloud-hypervisor\n$ ./cloud-hypervisor/target/release/cloud-hypervisor \\\n\t--kernel ./target/x86_64-unknown-none/release/hypervisor-fw \\\n\t--disk path=focal-server-cloudimg-amd64.raw \\\n\t--cpus boot=4 \\\n\t--memory size=512M \\\n\t--net \"tap=,mac=,ip=,mask=\" \\\n\t--rng\n$ popd\n```\n\n#### QEMU\n\nUse the QEMU `-kernel` parameter to specify the path to the firmware.\n\ne.g.\n\n```\n$ qemu-system-x86_64 -machine q35,accel=kvm -cpu host,-vmx -m 1G\\\n    -kernel ./target/x86_64-unknown-none/release/hypervisor-fw \\\n    -display none -nodefaults \\\n    -serial stdio \\\n    -drive id=os,file=focal-server-cloudimg-amd64.raw,if=none \\\n    -device virtio-blk-pci,drive=os,disable-legacy=on\n```\n\n## AArch64 Support\n\n### Building\n\nTo compile:\n\n```\ncargo build --release --target aarch64-unknown-none.json -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem\n```\n\nThe result will be in:\n\n```\ntarget/aarch64-unknown-none/release/hypervisor-fw\n```\n\n## RISC-V Support\n\nExperimental RISC-V support is available. This is currently designed to run as a\npayload from OpenSBI under QEMU virt. It is expected wider platform support\nwill become available in the future.\n\n### Building\n\nTo compile:\n\n```\ncargo build --release --target riscv64gcv-unknown-none-elf.json -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem\n```\n\nThe result will be in:\n\n```\ntarget/riscv64gcv-unknown-none-elf/release/hypervisor-fw\n```\n\n### Running\n\nCurrently only QEMU has been tested.\n\n#### QEMU\n\n```\n$ qemu-system-riscv64  -M virt -cpu rv64 -smp 1 -m 1024 \\\n    -nographic -kernel target/riscv64gcv-unknown-none-elf/release/hypervisor-fw \\\n    -drive id=mydrive,file=root.img,format=raw \\\n    -device virtio-blk-pci,drive=mydrive,disable-legacy=on\n```\n\n## Testing\n\n\"cargo test\" needs disk images from make-test-disks.sh\n\nAnd clear-28660-kvm.img:\n\nhttps://download.clearlinux.org/releases/28660/clear/clear-28660-kvm.img.xz\n\nsha1sum: 5fc086643dea4b20c59a795a262e0d2400fab15f\n\n## Security issues\n\nPlease contact the maintainers listed in the MAINTAINERS.md file with security issues.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-hypervisor%2Frust-hypervisor-firmware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-hypervisor%2Frust-hypervisor-firmware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-hypervisor%2Frust-hypervisor-firmware/lists"}