Skip to contentSkip to conversation

ISA PnP support

Qemu-devel Antony T Curtis 5 participants 8 messages Jun 4, 2004 – Jun 8, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi guys,

I have a working implementation for ISA PnP which works as an add-on to ISA devices (so that the ne2000 implementation can exist as a PnP device which works better for me when running WindowsXP in QEMU).

I have also started writing an another network device based upon the datasheets for the AMD PC-Net II PCI chip... Hopefully this would result in faster more efficient networking with copying packets directly into the target memory space.

Signature · 1 line
Antony T Curtis <[email protected]>
#1 lore raw

Any patches yet? ;)

Thanks,
Hetz

Quoted 11 lines · Antony T Curtis

Hi guys,

I have a working implementation for ISA PnP which works as an add-on to ISA devices (so that the ne2000 implementation can exist as a PnP device which works better for me when running WindowsXP in QEMU).

I have also started writing an another network device based upon the datasheets for the AMD PC-Net II PCI chip... Hopefully this would result in faster more efficient networking with copying packets directly into the target memory space.

#2 lore raw
In reply to Antony T Curtis

Hi,

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

If you implement another network controller, it would be good it Mac OS X/Darwin had drivers for it too.

If you implement it to have a faster network, I think this is a waste of time. IMHO, the bottleneck is not yet in the network controller itself, but in the QEMU network layer.

Fabrice.

Quoted 11 lines · Antony T Curtis

Hi guys,

I have a working implementation for ISA PnP which works as an add-on to ISA devices (so that the ne2000 implementation can exist as a PnP device which works better for me when running WindowsXP in QEMU).

I have also started writing an another network device based upon the datasheets for the AMD PC-Net II PCI chip... Hopefully this would result in faster more efficient networking with copying packets directly into the target memory space.

#3 lore raw
Quoted 2 lines · Fabrice Bellard

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

I've bumped in to this myself but not had time to look at it. What is the problem with NT/2k? Or is it as yet undiagnosed?

Signature · 3 lines
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D
#4 lore raw
Quoted 7 lines · Gianni Tedesco
Quoted 1 line · Fabrice Bellard

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

I've bumped in to this myself but not had time to look at it. What is the problem with NT/2k? Or is it as yet undiagnosed?

I did not try to find it yet (not reached in my TODO list). Activating the PCI traces while NT boots should give a lot of valuable information.

Fabrice.

#5 lore raw
Quoted 7 lines · Fabrice Bellard
Quoted 6 lines · Gianni Tedesco
Quoted 2 lines · Fabrice Bellard

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

Quoted 5 lines
Quoted 2 lines

I've bumped in to this myself but not had time to look at it. What is the problem with NT/2k? Or is it as yet undiagnosed?

I did not try to find it yet (not reached in my TODO list). Activating the PCI traces while NT boots should give a lot of valuable information.

Well I can verify that the bug installing 2k (pausing half way on detecting hardware) has gone with the latest CVS version. Although the bluescreen when enabling PCI on a vm installed without PCI persists. I don't think we can fix this one as the problem is missing boot device.

If -pci is default in future then there should be no problem I think.

Signature · 3 lines
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D
#6 lore raw
In reply to Fabrice Bellard
Quoted 4 lines · Fabrice Bellard

Hi,

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

IMO, the ISAPnP makes sense for the NE2000 implementation... makes it easier to install/run other target OS.

<snip>

The diff is against the current CVS + my qemu-cirrus.patch (in other email).

Signature · 1 line
Antony T Curtis <[email protected]>
Makefile.target +2 -2
diff -burN --exclude=*.bck qemu/Makefile.target qemu-pnp/Makefile.target
@@ -238,7 +238,7 @@
 # Hardware support
 VL_OBJS+= ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o
 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o 
-VL_OBJS+= cirrus_vga.o
+VL_OBJS+= cirrus_vga.o pnp.o
 endif
 ifeq ($(TARGET_ARCH), ppc)
 # Generic PPC support
@@ -246,7 +246,7 @@
 # PREP hardware support
 VL_OBJS+= ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o
 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
-VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o
+VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o pnp.o
 endif
 ifdef CONFIG_GDBSTUB
 VL_OBJS+=gdbstub.o 
hw/ne2000.c +141 -0

153 lines not on this page · raw message

hw/pc.c +7 -0
diff -burN --exclude=*.bck qemu/hw/pc.c qemu-pnp/hw/pc.c
@@ -386,6 +386,10 @@
         stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x210, 0x01);
     }
 
+    if (pnp_enabled) {
+        isa_pnp_init();
+    }
+
     if (pci_enabled) {
         i440fx_init();
         piix3_init();
@@ -431,6 +435,9 @@
         if (nb_nics1 > NE2000_NB_MAX)
             nb_nics1 = NE2000_NB_MAX;
         for(i = 0; i < nb_nics1; i++) {
+            if (pnp_enabled)
+                pnp_ne2000_init(ne2000_io[i], ne2000_irq[i], &nd_table[i]);
+            else
             isa_ne2000_init(ne2000_io[i], ne2000_irq[i], &nd_table[i]);
         }
 
hw/pnp.c +414 -0

414 lines not on this page · raw message

hw/pnpreg.h +250 -0

250 lines not on this page · raw message

vl.c +23 -0
diff -burN --exclude=*.bck qemu/vl.c qemu-pnp/vl.c
@@ -128,6 +128,7 @@
 QEMUTimer *gui_timer;
 int vm_running;
 int audio_enabled = 0;
+int pnp_enabled = 0;
 int pci_enabled = 0;
 int prep_enabled = 0;
 int rtc_utc = 1;
@@ -260,9 +261,26 @@
         ioport_write_table[0][i] = default_ioport_writeb;
         ioport_write_table[1][i] = default_ioport_writew;
         ioport_write_table[2][i] = default_ioport_writel;
+        ioport_opaque[i] = NULL;
     }
 }
 
+int isa_assigned_ioport(int start, int length)
+{
+    int i, result = 1;
+
+    for(i = start; result && i < start + length; i++) {
+        result &= ioport_read_table[0][i] == default_ioport_readb;
+        result &= ioport_read_table[1][i] == default_ioport_readw;
+        result &= ioport_read_table[2][i] == default_ioport_readl;
+
+        result &= ioport_write_table[0][i] == default_ioport_writeb;
+        result &= ioport_write_table[1][i] == default_ioport_writew;
+        result &= ioport_write_table[2][i] == default_ioport_writel;
+    }
+    return result == 0;
+}
+
 void pstrcpy(char *buf, int buf_size, const char *str)
 {
     int c;
@@ -2079,6 +2097,7 @@
     QEMU_OPTION_L,
     QEMU_OPTION_no_code_copy,
     QEMU_OPTION_pci,
+    QEMU_OPTION_pnp,
     QEMU_OPTION_prep,
     QEMU_OPTION_localtime,
 };
@@ -2128,6 +2147,7 @@
 
     /* temporary options */
     { "pci", 0, QEMU_OPTION_pci },
+    { "pnp", 0, QEMU_OPTION_pnp },
 #ifdef TARGET_PPC
     { "prep", 0, QEMU_OPTION_prep },
 #endif
@@ -2404,6 +2424,9 @@
                 break;
             case QEMU_OPTION_pci:
                 pci_enabled = 1;
+                break;
+            case QEMU_OPTION_pnp:
+                pnp_enabled = 1;
                 break;
             case QEMU_OPTION_prep:
                 prep_enabled = 1;
vl.h +55 -0

67 lines not on this page · raw message

#7 lore raw
Quoted 8 lines · Antony T Curtis
Quoted 4 lines · Fabrice Bellard

Hi,

I am not really interested by ISA PnP as PCI will be the default config as soon as it works for NT. But I can still look at the patch.

IMO, the ISAPnP makes sense for the NE2000 implementation... makes it easier to install/run other target OS.

I'm just curious, isn't PCI more easier? i.e. at least tested Solaris9 and OpenBSD 3.5 detected it very well...

Karel
--
Karel Gardas [email protected]
ObjectSecurity Ltd. http://www.objectsecurity.com