theseus-os / Theseus

Theseus is a modern OS written from scratch in Rust that explores 𝐢𝐧𝐭𝐫𝐚𝐥𝐢𝐧𝐠𝐮𝐚𝐥 𝐝𝐞𝐬𝐢𝐠𝐧: closing the semantic gap between compiler and hardware by maximally leveraging the power of language safety and affine types. Theseus aims to shift OS responsibilities like resource management into the compiler.
https://www.theseus-os.com/
MIT License
2.92k stars 172 forks source link

PCI & interrupts modifications related to USB #1071

Closed NathanRoyer closed 11 months ago

NathanRoyer commented 1 year ago

These are changes indirectly related to the USB PR. It doesn't build on x86 yet, because the changes were only made on aarch64.

The biggest change is that PCI legacy (INTx) interrupts are supported. Their handler wakes up a task that must have been bound to them, else it panics.

In USB, the woken up task simply checks the state of the USB controller, triggering various mechanisms when appropriate. When that task is done, it goes back to sleep using the blocker returned by this function.

NathanRoyer commented 12 months ago

If those are not needed, then you should switch to Mutex.

You were right; I replaced these with Mutexes.