Page 1 of 1

Network driver for a small OS on Bochs

Posted: Sat Mar 05, 2011 7:54 pm
by adr
Hi,

I am still in the early stages of writing a network driver for NE2000 card. The OS will run on bochs.
I wrote an ISR for the interrupt of NIC. But it doesn't fire. The reason is the network packets that I send from the host OS donot reach bochs. I used TAP-Win32 interface. In order to check that the networking is up, I booted up bochs with dlxlinux, and I am able to ping both ways(host <-> guest). But when I boot up bochs with my OS and ping from the host, it says Request Timed Out. I modified the route table, I added static entry to the arp table (because I can't assign an IP address to the nic yet). I also enabled the card to receive broadcast packets. So, when I ping the broadcast address from the host, the packets should reach the nic and the interrupt should fire.. am I correct? But that doesnt happen.

I would like to know if I am right in thinking that the nic will be able to receive the packets and fire the interrupts, when they are broadcast packets (using an IP address). Since I have not yet assigned an IP address or subnet mask, will the packet reach my nic just because there is an arp table entry?

Thank you for your patience,
ADR

Re: Network driver for a small OS on Bochs

Posted: Sun Mar 06, 2011 7:50 am
by thepowersgang
You seem to not be understanding the idea of a network stack.

ping will fail unless your OS has support for IP (and the required protocols below it)

As for the IRQ not firing, have you masked interrupts correctly on the card? Is there an interrupt currently active?

Re: Network driver for a small OS on Bochs

Posted: Sun Mar 06, 2011 5:12 pm
by adr
I do understand why the ping does/will fail. My question is regarding the interrupt.
I have cleared the ISR and set the IMR to 0x0B

Re: Network driver for a small OS on Bochs

Posted: Mon Mar 07, 2011 6:49 pm
by thepowersgang
Since you're using Bochs, I suggest breaking out the debugger and using the "info ne2000" command to get the card state, this should tell you if there's something you have forgotten to do.