qemu pci in same vendor id
Posted: Thu Oct 27, 2016 9:29 pm
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
My config is
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);
}
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