{"id":22911283,"url":"https://github.com/rust-osdev/ieee1275-rs","last_synced_at":"2025-05-09T01:33:42.279Z","repository":{"id":92571697,"uuid":"500821669","full_name":"rust-osdev/ieee1275-rs","owner":"rust-osdev","description":"Rudimentary ieee1275/OpenFirmware Rust environment similar to uefi-rs.","archived":false,"fork":false,"pushed_at":"2024-09-09T17:25:39.000Z","size":46,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"mainline","last_synced_at":"2025-03-31T20:39:47.090Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-osdev.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":"2022-06-07T12:00:09.000Z","updated_at":"2025-03-15T02:36:34.000Z","dependencies_parsed_at":"2024-07-27T01:44:52.929Z","dependency_job_id":null,"html_url":"https://github.com/rust-osdev/ieee1275-rs","commit_stats":{"total_commits":65,"total_committers":1,"mean_commits":65.0,"dds":0.0,"last_synced_commit":"909b2bba2bc38fd44cfebe41f1eaee029c52ce83"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fieee1275-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fieee1275-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fieee1275-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fieee1275-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-osdev","download_url":"https://codeload.github.com/rust-osdev/ieee1275-rs/tar.gz/refs/heads/mainline","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174426,"owners_count":21865865,"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-12-14T04:16:00.526Z","updated_at":"2025-05-09T01:33:42.257Z","avatar_url":"https://github.com/rust-osdev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFirmware Rust environment\n\nThis is an attempt at creating a basic runtime environment much like [uefi-rs](https://github.com/rust-osdev/uefi-rs).\n\nFor now this project is only targetting PowerVM/POWER environments as well as QEMU/SLOF. Compatibility with older PowerPC Macs is not a priority, although contributions that are easy to maintain are welcome.\n\n\n## Build instructions\n\nTo build sample bootloader payload, use the crate under the ```template`` directory.\n\nThis is configured as a cross compilation crate by default. The output binaries are required to be PPC32bit big endian. You need a working powerpc gcc compiler, you may need to tweak ```.cargo/config``` to point to the right binaries.\n\nYou also need to install the powerpc targe using ```rustup```, as of now this create requires nightly so you need to make it default too:\n\n```$ rustup target add powerpc-unknown-linux-gnu```\n\nTo create a valid build you need to use --release, debug builds will fail (not clear why yet):\n\n```\n$ rustup default nightly\n$ cargo +nightly build --release --target powerpc-unknown-linux-gnu\n```\n\n## Testing\n\nYou need qemu-system-ppc64le and the SLOF firmware binary, in fedora you can run it by having a disk image with a GPT partition table and a 4MB PReP partition where the binary will be written:\n\n```\n$ fallocate -l 2G disk.img\n$ cfdisk -z disk.img\n                               ┌ Select label type ───┐\n                               │◼gpt◼◼◼◼◼◼◼◼◼◼◼◼◼\n                               │ dos                  │\n                               │ sgi                  │\n                               │ sun                  │\n                               └──────────────────────┘\n                                    Disk: disk.img\n                    Size: 2 GiB, 2147483648 bytes, 4194304 sectors\n             Label: gpt, identifier: B0FB3AB0-6C25-8D49-97F1-92E9AD879852\n\n    Device               Start          End      Sectors     Size Type\n\u003e\u003e  disk.img1             2048        10239         8192       4M PowerPC PReP boot    \n    disk.img2            10240      4194270\t 4184031       2G Linux filesystem\n ┌───────────────────────────────────────────────────────────────────────────────────┐\n │Partition UUID: 91A7B5D3-6237-834E-A3F2-6D7D87CB3A57                               │\n │Partition type: PowerPC PReP boot (9E1A2D38-C612-4316-AA26-8B49521E5A8B)           │\n └───────────────────────────────────────────────────────────────────────────────────┘\n  [ Delete ]  [ Resize ]  [  Quit  ]  [  Type  ]  [  Help  ]  [  Write ]  [  Dump  ]\n\n```\n\nTo deploy the image we need to setup the disk image in a loopback device\n```\n$ sudo losetup -P -f disk.img\n$ losetup -a\n$ sudo losetup -a\n/dev/loop0: [0043]:2771583 (/path/to/disk.img)\n$ sudo dd if=target/powerpc-unknown-linux-gnu/release/of-rs-template of=/dev/loop0p1\n```\n\nAnd finally we need to launch QEMU:\n```\n$ qemu-system-ppc64 -M pseries-6.1 -bios /usr/share/qemu/slof.bin -drive file=disk.img\n```\n\nYou should see a \"Hello from Rust into Open Firmware\" message in the emulator output.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-osdev%2Fieee1275-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-osdev%2Fieee1275-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-osdev%2Fieee1275-rs/lists"}