Treffer: Using the Java Native Interface to Introduce Device Driver Basics
Weitere Informationen
Teaching students to merge the real-world necessity of a graphical user interface (GUI) with the old-world techniques of manipulating the computer hardware can be easily accomplished using the Java Native Interface. The GUI capabilities can be acquired using the strongly typed and completely object oriented programming language of Java. Java allows users to quickly build user interfaces in a graphical form and has a very powerful tool in the Java Native Interface (JNI) to allow access to lower-level (native) programs. This interface is needed because Java runs on top of a virtual machine (VM). This allows the language to be platform independent but then inhibits a user’s ability to access various hardware inputs and outputs (I/O). To use a simple I/O port such as the serial port on a PC, a Java program must leave the VM and execute corresponding “native ” code to manipulate the USART. The students can then write the native code in C and they gain multiple skills that can be taken to the workplace. This paper presents some of the methodology and ideology behind using Java, the JNI and the C programming language to expose students to the rigors of basic device driver development. This will be done with reference to the Linux operating system as it allows students to easily grasp at the system level what is taking place in the hardware.