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?
0
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
2
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.