x86 nic irq 11 handling

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
farb
Posts: 1
Joined: Sun Jan 15, 2017 3:18 pm
Libera.chat IRC: farb

x86 nic irq 11 handling

Post by farb »

hi, I've done a simple irq handling and it works for keyboard and timer ( IRQ 1 and 0 ). Unfortunately, as for my simple NIC driver I am capable of sending ARP packets but I don't see any interrupts from it ( IRQ 11 ), even though it's enabled. What would you suggest to do?
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: x86 nic irq 11 handling

Post by iansjack »

Not really a question that anyone can answer without at least seeing your code. You don't even state which NIC you are using.

(That's not an invitation to post vast amounts of code on the forum. Link to your git repository and someone may be patient enough to review your code.)
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: x86 nic irq 11 handling

Post by osdever »

Welcome to OSDev!

What NIC do you use? We need to know that to give you the answer.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: x86 nic irq 11 handling

Post by SpyderTL »

It's time to start eliminating suspects...

Virtually all devices will send interrupt requests, and since there are a limited number of interrupts, all devices must be able to keep track of whether an interrupt was sent or not.

So, your NIC will have to have a register that contains a bit flag that will tell you whether it sent an IRQ or not. (And the OS is responsible for clearing that flag after the interrupt has been handled. This is true for pretty much all devices.)

So, all you need to do is check the value of that flag after a packet is sent (or received). If it is set, your interrupt controller (PiC) or your interrupt handler routine are not set up properly. If it's not set, the NIC has not been set up properly.

Once you determine where the problem is, fixing it should be a lot easier. Let us know what you find.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply