which lang to write an OS?

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 7001 Views - Last Post: 13 January 2008 - 07:35 PM

#1 zombie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 02-January 06

which lang to write an OS?

Post icon  Posted 21 November 2007 - 03:20 AM

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?
Is This A Good Question/Topic? 0
  • +

Replies To: which lang to write an OS?

#2 jjhaag  Icon User is offline

  • me editor am smartastic
  • member icon

Reputation: 44
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: which lang to write an OS?

Posted 21 November 2007 - 03: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.

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.
Was This Post Helpful? 0
  • +
  • -

#3 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: which lang to write an OS?

Posted 21 November 2007 - 06:38 AM

I want to see someone write an OS in PHP...no, even better, Javascript. :P
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: which lang to write an OS?

Posted 21 November 2007 - 06:40 AM

View PostProgrammist, on 21 Nov, 2007 - 07:38 AM, said:

I want to see someone write an OS in PHP...no, even better, Javascript. :P

http://www.lagmonste.../windowsrg.html
Was This Post Helpful? 0
  • +
  • -

#5 MorphiusFaydal  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: which lang to write an OS?

Posted 21 November 2007 - 01:00 PM

View Postjjhaag, on 21 Nov, 2007 - 04:42 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#6 souljaboy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-November 07

Re: which lang to write an OS?

Posted 24 November 2007 - 05:40 AM

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...
Was This Post Helpful? 0
  • +
  • -

#7 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: which lang to write an OS?

Posted 26 November 2007 - 11:29 AM

View Postsouljaboy, on 24 Nov, 2007 - 06:40 AM, said:

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)
Was This Post Helpful? 0
  • +
  • -

#8 Louisda16th  Icon User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: which lang to write an OS?

Posted 27 November 2007 - 10:18 AM

View Postno2pencil, on 21 Nov, 2007 - 07:10 PM, said:

View PostProgrammist, on 21 Nov, 2007 - 07:38 AM, said:

I want to see someone write an OS in PHP...no, even better, Javascript. :P

http://www.lagmonste.../windowsrg.html

ROFL!!! Nice one! :D
Was This Post Helpful? 0
  • +
  • -

#9 skaoth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 91
  • View blog
  • Posts: 601
  • Joined: 07-November 07

Re: which lang to write an OS?

Posted 28 November 2007 - 01:39 PM

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...px?PostID=68302
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: which lang to write an OS?

Posted 28 November 2007 - 01:44 PM

View Postskaoth, on 28 Nov, 2007 - 02:39 PM, said:

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 November 2007 - 01:45 PM

Was This Post Helpful? 1
  • +
  • -

#11 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: which lang to write an OS?

Posted 30 November 2007 - 11:15 AM

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 November 2007 - 11:15 AM

Was This Post Helpful? 0
  • +
  • -

#12 hazardoxide  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 07-December 07

Re: which lang to write an OS?

Posted 11 December 2007 - 07:55 AM

How does the bootloader pass contorl to a kernal written in c, cause when i compile, ofcoarse it makes an exe
Was This Post Helpful? 0
  • +
  • -

#13 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: which lang to write an OS?

Posted 11 December 2007 - 08:58 AM

View Posthazardoxide, on 11 Dec, 2007 - 07:55 AM, said:

How does the bootloader pass contorl to a kernal written in c, cause when i compile, ofcoarse it makes an exe

Granted that it is a Windows/Dos File System. Otherwise, what does the file extension have to do with anything?
Was This Post Helpful? 0
  • +
  • -

#14 hazardoxide  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 07-December 07

Re: which lang to write an OS?

Posted 11 December 2007 - 09:38 AM

I guess what im asking is, ok, i write the kernel, compile it, it works, and save it as an exe on a floppy. how do i make a bootloader on a floppy with it read it.
like, how would i command it to load the exe kernel?
Was This Post Helpful? 0
  • +
  • -

#15 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: which lang to write an OS?

Posted 11 December 2007 - 10:38 AM

http://www.viralpate..._bootloader.php
As found here : http://www.dreaminco...p;hl=bootloader & supplied by Martyr2.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2