ESALP / ESALP-1

The Endangered Soaring African Lynx-Pidgeon Operating System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lock used in interrupt handlers.

4e554c4c opened this issue · comments

Because of safety the PIC and KEYBOARD static interfaces are spin::Mutex-es. The concepts of locks are very problematic in an interrupt because if we run an isr when the lock is being used, the isr will block forever. This can very easily happen, for example I have to use a lock to access the PICs to signal an end of interrupt. If the pic immediately sent another interrupt (which could happen) the isr called would not be able to even send an end of interrupt. We need to use some sort of safety for these types, but a lock won't work.

Readings on the subject: (from our gracious friends on #rust-osdev)

I'll go through these and think about what we should do for interrupts in the kernel.

I believe that the biggest problem in this was the WRITER lock, and that is now solved. I will close this soon unless there is any objection. Specific locking structs that are creating problems should probably have their own issues or pull requests.