Thanks to everyone who would be reading this post.
I would like to know how to write programs in C to control Hardware for modems, printers and how to get the basic concepts for writing device drivers.
Read the Wiki article, then dive into the PDF that's listed on the above page, and see a lot more details.
Modems are about the same way. They have a language that many use, but not every modem, uses the same exact one.
In the DOS days you had full freedom as a user, to control all your peripherals, but those days are long gone. Controlling who has the authorization to mess with the peripherals is very important, these days.
So don't skip over the part about getting authorization or all the right control codes you send, will be for naught.
100% correct. Most of the time, you connect to the device and then send it text strings or codes to control the device. This is considered "high level" control. For low-level control, you can use direct hardware I/O instructions, which depend upon the device connectivity, such as RS-232 serial port, parallel port, USB, etc. These days, only device drivers need the low-level stuff, though "back in the day" we had to do the low-level bit twiddling ourselves... :-)
One common printer protocol that Adak did not mention is PostScript (created by Adobe and first adopted for printers by Apple), which in reality is its own high-level programming language. The original Sun workstations even used it as a display-rendering language (before X-Windows)!
#define A 3// name a constant
long int booking_ID ; ...