How is Hello World printed? - full life cycle

I took a compiler, an operating system, a course in computer architecture in graduate school. But I want to see these concepts in a simple but real example (not too theoretical). HelloWorld is a good choice for a simple example.

Not only the life cycle of this small program is interesting, but also the knowledge of how the JVM, OS and architecture can help us become a better programmer.

In short, my question is: am I describing the steps correctly and completely?

In particular, I need your help in the following:

  • Indicate any part in which I am mistaken.
  • I'm sure I will miss a lot of valuable points, so add any point that makes sense in the life cycle.

I want to know how HelloWorld goes through each layer and then comes back from it. Suppose this program runs on an Intel processor with Ubuntu .

I will keep this post updated by combining good answers until a final answer is accepted.

Below is the HelloWorld program that everyone knows.

enter image description here

It is compiled into bytecode as shown below.

enter image description here

The bytecode is not readable, but we can use javap -classpath . -c HelloWorldto see the mnemonics as follows.

enter image description here

It is then loaded, linked, and initialized in the JVM.

enter image description here

Since it has only one thread, suppose it is the left thread in the next data region of the JVM runtime.

enter image description here

JVM , . Ubuntu " " :

enter image description here

JVM x86? ()

?

?

, , , , 5- MIPS.

enter image description here

:

. API, .

+5
1

Java (JVM) - , - Java. Java.

http://en.wikipedia.org/wiki/Java_virtual_machine

wikipedia:

enter image description here

+3

All Articles