Some things that were previously hard VM-level errors are now handled by
interrupts. While this is relatively easy to handle, I was wanting a
little more structure for the error types - so, errors that should
invoke an interrupt are passed along in their own structure in a
VmError::Interrupt variant. If an error is raised during the tick()
phase of execution that would cause an interrupt, that interrupt is
intercepted and the VM continues.
The State::interrupt() function also will catch double faults and triple
faults, with a triple fault being its own variant in the VmError
structure (so it cannot be intercepted as an interrupt by accident).
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Number tokens with a dollar sign are kind of cumbersome and don't really
serve a purpose, so I'm removing them.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
It makes sense to allow users to set the initial register values. This
allows someone to e.g. enable interrupts once the VM has started, or set
the initial stack pointer value.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>