Kernel or device driver programming in java [duplicate]
Possible Duplicate:
Is it possible to code开发者_JAVA百科 a device driver in Java?
Kernel or device driver programming is possible in Java?
There are a few Java OSs such as JNode, JX and JavaOS, so it is possible, but always requires a core microkernel (and, of course a JVM) written in a low-level language that offers the Java code the necessary API to access the hardware directly.
Well technically, java is merely a language definition, which can be compiled into any other (turing complete) language :)
Set aside the issues on kernel-communication, you could for instance use GCJ: The GNU Compiler for the JavaTM Programming Language
GCJ is a portable, optimizing, ahead-of-time compiler for the Java Programming Language. It can compile Java source code to Java bytecode (class files) or directly to native machine code, and Java bytecode to native machine code.
Whether or not Java is a suitable language for device driver programming is another question :-)
Unless you have a kernel running on top of a JVM - no. You can use the Java language however and use a compiler like GCJ to native code, but it's mostly pointless, since you won't have access to most libraries you need anyways.
精彩评论