How to make the os networking?

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
windows8
Member
Member
Posts: 33
Joined: Sat Feb 23, 2013 3:52 am

How to make the os networking?

Post 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!
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How to make the os networking?

Post 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!
Learn to read.
windows8
Member
Member
Posts: 33
Joined: Sat Feb 23, 2013 3:52 am

Re: How to make the os networking?

Post 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!!
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How to make the os networking?

Post 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.
Learn to read.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: How to make the os networking?

Post 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.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How to make the os networking?

Post 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?
Learn to read.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: How to make the os networking?

Post 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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How to make the os networking?

Post 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.
Learn to read.
User avatar
Shaun
Member
Member
Posts: 43
Joined: Mon Sep 17, 2012 3:14 am
Contact:

Re: How to make the os networking?

Post by Shaun »

what about porting BSD network protocol stack?
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: How to make the os networking?

Post 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.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: How to make the os networking?

Post 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.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: How to make the os networking?

Post 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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: How to make the os networking?

Post 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...
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
Post Reply