ne2000 send packet problem
Posted: Mon Oct 10, 2016 5:54 pm
I used the code on osdev.org for ne2000 which can send the packets,i run it on bochs,i get the mac address.
ioaddr---0xC040
irq---11
These are logs of bochs,i think they are right.Because i used '0xC040' ioaddr to get the mac addr successfully.
But when i send the data to the remote dma,it should have an interrupt after sending all the data,but my code
do not show the irq flag
code below:
I finished all the function,i just need a help.
(There is a pic file to show the screen below. )
ioaddr---0xC040
irq---11
These are logs of bochs,i think they are right.Because i used '0xC040' ioaddr to get the mac addr successfully.
But when i send the data to the remote dma,it should have an interrupt after sending all the data,but my code
do not show the irq flag
code below:
Code: Select all
void init_net(struct BOOTINFO *binfo){
sprintf(ns,"init net");
putfonts8_asc(binfo->vram, binfo->scrnx, 0, 32, COL8_FFFFFF, ns);
int addr,data;
reg = 0x10;
int i;
short count = 42;
ioaddr = 0xc040;
addr = PCI_BUS_CONFIG(0,3,0,reg);
io_out32(0xCF8,addr);
io_out32(0xCFC,ioaddr);
make_arp_pac();//here is make arp packet info
io_out8(ioaddr+0x00,0x22);//COMMAND register set to "start" and "nodma"
io_out8(ioaddr+0x0a,count&0xff);//low byte count
io_out8(ioaddr+0x0b,(count>>8)&0xff);//high byte count
io_out8(ioaddr+0x07,(1<<6));//Remote DMA complete?
io_out8(ioaddr+0x08,0x00);//loaded with 0x00 (low)
io_out8(ioaddr+0x09,0x40);//target page number (high)
io_out8(ioaddr+0x0f,0x40);//IMR
for(i=0;i<42;i++){
io_out8(ioaddr+0x10,nic_data[i]);
}
sprintf(ns,"nic int %x",nic_flag);
putfonts8_asc(binfo->vram, binfo->scrnx, 0, 48, COL8_FFFFFF, ns);
}
(There is a pic file to show the screen below. )