Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is There a Standard or Common JNI to the (POSIX) C Driver Interface?

873748Jul 6 2011 — edited Jul 13 2011
I have the source code in (POSIX) C for an RS422 Serial Driver.

I've been asked to create the JNI for using the 8 driver interfaces:
install()
open()
read()
write()
ioctl()
select()
close()
uninstall()

This seems like something that enough people would want to do that there'd be a Standard or Common Practice way to do this. However, my Google-foo has let me down on finding it.

Since I have the source code, I've considered re-compliling the driver code into a library and writing the JNI to call into that library. The potential problem I see with this is that normally the driver would get dynamically linked into the kernel, and the calls from Java would run the library functions in userspace.

I've also considered creating the JNI to call clib functions (read, write, ioctl, ...). Then the driver would get used normally, but the problem I see with this is that install() and uninstall() do not seem to have a standard (POSIX) C function that directly corresponds do them. Most Linux forums mention insmod and mknod to install the driver and make the device node, but LynxOS uses dr_install and dev_install.

So here's my question: Is there a Standard or Common Practice way to access a driver from Java?
This post has been answered by jschellSomeoneStoleMyAlias on Jul 12 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2011
Added on Jul 6 2011
5 comments
339 views