BusLogic SCSI Adapter and no interrupts

Discussions related to using VirtualBox on Windows hosts.
Post Reply
fys
Posts: 8
Joined: 1. Mar 2020, 22:50
Primary OS: MS Windows other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Other
Location: USA
Contact:

BusLogic SCSI Adapter and no interrupts

Post by fys »

I, like many, have a hobby of creating our own operating system. I would like to say that I am a bit further along than most in my endeavors. As most of us here know, we like to use emulators to test our code.

I recently started to code a driver for the BusLogic SCSI controller and have made it quite far along, albeit polling the Interrupt register. I am now to the point where I wish to allow my interrupt handler to handle the completions.

However, despite everything I can think of, including studying the VirtualBox BusLogic code[1], I cannot seem to see an interrupt when the Adapter sets bit 7 in the INTERRUPT register.

I have placed a lot of debug messages throughout my system, including my system's interrupt handler, and from what I can tell, the VirtualBox BusLogic emulation is not firing an interrupt when it calls PDMDevHlpPCISetIrq() for the BusLogic Adapter.

I have tried changing many settings to no avail.
In fact, when changing the System:Chipset setting from ICH9 to PIIX3, it appears that the BusLogic controller is no longer present in the PCI configuration space. Does the BusLogic Adapter require the ICH9? It shouldn't since it predates the ICH9 by quite a bit.
I have disabled the I/O APIC, using the Legacy PIC8259 and still don't get an interrupt.

Yes, I have done the obvious things:
CPU interrupts are enabled; PIC is unmasked (I see all other interrupts); Cleared the Interrupt bit by writing to the BusLogic CONTROL register; Made sure the Interrupt was Level Triggered (both 8259 and I/O APIC); Even if there is a redirect entry, I am still not getting that redirected interrupt to fire.

To test, at the first of my driver, I read the INTERRUPT register, clearing it if needed, then sending the TEST_COMPLETION_BIT command, which should simply set the two corresponding bits in the INTERRUPT register (the Interrupt Valid and Command Complete bits) and--this is the important part--*Fire and Interrupt*. This process is confirmed on page 24 of the BT-958D specs, Bit 2 Command Complete (CMDC) description:
"This bit is qualified by the Interrupt Valid bit (INTV) also being set and by the generation of a bus interrupt signal."
After a thorough investigation on the Guest side, I can only imagine, though am not implying, that it must be the host's emulation. Therefore, I am asking if anyone here can confirm that they are getting interrupts from the BusLogic BT-958D emulation of VirtualBox.

I am using the latest version of VirtualBox and Extensions on a Windows 10 Host.

Storage is the BusLogic BT-958D emulation, with two ports, one VHD file and one ISO file attached, and a Floppy Controller and disk to boot so as to not use the Buslogic controller's BIOS code. This is so I have a "fresh" BusLogic emulation to do my checks.

I have turned off USB, Network, and other emulation so there are no conflicts.

I have turned off the I/O APIC and am forcing the emulation to use the PIC8259 Controller to (hopefully) eliminate the APIC as a culprit.

Therefore, will someone please verify that they are actually getting a hardware interrupt on IRQ 11 (the PCI LINE register) when the INTERRUPT VALID bit becomes set in the Virtual Box BusLogic Emulation?

Thank you,
Ben

[1] First day, first post. Can't post link, but the file name is "browser->vbox->trunk->src->VBox->Devices->Storage->DevBusLogic.cpp"
fys
Posts: 8
Joined: 1. Mar 2020, 22:50
Primary OS: MS Windows other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Other
Location: USA
Contact:

Re: BusLogic SCSI Adapter and no interrupts

Post by fys »

Just a small update.

After making some other tests, I can get an interrupt to fire if I use the PIIX3 system setting, with APIC and I/O APIC enabled, PCI assumed, no PCIe. However, the exact same tests do not fire an interrupt if I change to the ICH9 setting.
I have also found that the PIIX3 setting does not have a PCIR ROM entry between physical address 0x000C000 and 0x000DFFFF.

I have found that I usually can answer my own questions simply by writing them out within a forum like so :-)

I would still like to know if anyone can confirm this BusLogic emulation fires interrupts with the ICH9 setting.

Thank you,
Ben
The Raven
Posts: 82
Joined: 18. Aug 2016, 20:43

Re: BusLogic SCSI Adapter and no interrupts

Post by The Raven »

BusLogic SCSI adapter with ICH9 works fine with a Windows 2000 Professional Guest.

I created a Windows 2000 VM with the standard template and then changed the chipset
to ICH9.
Installed Windows 2000 to the default IDE drive.
Then I added a new BusLogic SCSI controller and attached a new VDI to it.
Upon re-boot, the Windows 2000 Guest found the new SCSI drive and started the
disk initialisation wizard. I initialised and formatted the disk and used it as a data volume,
which all worked fine.
Testing was done with VirtualBox 6.1.4 on a Debian 10 Host.

It should be noted that the VirtualBox manual says ICH9 is still experimental.
However, I've tested it with both Windows and Linux Guests in the past and found no problems.
fys
Posts: 8
Joined: 1. Mar 2020, 22:50
Primary OS: MS Windows other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Other
Location: USA
Contact:

Re: BusLogic SCSI Adapter and no interrupts

Post by fys »

Thank you for checking.

I too have noticed that the manual and the popup window states that the ICH9 mode is experimental,
hence my inquiry on confirmation of an interrupt within this mode.

I am not implying that VirtualBox is in error here, but I have double (and triple) checked everything
I can think of and can't get it to fire an interrupt in ICH9 mode for the BusLogic Adapter. I will
be sure to post what I find, if I ever do find out.

Thank you for confirming with Win2k.

Ben
fys
Posts: 8
Joined: 1. Mar 2020, 22:50
Primary OS: MS Windows other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Other
Location: USA
Contact:

Re: BusLogic SCSI Adapter and no interrupts

Post by fys »

After a bit more testing and code writing, I can now confirm that the BusLogic emulation does fire an interrupt for the ICH9 chip.

However, there are a few things that it assumes.
- It assumes that the Guest is ACPI aware.
- It assumes that the Guest will execute the _PIC(x) ACPI/AML command. ( <---- A requirement )
- It assumes that the Guest will parse the _PRT package set to get the interrupt number.

This is probably all well expected assumptions.

However, it is just my opinion that an ACPI unaware Guest should still be able to see an interrupt coming from a hardware device that predates ACPI :-)
At the same time, ICH9 wasn't around back then either.

Thanks, Ben
- http://www.fysnet.net/osdesign_book_series.htm
Post Reply