Page 1 of 1

How to make the os networking?

Posted: Sat Sep 28, 2013 2:53 am
by windows8
How to make the os networking? I searched Google and this wiki ,but I only got little inforrmation,I don't have any train of thought to do this.
I found http://forum.osdev.org/viewtopic.php?f= ... rk#p227575,but it doesn't give me some advice.

What should I do? Thank you very much!

Re: How to make the os networking?

Posted: Sat Sep 28, 2013 3:43 am
by dozniak
* Implement the driver for the network card, to the level that you can send and receive proper (ethernet or other) packets.
* Implement higher level protocol like IPv4, IPv6, IPX etc.
* Implement higher level protocol like UDP, TCP.
* Implement higher level protocol like networking socket.
* Build and run!

Re: How to make the os networking?

Posted: Sat Sep 28, 2013 4:38 am
by windows8
dozniak wrote:* Implement the driver for the network card, to the level that you can send and receive proper (ethernet or other) packets.
* Implement higher level protocol like IPv4, IPv6, IPX etc.
* Implement higher level protocol like UDP, TCP.
* Implement higher level protocol like networking socket.
* Build and run!
Oh,I am more interested at the first one than others,can you tell me how to do ? (I know I need to do all. But I need to do the first one first.)
Thank you!!

Re: How to make the os networking?

Posted: Sat Sep 28, 2013 5:54 am
by dozniak
You basically need to write a device driver.

Pick a network card that you want to support, find the documentation and write that driver.
Bochs emulates several devices for which it is relatively easy to find documentation (for example the NE2000 card is fairly well documented, with code samples and data sheets). Other cards in the wild might be worse documented.
I'd start with ne2k and learn how the send/receive machinery works.

Re: How to make the os networking?

Posted: Sat Sep 28, 2013 9:01 pm
by Bender
It isn't that easy, To get started you first need to learn how to make a serial[pretty easy] file transfer, like transfering files from a Linux machine to your OS through a serial port. That would be a learning tool. Then you would need to implement the TCP/IP, so that your OS can communicate, then you would implement a NIC Driver,
If it was that easy I would have done it ages ago.......
You can have a look at MINIX3 or Linux, they do have a lot of drivers, try to translate them so that they fit into your own operating system. Then you will implement a HTML Parser, to parse HTMLcode in webpages, if possible then try to implement a CSS and a JScript parser. That's all.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 1:42 am
by dozniak
sid123 wrote:Then you will implement a HTML Parser, to parse HTMLcode in webpages, if possible then try to implement a CSS and a JScript parser. That's all.
Um, what?

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 1:50 am
by bwat
sid123 wrote:To get started you first need to learn how to make a serial[pretty easy] file transfer
Actually, common ethernet hardware is easier to program and set up than common serial hardware. The serial hardware has far more switches and modes of operation. Going from zero to being able to ping other computers on the network isn't that hard. UDP is a small step beyond that. TCP, on the other hand, is a much bigger step.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 1:54 am
by dozniak
Tyndur's ne2k driver is about 10kb of source C.

It works in bochs at least and can send and receive packets. Building IP and UDP headers on top of this is trivial.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 2:09 am
by Shaun
what about porting BSD network protocol stack?

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 3:27 am
by Bender
dozniak wrote:
sid123 wrote:Then you will implement a HTML Parser, to parse HTMLcode in webpages, if possible then try to implement a CSS and a JScript parser. That's all.
Um, what?
See that, link he referred it shows a webbrowser displaying a webpage, of course he, has to implement a parser if he wants it like that.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 3:32 am
by Bender
bwat wrote:
sid123 wrote:To get started you first need to learn how to make a serial[pretty easy] file transfer
Actually, common ethernet hardware is easier to program and set up than common serial hardware. The serial hardware has far more switches and modes of operation. Going from zero to being able to ping other computers on the network isn't that hard. UDP is a small step beyond that. TCP, on the other hand, is a much bigger step.
That matters person to, person, I programmed a serial easily for my OS, Maybe you will find a TCP/IP Driver easy. It was just a suggestion.....
The problem is that none of the hardware manufacturers would give him drivers, unlike other OSes, I guess networking for a hobby OS is too much, unless you have a, team to work with.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 3:47 am
by bwat
sid123 wrote:I programmed a serial easily for my OS, Maybe you will find a TCP/IP Driver easy.
What's a TCP/IP driver?
If you mean TCP/IP stack, then no, that's not easy and I never claimed it was.
sid123 wrote: I guess networking for a hobby OS is too much, unless you have a, team to work with.
Yet there is plenty of evidence to prove you wrong.

Re: How to make the os networking?

Posted: Sun Sep 29, 2013 4:37 am
by Bender
Yup there is a great evidence to prove me wrong!
You're RIGHT! =D>
I learned today in my class that Linux was first a hobby OS?????!?!!!!?!?!?!?!?!?!?!?!?!?!!?!?!?!?!?!?!?!?!!?!!?!?!!?!?! :shock:
I am wrong...