PIO vs MMIO Architecture

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
Hello to everyone,

I am very new on the Hardware architecture field and I am trying to understand some low-level hardware things.
If somebody have the patience to explain me or to guide me how I will understand the communication of a NIC (network adapter) with the hardware and the OS?
I read something about PIO and MMIO but these two architectures are based on the hardware (motherboard) or the brand of the CPU?
I mean, an Intel CPU defines how a NIC communicate with the hardware in different way than an ARM-based CPU ?
or motherboards define this kind of communication?

Many thanks,

Regards,
Elias
 
Ellis:

This https://en.wikipedia.org/wiki/TCP_offload_engine article may help a lot.

Points to remember is that TCP/IP is guaranteed delivery and that packets can arrive out of order from different paths. UDP arrives in order but may have drop outs. This is typically used for audio and video.

The NIC HAS to examine the header, usually at the hardware level at least for rejection. That packet isn't for me. Many parts can be passed to silicon or NIX firmware to munch on.

Also see: https://nmap.org/book/tcpip-ref.html

Generally, what makes it work is that every NIC has a unique MAC address. That MAC address has to really be unique along a route, so the possibility exists to clone MAC addresses when you replace cable modems without contacting the cable company.

The IP address allows routing of packets.
 

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
Thanks guys for your answers.
@KeepItSimpleStupid I am interesting for more advanced low level information. Not at high level like TCP/IP protocols and packet info.
I am looking for information about how a NIC communicate with the hardware through the registers and the memory bus.

@shteii01 Can you be more specific? Do you mean that If I have a motherboard and use two different CPU architectures (intel, ARMv8)
the NIC communicates in the same way with the hardware registers through the memory bus?
If I want to find out the state of a NIC (read the values of registers) I have read the motherboard's manual to see which registers use for I/O ports?

Sorry for this mess, I am very confused about this.
I want to understand which registers and ports a NIC card use to communicate with the hardware and how a CPU take part on this.

Many thanks!
 

BR-549

Joined Sep 22, 2013
4,928
Ab.....The nic card will communicate to the OS......which and thru a driver software routine......which is supplied by the nic card manufacturer. The driver for windows will be different than a driver for linux.

The driver takes care of assigning registers and buffers and I/O.

Does that make any sense to you? A driver is like a little software patch that is added to and booted with the OS.
 

shteii01

Joined Feb 19, 2010
4,644
Thanks guys for your answers.
@KeepItSimpleStupid I am interesting for more advanced low level information. Not at high level like TCP/IP protocols and packet info.
I am looking for information about how a NIC communicate with the hardware through the registers and the memory bus.

@shteii01 Can you be more specific? Do you mean that If I have a motherboard and use two different CPU architectures (intel, ARMv8)
the NIC communicates in the same way with the hardware registers through the memory bus?
If I want to find out the state of a NIC (read the values of registers) I have read the motherboard's manual to see which registers use for I/O ports?

Sorry for this mess, I am very confused about this.
I want to understand which registers and ports a NIC card use to communicate with the hardware and how a CPU take part on this.

Many thanks!
To use medical analogy.
CPU is a brain.
Chipset is heart.

If your brain is dead. The heart is still alive and beating, and your body is still alive.
If the heart is dead, the brain is dead and the rest of the body is dead.

In conclusion. Forget cpu.
 

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
Hello everyone,
Thanks again for your answers, you are very kind.

I think that, @BR-549 answer is what I am looking to understand more in depth.
@KeepItSimpleStupid Thanks for the pdf.

To be more specific about what I want to find and do:
I have an ARM-based server (ARMv8 architecture) with a NIC on motherboard not through a PCI (Mellanox connectx-3 brand).
I want to find out what registers use and IO ports to "read" and "write" into memory (MMIO) to communicate with the CPU and then with the OS.

If I have understand right, the drivers define the internal device registers that the NIC use to write to and read through the physical memory in a situation like MMIO, right?
Lets assume that the drivers are open-source, so, is there any way to indentify those device registers? are kind obvious?

@KeepItSimpleStupid in the link that you sent me has a portion about "Programmer’s Visible State". Is this relative with that I am looking for?

Also, what is the difference between device registers and IO ports?

Many thanks.
 
Also, what is the difference between device registers and IO ports?
Probably very little, but maybe a lot. Take a parallel port or an I2C port. To software they are really just bits in a register somewhere., but to the world they have particular electrical characteristics. A UART might have a bit that says the character is ready so there is no direct wire equivalent. One speaks of bit-banging. A spare bit and some software will get you an I2C port.

Network stuff is funny though, In a lot of cases it's closed source.
 

RamaD

Joined Dec 4, 2009
328
The hardware designer decides where to map his IO registers, depending upon his requirements. In a Windows PC with an NIC, goto device manager, select your NIC, goto properties, select resources tab, you will find the IO and Memory used by the NIC.
 

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
The hardware designer decides where to map his IO registers, depending upon his requirements. In a Windows PC with an NIC, goto device manager, select your NIC, goto properties, select resources tab, you will find the IO and Memory used by the NIC.
Hello guys,
@RamaD this is a great info and advice. Do you know how I can find this in a Linux Kernel and CentOS 7 PC?
Are there any software or commands that I can execute and show me an output with the IO registers that the OS needs and use?

Thanks again all of you guys for your help and advises!
 
Top