• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

accessing hardware directly - how/why to do it?

Special K

Diamond Member
I read about it in the sams C book, but they said it was beyond the scope of the book, and didn't give any details. Why would you want to do it? How do you do it? Is that what the volatile keyword is for (or related to)? Doesn't winnt not allow it anyway?
 
One of the reason you wanna do it is if you are writing device drivers... Most of the OS's are written in C & assembly, therefore most device drivers are written in C as well... that's why your C book mentioned accessing the hardware directly...

But if you are simply writing an application running on top of an OS, you dont need (and not recommended) to access the hardware... instead you should access it through the device driver...
 
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.
 
Back
Top