What language is used to program an operating system?

Asked

Viewed 8,991 times

5

What language is used in the programming of an OS?

  • Very Broad the question. You only want to know about Windows or some Linux distribution as well?

  • The main friends

  • The MSX is made large part directly in the same machine code, other parts in Assembly.

3 answers

11


Essentially anyone you want. In a certain way it is possible to write an unconventional operating system even with JS, although it is a bad language for this and there will be strong limitations. There are already Oses written in Moon (here and here).

Some were written in C#: (Singularity, COSMOS, Sharpos, Midori). Others in Java. Anyway, any language can be used to write an OS. I could go on listing Oses in virtually every language mainstream and even in other niche. This can be read here.

Programming languages have the ability to perform any task. Their implementations may limit a little what they can access on hardware where they will rotate.

Of course, some languages are more suitable. That’s why C is widely used for this. C++ has also been used more and more successfully. Assembly dominated this type of development for a long time and there are still cases like this.

Windows is essentially written in C (I won’t post here for obvious reasons, but the internet "makes available" the sources of an old version of it). Many Apis and extra services are written or adapted for C++. Of course it has some small parts in Assembly, it is difficult that there is not at least a small stretch of an OS that is not. Aggregated software can eventually be written in other languages, but I doubt it can be considered part of OS.

To implementation of the language can be more important to define whether it gives to write an OS than the language specified.

Further reading:

  • Thank you so much for sharing your knowledge with me and with everyone at Stackoverflow, you have answered all the questions possible.

  • "I will not post here for obvious reasons". I could explain?

  • Because it would be piracy.

3

In the case of Windows is C, C++, C# and some things in Assembly according to microsoft itself. Linux is just take the distribution code on the internet and look. Most use a lot of C, C++ and Assembly for things that need to be greatly optimized.

0

Currently "production" operating systems are written in C.

  • 1

    All of them? Are you sure? What would be "production"?

  • Windows, Linux, Unixes in general (including Bsds).... IBM mainframes have operating systems written in Assembly, but in general I think they are maintenance, not evolution...there must be real-time/embedded systems written in Assembly.... the "production" systems I consider are a matter of opinion, of course, so the quotes, but in practice, currently write an operating system in a language other than C is something somewhat exotic

  • It’s explained, but every time we use less C and more other languages to write Sos, so C may be considered exotic for this :)

  • 1

    Logo ? How soon is soon ? : ) For me this "soon" will be a few decades yet....

  • As much of the new Oses are already written in other languages, in a certain way is already happening

Browser other questions tagged

You are not signed in. Login or sign up in order to post.