What port is ethernet controller on?

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
computertrick
Member
Member
Posts: 71
Joined: Wed May 29, 2013 1:07 pm

What port is ethernet controller on?

Post by computertrick »

Hi I am wondering what the standard port the Ethernet controller responds to?

For example keyboard is 0x60 I think

Code: Select all

in ax, PORT_HERE
I am trying to get some form of communication with my operating system once I have done that I am planning to implement IP and some raw protocol I will make or maybe I will attempt to implement UDP.

Also for future reference does anybody know of a port list that shows what devices respond to what ports. I have looked online for this but I am having trouble finding anything. Maybe I am using the wrong query's

Many thanks
1100110100010011
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: What port is ethernet controller on?

Post by AJ »

Hi,

There is no standard port for the Ethernet controller - you need to query ACPI (or PCI) for this and write a driver specific to the type of controller(s) you are targeting.

Cheers,
Adam

[edit: ..and the same can be said of any hardware that is not legacy ISA - ACPI should be your first port of call.]
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: What port is ethernet controller on?

Post by rdos »

AJ wrote:Hi,

There is no standard port for the Ethernet controller - you need to query ACPI (or PCI) for this and write a driver specific to the type of controller(s) you are targeting.

Cheers,
Adam

[edit: ..and the same can be said of any hardware that is not legacy ISA - ACPI should be your first port of call.]
Not so. All ethernet controller's I know about are PCI-based, and are identified by the vendor and product Id in PCI space. When you have found the controller your device driver supports, you will then extract it's address (either IO or memory) from some of the PCI-BARs. ACPI has no useful info about this (and certainly doesn't have the IO address). The only useful information ACPI provides is the IRQ number, but it is possible to probe IRQs, or use timers instead.

ACPI is practically only useful for legacy-devices.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: What port is ethernet controller on?

Post by bluemoon »

rdos wrote:Not so. All ethernet controller's I know about are PCI-based
I have quite a few ISA ethernet card sitting here, some even have BNC head instead of cat-5. :mrgreen:
rdos wrote:The only useful information ACPI provides is the IRQ number, but it is possible to probe IRQs, or use timers instead.
If the card is PCI-based, you can get IRQ from BAR as well.

PS. I'm not sure how PCI could handle USB ethernet adapter, but that seems beyond OP's interest.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: What port is ethernet controller on?

Post by rdos »

bluemoon wrote:
rdos wrote:Not so. All ethernet controller's I know about are PCI-based
I have quite a few ISA ethernet card sitting here, some even have BNC head instead of cat-5. :mrgreen:
I've thrown those away. :mrgreen:

But, seriously, does ACPI even help with older AT-bus based cards?
bluemoon wrote:
rdos wrote:The only useful information ACPI provides is the IRQ number, but it is possible to probe IRQs, or use timers instead.
If the card is PCI-based, you can get IRQ from BAR as well.

PS. I'm not sure how PCI could handle USB ethernet adapter, but that seems beyond OP's interest.
I don't think it is reliable to read-out IRQ # from the BAR. At least I found that this information is often incorrect, which was what motivated the addition of ACPI. What is correct is the assignment to the PCI bus, but not the actual routing to the interrupt controller.
Post Reply