{"id":16948900,"url":"https://github.com/dentosal/cpuio-rs","last_synced_at":"2025-03-21T10:10:00.544Z","repository":{"id":83101217,"uuid":"437707431","full_name":"Dentosal/cpuio-rs","owner":"Dentosal","description":"Raw CPU port IO","archived":false,"fork":false,"pushed_at":"2021-12-19T12:44:55.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T06:25:40.953Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dentosal.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":"2021-12-13T02:09:25.000Z","updated_at":"2022-12-28T13:32:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1fa1be37-4b86-4192-b921-b26aff146522","html_url":"https://github.com/Dentosal/cpuio-rs","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/Dentosal%2Fcpuio-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fcpuio-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fcpuio-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fcpuio-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dentosal","download_url":"https://codeload.github.com/Dentosal/cpuio-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776338,"owners_count":20508506,"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-10-13T21:52:38.604Z","updated_at":"2025-03-21T10:10:00.523Z","avatar_url":"https://github.com/Dentosal.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `cpuio`: Rust wrapper for `inb`, `outb`, etc., instructions\n\nThis is a fork of [emk/toyos-rs](https://github.com/emk/toyos-rs) with [fixes by rybot666](https://github.com/rybot666/toyos-rs/tree/new-asm-syntax),\nwith the cpuio crate extracted to a standalone repo.\n\n**WARNING: The interface to the low-level `outb`, `outw` and `outl`\nfunctions has changed to match Linux.  Please reverse the order of\narguments to these three functions.**\n\nThis library is intended to be run on bare metal, and it only depends on\nthe `core` library.\n\nTo use this, add it to your `Cargo.toml` file and call `cpuio::Port::new`\nto create a port, being sure to specify `u8`, `u16` or `u32` depending on\nthe size data supported by the port.\n\n```rust\nextern crate cpuio;\n\nuse cpuio::Port;\n\nfn main() {\n    // Create a port pointing at 0x60, the address of the PS/2 keyboard\n    // port on x86 hardware.  This is an unsafe operation because many\n    // ports can be used to reconfigure your underlying hardware, and\n    // it's the responsiblity of the port creator to make sure it's\n    // used safely.\n    let mut keyboard: Port\u003cu8\u003e = unsafe { Port::new(0x60) };\n\n    // Read a single scancode from a PS/2 keyboard.  If you run this as\n    // an ordinary user, it will fail with a SIGSEGV.\n    println!(\"scancode: {}\", keyboard.read());\n}\n```\n\nThe constructor `Port::new` is available as a `const fn`, which allows you\nto configure a port at compile time.\n\nThe is also an `UnsafePort` type which is identical, except that `read` and\n`write` are explicitly marked as unsafe.  It's better to use `UnsafePort`\nwhenever any individual port operation might corrupt memory or cause\nundefined behavior.\n\n## Licensing\n\nLicensed under the [Apache License, Version 2.0][LICENSE-APACHE] or the\n[MIT license][LICENSE-MIT], at your option.\n\n[LICENSE-APACHE]: http://www.apache.org/licenses/LICENSE-2.0\n[LICENSE-MIT]: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentosal%2Fcpuio-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdentosal%2Fcpuio-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentosal%2Fcpuio-rs/lists"}