Subject: Re: Booting NetBSD under HVM
To: Manuel Bouyer <>
From: Andreas Gustafsson <>
List: port-xen
Date: 09/07/2007 13:51:30
I investigated the problem of the fdc driver hanging at boot under
Xen/HVM some more by adding lots of debug printfs to sys/dev/isa/fd.c.

It turned out that when it hangs, fdcintr() is getting called
continously, each time returning at the return statement in
the following piece of code:

        /* Is there a drive for the controller to do a transfer with? */
        fd = TAILQ_FIRST(&fdc->sc_drives);
        if (fd == NULL) {
                fdc->sc_state = DEVIDLE;
                return 1;

Looking at some data sheets for various NEC 765 clones (I couldn't
locate one for the original), I see that interrupts are asserted until
acknowledged by issuing a NE7CMD_SENSEI command, but there are several
code paths in fdcintr() where this is not done.

Could someone explain to me how this is supposed to work on physical
hardware?  Could it be that it works only because ISA interrupts are
edge-triggered and therefore do not cause fdcintr() to be called again
immediately after it returns even if it leaves the interrupt line in
the asserted state, and that Xen/HVM effectively emulates a level
triggered interrupt?
Andreas Gustafsson,