KestrelComputer / kestrel

The Kestrel is a family of home-made computers, built as much as possible on open-source technology, and supporting as much as possible the open-source philosophy.
http://kestrelcomputer.github.io/kestrel
Mozilla Public License 2.0
185 stars 10 forks source link

Problem: e emulator incorrectly vectored interrupts. #202

Closed sam-falvo closed 8 years ago

sam-falvo commented 8 years ago

e used to calculate the interrupt handler's address from the current privilege level (bits 2, 1 of mstatus), which was always machine-mode. It should take bits 5, 4 of mstatus instead (the privilege level of the interrupted control flow).

Alternatively, continue to use bits 2, 1, but withhold changing mstatus until after handler address calculation completes.