views:

482

answers:

4

Normally boot strap loaders are written using assembly languages. Is it possible to dot it using java with native interface.

+2  A: 

There are some possible solutions:

  1. It exists hardware, that is able to execute Java-bytecode.
  2. Also you can compile Java-code to native code with different compilers.
  3. Finally you can have a mini-loader, that starts the rest of the process in Java.

Neither of this solutions is easy or does make too much sense. But possible - yes.

For completeness: JNode is a project targeting to create a PC-Operating-system in Java.

Also answers to this question may be helpful. It ask for device-drivers in Java, and that's not completely the same question, but some of the solutions presented in the answers may be helpful with your question too.

Mnementh
+1 for mentioning JNode
cdb
A: 

Of course it is. A better question would be whether it is practical or not, and if it would offer any benefits worth the implementation time compared to existing methods.

Christoffer
+1  A: 

I don't want to say an outright no, because I'm sure if I did someone would come up with a way of doing it, but this would certainly be VERY difficult (and possibly fruitless).

For Java to run on a JVM, you'd need to natively bootstrap a sufficient amount of the OS natively that then switching to java would be a bit of a waste of time (it really wouldn't accomplish much other than adding complexity).

There are devices that can "natively" run bytecode where it's conceivably possibly, but I don't think that's viable most of the time.

GaryF
A: 

@Mnementh mentioned JNode. For the record, JNode uses GRUB as its bootstrap loader.

I agree with @Mnementh that implementing a boot loader in Java would be technically possible though probably difficult. But my question to the OP is "why would you want to do it?". I don't see the point.

Stephen C
not in practical sense.But some curiosity to know is it possible or not.(Might be due to lack of knowledge in JVM.excuse me...for that..)
cdb