Most modern operating systems run in the protected mode. Now is it possible for the user programs to enter the \"ring 0\" by directly setting the corresponding bits in some
You can ask the operating system to map the memory of the hardware device into the memory space of your program. Once that's done, you can just read and write that memory from ring 3. Whether that's possible to do, or how to do that, depends on the operating system or the device.