qemu pci in same vendor id

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Freenode IRC: 573410792

qemu pci in same vendor id

Post by Raymond »

I test pci in qemu,but i got the same vendor id,it maybe that i have not set the pci config

how to config pci?

The code is

Code: Select all

#define PCI_BUS_CONFIG(bus,dev,func,reg) 0x80000000|(bus<<16)|(dev&0x1f<<11)|(func&0x07<<8)|(reg&0x3f<<2)|0x00


Code: Select all

    int addr,data;
   char bus,dev,func,reg;
   reg = 0x00;
   int i,j,k;
   int net_mem = 0x40;
   ioaddr = 0xc040;
   
   for(i=0;i<8;i++){
   addr = PCI_BUS_CONFIG(0,i,0,reg);
   io_out32(0xCF8,addr);
   data = io_in32(0xCFC);
   sprintf(ns,"pci %x",data);
   putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16*(i+2), COL8_FFFFFF, ns);
   }


My config is
qemu-system-x86_64w.exe -L . -m 32 -localtime -fda fdimage0.bin -hda wood.img -net nic,vlan=0,macaddr=08:62:66:c7:9f:69,model=ne2k_pci,addr=08
Attachments
pci.JPG
Post Reply