Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am very new to programming and I have started to learn programming just last week. I am still having trouble understanding about programming languages, especially what to use in a particular system.

My first language is Java and it's the only programming language I have experience with.

I know there are a lot of programming languages out there but I am so curious what programming language was used to develop Windows? Can Java be used to develop an OS?

share|improve this question
1  
1  
Proof-of-concept operating system written in Java: jnode.org – user1249 Jul 12 '12 at 17:18

closed as too localized by Jim G., Robert Harvey, gnat, Yannis Rizos Nov 6 '12 at 6:37

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

7 Answers

up vote 14 down vote accepted

While I'm tempted to just link to Google, see this quote:

We use almost entirely C, C++, and C# for Windows. Some areas of code are hand tuned/hand written assembly.

ryan Ryan Waite - Product Unit Manager - Windows HPC

There used to be a Sun backed Java operating system project called (not surpresinly) JavaOS. I wouldn't be surprised if other projects existed/exists.

share|improve this answer
1  
and I suspect an awful lot of profanity! – Martin Beckett Jun 30 '11 at 4:05
2  
@Martin When Win2K source leaked someone grepped the source for curse words: "Curse words: there are a dozen or so "fucks" and "shits", and hundreds of "craps"" (should we nest " in English?). Source: kuro5hin.org/story/2004/2/15/71552/7795 :) – Vitor Braga Jun 30 '11 at 4:08
1  
are you sure there's any C# in there - Richard Grimes got one hell of a telling off for analysing Vista to see just how much was .NET (answer: incredibly little, like 3 dlls). Originally Windows was just C. – gbjbaanb Jul 12 '12 at 22:20
@gbjbaanb very little of the Windows core itself, but a lot of the packaged applications are .NET now. – MattDavey Nov 5 '12 at 11:15
@MattDavey - Packaged apps aren't part of Windows. I am positive none of the Windows core is written in C# cause it needs .NET which you do not need to run Windows. It's long been known Microsoft prefers to use C for everything internal to Windows and, recently, there was an article where MS also preferred NOT to use C++. – Rob Nov 5 '12 at 12:52

You know, Java lacks a lot of functionality required to properly develop an Operating System. Java applications run in a virtual machine. This means that their code is deprived of any access to the underlying hardware. You do not have access to CPU, memory, file system, CD-ROM, network adapter, etc. It is good for writing portable secure applications but a deal-breaker when you want to write a device driver, operating system and other pieces of software that has to directly interface with hardware.

On the contrary, C was developed primarily for systems programming. That is why it has pointers, very small library of built-in functions and all the facilities needed to make every possible piece of optimizations to ensure minimal memory footprint and maximum performance. It was specifically created for developing Unix. It is no wonder that not only Unix, but all major operating systems (DOS, Windows, Linux, Mac OSX, Symbian Android, etc.), hardware drivers, etc. are all written in C.

So, if you are interested in programming microchips, operating systems, device drivers or any other programming requiring access to the underlying hardware, you should learn C.

share|improve this answer

basically whenever we are going to develop any operating system or previously developed operating systems ,it require proper plateform or hardware to run that type of code so we can not use high level languages frequently to develop the system softwares it requires machine level languages or assembly language to develop the background management or we can use c or c++.

share|improve this answer

Can Java be used to develop an OS?

Can it be done? Yes. It has been done at least twice - Sun's JavaOS, and Ewout Prangsma's JNode.

But you can't implement an operating system entirely in a high-level language. There is always some low-level stuff such as executing privileged instructions, special registers, context switching and interrupt dispatching, that has to be implemented in assembly language or something similar. And that also applies to operating systems implemented in C and C++.

Incidentally, one of the reasons that JNode has gone cold is that they tried to do too much in more-or-less conventional Java. On the one hand, this meant that existing C / C++ device drivers and the like could not be reused. On the other hand, the fact that it was all one big JVM made it next to impossible to handle things like killing application threads.

I believe that JavaOS handled these concerns with a micro-kernel implemented in C or C++. JavaOS was killed because it was not a commercial success.

share|improve this answer

java is not used to develop an operating system. it is used to develop internet object programming and electronic device programming due to its portability and platform neutrality. system software is completely associated with the computer hardware configuration. therefore to develop operating system one has to know about the hardware configuration and assembly instructions registers name etc. generally assembly programming and c language is used to develop operating systems.

share|improve this answer
3  
You can develop an operating system in almost any language. CosmOS is an OS written in C#, which also runs on a VM. There are comments about there being at least 2 Java operating systems as well. – Jetti Oct 17 '11 at 19:33

C and C++, mostly. Drivers cointain at least some assembly, and some new stuff is programmed in C#. I bet you could also find „classic” VB in there.

share|improve this answer
2  
"I bet you could also find „classic” VB in there." - I hope you're joking! – Jetti Oct 17 '11 at 19:34
2  
Vista delivers msvbvm60.dll, so it probably still uses it for something. – kinokijuf Oct 20 '11 at 14:01
3  
backwards compatibility. So that people could run VB6 programs on their computers. From Wikipedia: "Visual Basic 6.0 (Mid 1998) improved in a number of areas [8] including the ability to create web-based applications. VB6 has entered Microsoft's "non-supported phase" as of March 2008. Although the Visual Basic 6.0 development environment is no longer supported, the runtime is supported on Windows Vista, Windows Server 2008 and Windows 7.[9]" – Jetti Oct 20 '11 at 14:09

Java can be used to develop an operating system but that's going to take a lot of time and hardwork since Java operates on JVM.

C and C++ interact better with your system hardware, so they are better options, but the fact remains that Java can also be used since we have at least one OS written in Java.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.