As an application write you never want to access the hardware directly, the OS provides syscalls, ioctls, etc so that you don't have to. Most of the time you can't, the OS will kill the program or throw some other exception if you try.
As BCYL said the only time you should worry about the hardware is when you're writing the driver for it, otherwise you'll just limit yourself to a small set of hardware or have your code entagled with tons of workarounds and fixes that normally are handled by the device driver without you knowing.