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.
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.