[edit]NIC driver

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
User avatar
packet50071
Member
Member
Posts: 43
Joined: Sat Dec 22, 2007 2:27 pm
Location: canada

[edit]NIC driver

Post by packet50071 »

I want to add internet support to my OS :D

But i have no clue of what so ever about where to start . I googled but no luck. any pointing to right direction would be great.
Last edited by packet50071 on Sun May 11, 2008 9:54 am, edited 1 time in total.
Technology is here to make things easier not harder.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

have you written a NIC driver? if not, that would deffinately be the first place to start as writing a TCP/IP stack doesn't provide much functionality without a network card.

but, assuming you have. You need to create structures of the various protocols (TCP/IP, ARP, RARP, ICMP, IGMP, etc...) and then parse the structure after the packet has been copied onto the appropriate structure.

If you have some decent assembly knowledge, I believe Dex just relased his TCP/IP stack which you could look at to get you more familiar with the stack. Also, if you google for TCP/IP Stacks I'm sure you will find pre-built structures with explanations to guide you along.
User avatar
packet50071
Member
Member
Posts: 43
Joined: Sat Dec 22, 2007 2:27 pm
Location: canada

Post by packet50071 »

thanks for the reply :)

I don't have NIC driver . thats what I am looking for
Technology is here to make things easier not harder.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

So what NIC card do you have on your sys ?, put the name of it in Google along with date sheet and see what it comes up with.
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

There are some entries on the Wiki for common cards (ne2k and a realtek one iirc).

I'd suggest buying one of those (or using qemu/bochs to emulate one) and write your first driver for that.
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
packet50071
Member
Member
Posts: 43
Joined: Sat Dec 22, 2007 2:27 pm
Location: canada

Post by packet50071 »

I have this VIA Rhine II fast ehternet adapter

I thought there are some standard basic features that are common in all cards. Am i wrong ?
Technology is here to make things easier not harder.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

packet50071 wrote:I have this VIA Rhine II fast ehternet adapter

I thought there are some standard basic features that are common in all cards. Am i wrong ?
Yes, you need to write a driver for your card, Some times you can not find a data sheet.
So you look for Linux or BSD drivers eg:
http://www.gelato.unsw.edu.au/lxr/sourc ... ia-rhine.c
In it you will find "References"
This leads to
http://people.freebsd.org/~wpaul/VIA/VT86C100A03.pdf
and
http://people.freebsd.org/~wpaul/VIA/VT6102_021.PDF
Thats how you get info for your driver.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

packet50071 wrote: I thought there are some standard basic features that are common in all cards. Am i wrong ?
There are "standards" but unfortunately finding a card that actually obeys the standards is hit or miss. Ne2K is one type of standard.
Post Reply