Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write to & read from network card in x86 assembly?

does anyone know how to gain access to devices such as an ethernet port on a mainboard or on a pci card?

Are there special registers? Opcodes? Do I have to make a call to the OS? If so, how?

Thanks in advance.

like image 804
Kevin Avatar asked Dec 03 '09 04:12

Kevin


1 Answers

It depends on the particular Ethernet MAC chip you're trying to talk to. Even chips in the same family will often have minor differences in how they operate. This is why modern OSes have the "driver" concept: the hardware manufacturer usually writes the driver because they know the hardware, and the driver provides a translation between the hardware and what the OS wants to see.

You can often get documentation from the MAC chip's manufacturer to write your own driver. Again, you have to know exactly which chip you're trying to talk to in order to get the right specs. Some chips have no public documentation, but that's usually not a problem with Ethernet chips.

like image 88
Warren Young Avatar answered Sep 24 '22 05:09

Warren Young