How to write and read from a network card in x86 assembly?

Does anyone know how to access devices such as an Ethernet port on a motherboard or on a pci card?

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

Thanks in advance.

+3
source share
4 answers

It depends on the particular Ethernet MAC chip you are trying to talk to. Even chips in the same family often have small differences in how they work. That's why modern OSs have the concept of a โ€œdriverโ€: a hardware manufacturer usually writes a driver because it knows 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 manufacturer of the MAC chip to write your own driver. Again, you must know exactly which chip you are trying to talk with in order to get the right specifications. Some chips do not have public documentation, but usually this is not a problem with Ethernet chips.

+2
source

, , , , , - C , , .

C, , NIC , winpcap. raw sockets Windows, , .

, . , LAN91C111 , . Eterthet .

, IMHO. - .

+2

, inupt output - . ethernet , .

- DOS, , Windows. Ethernet, MSDOS. MSDOS. - Windows, .

0

You will need to write specific port addresses. This wiki page can help you get started. MemoryMappedIO

0
source

All Articles