Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,093 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,592 people online right now. Registration is fast and FREE... Join Now!




which lang to write an OS?

2 Pages V  1 2 >  
Reply to this topicStart new topic

which lang to write an OS?

zombie
21 Nov, 2007 - 02:20 AM
Post #1

New D.I.C Head
*

Joined: 2 Jan, 2006
Posts: 5


My Contributions
hi there

just wonder I'm in the need of some help and would like some one to assist me

i want to write an Operating system that is like linux which lang is the best to program
in and why?
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: Which Lang To Write An OS?
21 Nov, 2007 - 02:42 AM
Post #2

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
The Linux kernel was written in C. Many of the libraries and such for it were written in either C or C++. However, it took a helluva lot of man hours to write it. You may want to start smaller, and try just modding the linux kernel to start out with. I haven't tried it myself, but from the sounds of it from some people who have, it is quite the learning experience.

As for which is best and why...well, C is a pretty high-level language. However, it lets you stay close to the hardware and do a lot of low-level stuff with it (even to the point of using inline assembly language within your code). And really getting at the machine itself is something that an OS is going to need to be able to do to work effectively.

What kind of a level are you at with programming? If we have a better idea where you're at in your programming career, we might be better able to point you in the right direction with this.
User is offlineProfile CardPM
+Quote Post

Programmist
RE: Which Lang To Write An OS?
21 Nov, 2007 - 05:38 AM
Post #3

Four-letter word
Group Icon

Joined: 2 Jan, 2006
Posts: 1,179



Thanked: 6 times
Dream Kudos: 100
Expert In: Java

My Contributions
I want to see someone write an OS in PHP...no, even better, JavaScript. tongue.gif
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Which Lang To Write An OS?
21 Nov, 2007 - 05:40 AM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,440



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(Programmist @ 21 Nov, 2007 - 07:38 AM) *

I want to see someone write an OS in PHP...no, even better, JavaScript. tongue.gif

http://www.lagmonster.info/humor/windowsrg.html
User is online!Profile CardPM
+Quote Post

MorphiusFaydal
RE: Which Lang To Write An OS?
21 Nov, 2007 - 12:00 PM
Post #5

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,104



Thanked: 8 times
Expert In: Hardware, Networking

My Contributions
QUOTE(jjhaag @ 21 Nov, 2007 - 04:42 AM) *

The Linux kernel was written in C. Many of the libraries and such for it were written in either C or C++. However, it took a helluva lot of man hours to write it. You may want to start smaller, and try just modding the linux kernel to start out with. I haven't tried it myself, but from the sounds of it from some people who have, it is quite the learning experience.


Writing a kernel with the capabilities of Linux 0.01 through 0.10 is usually a requirement for computer science degrees... I know it is for mine.. and it's a one semester class, so it's less "a hell of a lot of man hours" and more "you really need to know what you're doing".. I've seen some implementations that are like.. 500 lines of C that don't do much more than boot and display "hello" to the screen.
User is online!Profile CardPM
+Quote Post

souljaboy
RE: Which Lang To Write An OS?
24 Nov, 2007 - 04:40 AM
Post #6

New D.I.C Head
*

Joined: 24 Nov, 2007
Posts: 6


My Contributions
here a simple answer :

first u need to know a lot about programing , here i m not talking about kiddy programing , rather a serious one , and bout that java script and php , its simple , those languages are themselves dependent how can u make something out of them and hope they are independent....

skills u probably require would be assembly and c++ ( c++ is optional , u could use any one in comparison) , assembly will only do the boot stuff , and then the rest is up to the other language...

mind it , not everyone can create a OS.....

want any help , just contact me...
User is offlineProfile CardPM
+Quote Post

Programmist
RE: Which Lang To Write An OS?
26 Nov, 2007 - 10:29 AM
Post #7

Four-letter word
Group Icon

Joined: 2 Jan, 2006
Posts: 1,179



Thanked: 6 times
Dream Kudos: 100
Expert In: Java

My Contributions
QUOTE(souljaboy @ 24 Nov, 2007 - 06:40 AM) *

and bout that java script and php , its simple , those languages are themselves dependent how can u make something out of them and hope they are independent....

Oh no. I guess I'd better stop my phpOS project then. (wink wink)
User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: Which Lang To Write An OS?
27 Nov, 2007 - 09:18 AM
Post #8

 
Group Icon

Joined: 3 Aug, 2006
Posts: 1,790



Thanked: 1 times
Dream Kudos: 755
My Contributions
QUOTE(no2pencil @ 21 Nov, 2007 - 07:10 PM) *

QUOTE(Programmist @ 21 Nov, 2007 - 07:38 AM) *

I want to see someone write an OS in PHP...no, even better, JavaScript. tongue.gif

http://www.lagmonster.info/humor/windowsrg.html

ROFL!!! Nice one! biggrin.gif
User is offlineProfile CardPM
+Quote Post

skaoth
RE: Which Lang To Write An OS?
28 Nov, 2007 - 12:39 PM
Post #9

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 342



Thanked: 10 times
Dream Kudos: 100
My Contributions
I'd have to agree with everyone here. Writing an OS (at least a fairly capable one) is not a trivial thing.
Most OS's linux and Windows are generally written in C.

I would think that the reason for this is speed.
Also running code at such a low level requires the libraries you
use to be re-entrant. That is why you don't really see
device drivers written in c++. Of course there are wrappers to use
c++ at the kernel level e.g; Numega has one but I don't know
how good/ feature rich it is.

There are alot of details that need to be handled like

* Process abstraction
* Memory management
* Interrupt handling
* Scheduling

and many many more issues.

Also there is a project called singularity, which is an OS written in C#
http://channel9.msdn.com/ShowPost.aspx?PostID=68302
User is online!Profile CardPM
+Quote Post

no2pencil
RE: Which Lang To Write An OS?
28 Nov, 2007 - 12:44 PM
Post #10

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,440



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(skaoth @ 28 Nov, 2007 - 02:39 PM) *

I'd have to agree with everyone here. Writing an OS (at least a fairly capable one) is not a trivial thing.

zombie: while you are creating your OS, be sure to keep an open eye as to the difference between a boot-loader, & an operating system. Maybe take one step at a time, understanding what a boot-loader is, how it works, why it does what it does, & then move on to the OS.

You'll also need to know how (& maybe why) to switch from protected to unprotected memory mode, 16 to 32 bit, ect ect. Basically all of the steps in the boot processes. Getting the computer ready to accept, & processes commands.

This post has been edited by no2pencil: 28 Nov, 2007 - 12:45 PM
User is online!Profile CardPM
+Quote Post

Programmist
RE: Which Lang To Write An OS?
30 Nov, 2007 - 10:15 AM
Post #11

Four-letter word
Group Icon

Joined: 2 Jan, 2006
Posts: 1,179



Thanked: 6 times
Dream Kudos: 100
Expert In: Java

My Contributions
If you're really serious, you'll need more than a few web tutorials. You'll need a solid understanding of the fundamental operating system concepts. There are many books out there. This one is expensive, so it must be good. wink2.gif Kidding, of course. I've read it. It's not terrible, but it's the only one I can speak of from experience. There are many others though. Good luck.

This post has been edited by Programmist: 30 Nov, 2007 - 10:15 AM
User is offlineProfile CardPM
+Quote Post

hazardoxide
RE: Which Lang To Write An OS?
11 Dec, 2007 - 06:55 AM
Post #12

New D.I.C Head
*

Joined: 7 Dec, 2007
Posts: 9


My Contributions
How does the bootloader pass contorl to a kernal written in c, cause when i compile, ofcoarse it makes an exe
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:21PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month