Okay, I've found several ways to do this in Windows, but I'd like to know how to do it cross platform?
Basically, I'd like to know how I can make a CD/DVD drive open/close, but with code to where whether I compile it on a Windows, Mac, or Linux system, it would work. Can I do this? Surely there is a way to do this going straight to the hardware without having to use the OS as a mediator.
No way you can do this without some kind of OS API. It's not in standard, not at all. If you want to know how to use other APIs, I'm sure you can find it somewhere.
The APIs do it in OS-specific ways. That's why it's not in any standard code. The method varies from system to system. The point of standard libraries is that they function equally well on any system, like the JVM.