Booting from an install-CD for Beos 4.5 and another one for Plan9
with PCI enabled gives an error. It seems that the function
register_ioport_write() is called with an address (-4) outside
of its expected range (0-65535).
It appears that both operating systems implement the procedure
described in the application note at page 204 from the document
"http://www.singlix.org/trdos/PCI22.pdf" with the special bits
already cleared.
The following quick patch (against CVS 19-05-2004) works for me
in both cases.
diff -wurb qemu/hw/pci.c qemu-patched/hw/pci.c
--- qemu/hw/pci.c Wed May 19 01:05:28 2004
+++ qemu-patched/hw/pci.c Thu May 20 00:12:46 2004
@@ -145,7 +145,7 @@
r = &pci_dev->io_regions[reg];
if (r->size == 0)
goto default_config;
- if (val != 0xffffffff && val != 0) {
+ if ((val | 0x0f) != 0xffffffff && val != 0) {
/* XXX: the memory assignment should be global to handle
overlaps, but it is not needed at this stage */
/* first unmap the old region */
To be completely correct a distinction should be made between memory
and I/O addressing and in the second case a (val | 0x03) should be
used.