Programming a driver for network card(s)

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
sevobal
Member
Member
Posts: 63
Joined: Sun Oct 22, 2006 7:11 am

Programming a driver for network card(s)

Post by sevobal »

Hi,
I want to write a simple program for my OS which just works like ping.exe
But I don't know how to control the ethernet card...are there any information how to program them (low-level). Which types of cards (chipsets) are available and where are the differents? Are there any good links with which I can deal? I hope it is possible to write a driver...

Thank U for your help :D
User avatar
spix
Member
Member
Posts: 128
Joined: Mon Jun 26, 2006 8:41 am
Location: Millicent, South Australia
Contact:

Post by spix »

http://www.vijaymukhi.com/vmis/roll.htm

That link might be helpful
User avatar
muisei
Member
Member
Posts: 79
Joined: Sat Sep 23, 2006 2:10 pm
Location: Bulgaria
Contact:

Post by muisei »

Try to read the datasheet for your Network card chip.
http://www.alldatasheet.com/
For example search for
NE2000
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

You first job should be a pci scan function, that can scan and find a pci by its vendor/device ID, also some functions for "PciRegWrite","PciRegRead" then you can test for install card.
Than you can start writing your driver, go for one with lots of info like "RTL8139" get the data sheet there is info in the sheet with loads of offsets address, it as simple as getting the address that your FindPciCard function returns, adding the offset, you can then read the bits at the address or change the bits at the address to do differant things, but all the info of what each bit does is in the data sheet.
User avatar
lode
Posts: 15
Joined: Tue Oct 17, 2006 6:28 pm
Location: Oulu, Finland

Post by lode »

The GRUB source code has some small drivers for several cards. I found those to be very helpful in writing my own.
Post Reply