Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

@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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top