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!
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.
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.
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...
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)
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
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
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. 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