Compiling
Submitted by tyken on Wed, 05/05/2004 - 16:18.
Hi!
Just wondering if an os could be written i java, compilled to native code (everything) and run without a VM?
- Login to post comments
Just wondering if I could wri
Just wondering if I could write a OS i java without implementing a VM
take a look at the sources
hi,
take a look at the sources, there you will find a VM.
This VM is mostly written in Java, only some support things
(e.g. MemoryManagement) are written in assembler.
Andreas
P.S.: Can you imagine to write a VM in Java, then compile it to native code (e.g. with gcj) ? Then you have a similar effect.
Hmm
Don't think you got what I ment.
Could one write an OS in java without a VM implemented anywhere.
So you would have an OS written in java that can't run java bytecode.
The reason Im asking is because this fall im going to take an OS course where we have to implement our own OS. And I want to do it in java without having to implement a VM since this would take a lot of time.
for this task I suggest not to use Java
Hi,
if you have to write an OS during your studies, I suggest C (or assembler). This is because there are many examples covering how to boot a Kernel written in C with GRUB (or other bootloader). Andrew S. Tannenbaum has written the book : "Modern Operating Systems" , this is one of the books you will need. In addition to this book he implemented minix.
If you use Java you will find more Information about OS in Java at this page and at JX
An other question is what kind of code your OS is able to run.
If no Java Code is need to be run, then you will not need to implement a VM.
But instead you have to manage to write a Kernel in Java, compile it to native code and try to boot to that Kernel.
Andreas
gcj
Why not? Take a look at this paper. It describes an os written for the lego mindstorms brick (which uses a Hitachi H8 microcontroller) in java and compiled to native code with gcj. They claim their OS to provide runtime support for programs written in C, C++ and JAVA, but as I remember they mean JAVA code compiled to native code with gcj, so they did not implement a vm. But they hacked a lot on gcj so if you want to do something similar maybe you can save yourself some efforts if you start out from that.
BTW come and help JNode!
Andras
that was the same idea I posted...
Hi,
BTW come and help JNode!
is a good suggestion .
I suggested to use gcj in a post one or two days ago.
Andreas
java to native
Hi,
there are Java2Native compiler, e.g. GCJ.
There are at least two other Java operatingsystems :
So what is your question in detail?
Andreas