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.

Recently i was re-visiting the basic concepts of operating systems. Since I am a java developer, I have inherently started looking at everything from java point of view. I am also reading 'Inside the JVM fundamentals' from

http://www.artima.com/insidejvm/ed2/jvm.html

so when I see the basics of operating systems and JVM, I have begun to think that there are lot of similarities on an abstract level, i.e. both do the memory management, process scheduling, etc.

So I want to ask SO programmers whether I am correct in my learning or assumptions?

share|improve this question
@Caleb Closely related, but I don't think that's a duplicate – Earlz Feb 11 at 16:35

marked as duplicate by Martijn Pieters, Caleb, Glenn Nelson, gnat, Robert Harvey Feb 11 at 16:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

Yes, they are similar. The JVM at a very core level is just a specialized CPU. It requires some bootstrapping and other things similar to a native OS. Where it differs though is that there is no hardware CPU that executes JVM bytecodes. So, this means that you will never be able to boot an actual computer with only Java code. You'll have to have some sort of middle-man to native(which is often much more complex than you'd think)

However, conceptually, they are quite similar. Most modern OSs handle memory management and scheduling. One would argue that the JVM does as well expressly by-design. This is because it was originally written to run on any OS. So naturally, you'd want to rely on the actual OS as little as possible

share|improve this answer
I like your answer, but I feel obligated to point out Jazelle. There were CPUs that execute JVM bytecode, although not completely. – K.Steff Feb 11 at 18:32
@K.Steff good point! I remembered hearing something about JVM accelerations but didn't think it mattered enough to mention – Earlz Feb 11 at 18:56

An Operating System is a Virtual Machine. A Virtual Machine is an Operating System. It's really more a matter of intent. The Squawk JVM, for example, is explicitly designed to run as an Operating System.

share|improve this answer

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