JavaDive is a set of methods which allows Java
applets to get access to the hardware I/O ports and COM/LPT ports directly, without
drivers. These methods will be helpful for application developers for working with
industrial hardware, modems, and other devices.
These methods were developed for industrial machine
which "breeds" plastic elements from fluid polymer. Such machines are utilized for
medicine, criminology and other scientific and manufacturing branches.
In order to do its simpler, all devices - microprocessors,
I/O cards and others, - were connected to the usual IBM PC computer through the motherboard
slots. A good application was demanded to control the machine, the application which could
work without any glitches during several days and weeks.
When I began this job, I already had the experience
of applet development and my own sources for various tasks - from network computing
to business applications. Java is a stable system, applets looks better than usual
applications, they works slowly - but I did not demand a quick execution. So,
Java was chosen for shell and I developed the applet for our machine.
Generally for access to I/O ports we must use a driver,
which works in the "second ring" of 386 processor and can do more than other applications
in the outer, "third" ring.
Can the user application work likewise a driver? This
is possible for OS/2 Warp. I found a small DLL which allowed me to "dive" to the second
ring and leave it. This DLL was written by russian hacker, Rinat Sadretdinov on pure
Assembler and distributed as Public Domain.
I was very glad to use this library and connected it to
my applet.
I developed the Java class named "Dive" which provides
the well-known "inp" and "outp" methods. When these methods reads or writes bytes, the
applet "dives" to the second ring, and leave it after this action. This applet cannot
work in the Netscape and I launch it as application.
To debug the class I tried to kick a PC Speaker via port
number 0x61. Soon it became to merry grunt and squeal. Also I teached my computer to blink
me a lamp on the modem. This looks good, and you can see this curcus too - simply launch
the JavaDive.cmd
The Java 1.1.* and OS/2 Warp are required.
Any questions about assembler and IOPL32 - to Rinat, | |
Any questions about Java and this article - to me. | |
![]() |
|
Yours Sergey Posokhov | |
- March 1999 - |