Re:Xv6
by david-given on Monday November 16, 2015 @04:13AM
(#10573408)
In Ada you just annotate a procedure as being an interrupt handler and it Just Works.
In addition, you can annotate a protected object (essentially, a group of shared procedures protected by an implicit mutex) as being interrupt-safe, and then any access to that object will be automatically protected by the appropriate instructions.
Plus, if you're in a Posix environment, you can use the exact same mechanism for interrupt handling. It's all remarkably elegant.
Alas, like everything Ada, the documentation is opaque in the extreme, but:
https://www2.adacore.com/gap-static/GNAT_Book/html/aarm/AA-C...
Note that at the bottom they're defining a parameterised interrupt handler structure and then instantiating it multiple times on multiple IRQs, each of which is in its own isolation domain...
Most other languages hide away implementation details that are critical to writing an operating system--how would you handle, say, interrupts?