{"id":13648727,"url":"https://github.com/rcore-os/trapframe-rs","last_synced_at":"2025-09-07T06:04:02.604Z","repository":{"id":43603980,"uuid":"224616595","full_name":"rcore-os/trapframe-rs","owner":"rcore-os","description":"Handle TrapFrame across kernel and user space on multiple ISAs.","archived":false,"fork":false,"pushed_at":"2024-07-11T06:16:49.000Z","size":6446,"stargazers_count":35,"open_issues_count":5,"forks_count":24,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-07T06:02:48.304Z","etag":null,"topics":["bare-metal","interrupt","multiple-architectures","operating-system","rust"],"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.md","changelog":"CHANGELOG.md","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":"2019-11-28T09:26:39.000Z","updated_at":"2025-08-31T03:10:16.000Z","dependencies_parsed_at":"2024-11-09T23:30:42.554Z","dependency_job_id":"f6c0cb2c-693c-4982-a2a7-c04885ef8015","html_url":"https://github.com/rcore-os/trapframe-rs","commit_stats":{"total_commits":102,"total_committers":9,"mean_commits":"11.333333333333334","dds":0.4019607843137255,"last_synced_commit":"0f27d58f5a13ae08cf5293ab0999cd12878950e1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rcore-os/trapframe-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Ftrapframe-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Ftrapframe-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Ftrapframe-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Ftrapframe-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcore-os","download_url":"https://codeload.github.com/rcore-os/trapframe-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Ftrapframe-rs/sbom","scorecard":{"id":764665,"data":{"date":"2025-08-11","repo":{"name":"github.com/rcore-os/trapframe-rs","commit":"842607c14da4d2bf3543c5cdc422454f3b4491dd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":2,"reason":"Found 7/25 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/deploy.yml:1","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:102: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:104: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/rcore-os/trapframe-rs/main.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T00:25:56.671Z","repository_id":43603980,"created_at":"2025-08-23T00:25:56.671Z","updated_at":"2025-08-23T00:25:56.671Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274001212,"owners_count":25205211,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bare-metal","interrupt","multiple-architectures","operating-system","rust"],"created_at":"2024-08-02T01:04:29.217Z","updated_at":"2025-09-07T06:04:02.546Z","avatar_url":"https://github.com/rcore-os.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# TrapFrame-rs\n\n[![Crate](https://img.shields.io/crates/v/trapframe.svg)](https://crates.io/crates/trapframe)\n[![Docs](https://docs.rs/trapframe/badge.svg)](https://docs.rs/trapframe)\n[![Actions Status](https://github.com/rcore-os/trapframe-rs/workflows/CI/badge.svg)](https://github.com/rcore-os/trapframe-rs/actions)\n\nHandle Trap Frame across kernel and user space on multiple ISAs.\n\nSupported ISA: x86_64, aarch64, riscv32, riscv64, mipsel\n\n## Example\n\n### Go to user space\n\n```rust\nuse trapframe::{UserContext, GeneralRegs};\n\nfn kernel_thread() {\n    // initialize trap handling\n    unsafe {\n        trapframe::init();\n    }\n    // construct a user space context, set registers\n    let mut context = UserContext {\n        general: GeneralRegs {\n            rip: 0x1000,\n            rsp: 0x10000,\n            ..Default::default()\n        },\n        ..Default::default()\n    };\n    // go to user space with the context\n    context.run();\n    // come back from user space, maybe syscall or trap\n    println!(\"back from user: {:#x?}\", context);\n    // check the context and handle the trap\n    match context.trap_num {\n        0x3 =\u003e println!(\"breakpoint\"),\n        0xd =\u003e println!(\"general protection fault\"),\n        0x100 =\u003e println!(\"syscall: id={}\", context.general.rax),\n        ...\n    }\n}\n```\n\n### Handle kernel trap\n\n```rust\nuse trapframe::TrapFrame;\n\n#[no_mangle]\t// export a function 'trap_handler'\nextern \"sysv64\" fn trap_handler(tf: \u0026mut TrapFrame) {\n    match tf.trap_num {\n        0x3 =\u003e {\n            println!(\"TRAP: Breakpoint\");\n            tf.rip += 1;\n        }\n        _ =\u003e panic!(\"TRAP: {:#x?}\", tf),\n    }\n}\n```\n\n### More examples\n\n* [x86_64](./examples/uefi)\n* [RISC-V](./examples/riscv)\n\n## Internal\n\nControl flow on x86_64:\n\n![x86_64](./docs/x86_64.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2Ftrapframe-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcore-os%2Ftrapframe-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2Ftrapframe-rs/lists"}