[Vm-dev] SqueakNOS interrupts (was: FFI callback for interrupts in Raspberry)

Javier Pimás elpochodelagente at gmail.com
Tue Feb 20 22:04:55 UTC 2018


That's a perfect description. The isr handler calls
signalSemaphoreWithIndex and
quietly returns. In the image there is one process waiting on each
interrupt (smalltalk)
semaphore, with the smalltalk handling code for that interrupt. Of course,
this only
works for external interrupts, and not for exceptions (normally when you
get a processor
exception while running smalltalk code it means something very wrong just
happened,
so you cannot just go back to it). IIRC for paging we used alienffi
callbacks, but there
is a trick, you have to know a bit about the code triggering the page
faults, in order to
assure that it is safe to reenter the vm.

Handling exceptions is a topic for research. But for that it is necessary
to rethink in which
situations exceptions could happen. For example, could a cogvm generate a
zero division
exception? If not, then a #DE might mean that the vm just crashed.



On Mon, Feb 19, 2018 at 5:58 PM, Jecel Assumpcao Jr. <jecel at merlintec.com>
wrote:

>
> Eliot,
>
> > The thing I do not understand about SqueakNOS and responding to an
> interrupt
> > at an arbitrary time is how one expects to deal with handling an
> interrupt during
> > some sequence of instructions that is between suspension points, such as
> mid
> > way through a store check which is adding an object to the remembered
> set, or
> > mid way through a message lookup.  Does SqueakNOS actually use the
> > enable/disable interrupts approach?
>
> If I understood correctly, the only thing the VM does when it gets an
> interrupt from the 8259 chips is to signal a corresponding semaphore and
> immediately return to what it was doing. At some point in the future the
> code waiting for the semaphore gets scheduled and then run by the VM,
> but at that instant none of the problems you mention should happen. It
> is that code that is resposible for telling the 8259s that the interrupt
> has been handled so only then can it receive the next one.
>
> -- Jecel
>
> http://wiki.squeak.org/squeak/1762 (see "SqueakNOS IRQ Handling" in the
> middle of this page)
>



-- 
Javier Pimás
Ciudad de Buenos Aires
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180220/75dcbe3d/attachment.html>


More information about the Vm-dev mailing list