{"id":22911267,"url":"https://github.com/rust-osdev/pic8259","last_synced_at":"2026-03-05T19:37:36.982Z","repository":{"id":47602813,"uuid":"368144797","full_name":"rust-osdev/pic8259","owner":"rust-osdev","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-11T15:32:15.000Z","size":155,"stargazers_count":12,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-01T04:48:49.036Z","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/rust-osdev.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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}},"created_at":"2021-05-17T10:26:02.000Z","updated_at":"2025-03-23T13:08:21.000Z","dependencies_parsed_at":"2023-11-13T09:42:51.242Z","dependency_job_id":"b1022129-103a-45a9-9a8c-7d32011bcadc","html_url":"https://github.com/rust-osdev/pic8259","commit_stats":{"total_commits":142,"total_committers":8,"mean_commits":17.75,"dds":0.204225352112676,"last_synced_commit":"74f745e30a4ae654c598a91b260d7dd63a7e692e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fpic8259","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fpic8259/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fpic8259/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-osdev%2Fpic8259/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-osdev","download_url":"https://codeload.github.com/rust-osdev/pic8259/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253173912,"owners_count":21865773,"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:15:58.920Z","updated_at":"2026-03-05T19:37:31.893Z","avatar_url":"https://github.com/rust-osdev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pic_8259`\n\nAbstractions for 8259 and 8259A Programmable Interrupt Controllers (PICs).\n\nThis project is a fork of the [`pic8259_simple` crate](https://github.com/emk/toyos-rs/tree/master/crates/pic8259_simple) created by [@emk](https://github.com/emk).\n\n**Things we may not handle very well yet include:**\n\n1. Dealing with spurious interrupts.\n2. Non-standard configurations.\n\nThis code is based on the [OSDev Wiki PIC notes][PIC], but it's not a\ncomplete implementation of everything they discuss.  Also note that if you\nwant to do more sophisticated interrupt handling, especially on\nmultiprocessor systems, you'll probably want to read about the newer\n[APIC] and [IOAPIC] interfaces.\n\n[PIC]: http://wiki.osdev.org/8259_PIC\n[APIC]: http://wiki.osdev.org/APIC\n[IOAPIC]: http://wiki.osdev.org/IOAPIC\n\n## Using\n\nThis is a very basic interface to the 8259 and 8259A interrupt controllers,\nwhich are used on single processor systems to pass hardware interrupts to\nthe CPU.\n\nTo use this crate, add it to your `Cargo.toml` file, along with an\nappropriate kernel-space mutex implementation such as `spin`:\n\n```toml\n[dependencies]\npic8259 = \"0.10.0\"\nspin = \"0.9.0\"\n```\n\nYou can then declare a global, lockable `ChainedPics` object as follows:\n\n```rust\n\nuse pic8259::ChainedPics;\nuse spin::Mutex;\n\n// Map PIC interrupts to 0x20 through 0x2f.\nstatic PICS: Mutex\u003cChainedPics\u003e =\n    Mutex::new(unsafe { ChainedPics::new(0x20, 0x28) });\n```\n\nTo perform runtime PIC intialization, call `initialize` before enabling\ninterrupts:\n\n```rust\nPICS.lock().initialize();\n```\n\nWhen you've finished handling an interrupt, run:\n\n```rust\nPICS.lock().notify_end_of_interrupt(interrupt_id);\n```\n\nIt's safe to call `notify_end_of_interrupt` after every interrupt; the\n`notify_end_of_interrupt` function will try to figure out what it needs to\ndo.\n\nAll public PIC interfaces are `unsafe`, because it's really easy to trigger\nundefined behavior by misconfiguring the PIC or using it incorrectly.\n\n## Crate Feature Flags\n\n- `nightly` - Uses features that are only usable on nightly Rust. Enabled by default.\n- `stable` - Enable this feature flag to build this crate on stable Rust. You have to add `default-features = false, features = [\"stable\"]` to your `Cargo.toml`.\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%2Frust-osdev%2Fpic8259","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-osdev%2Fpic8259","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-osdev%2Fpic8259/lists"}