Yes, there is a way to communicate with OS/HW and it is done in C/C++. This is called JNI (Java Native Interface) and allows programmer to write native libraries and call their methods from a java application. The native libs themself can also call java api.
The best resource for getting started with jni is http://java.sun.com/docs/books/tutorial/native1.1/index.html