Programming Questions: DOS/Windows External Devices

  • Thread starter FulhamFan3
  • Start date
  • Tags
    Programming
H In summary, in order to access external devices like a printer or modem, your application program communicates with a driver that communicates with the hardware by reading and writing to various addresses associated with different chips inside the computer. This allows for data to be transferred between the processor and the chips, which then communicate with the external devices.
  • #1
FulhamFan3
134
0
I'm taking my first programming class and I have some questions. How does your program access external devices like a printer or modem? I know in linux everything has a corresponding file but I have no idea how it works in dos/windows.
 
Computer science news on Phys.org
  • #2
In general, your application program communicates with a driver, which is a piece of software that knows how to talk directly to the hardware. The driver generally communicates with hardware by reading and writing to various addresses. These addresses are not associated with memory, but instead with some of the various chips inside the computer. Some of the chips do serial communication; others do parallel, others do USB, and so on. When you read and write to those addresses, you are moving data between the processor and those chips, which then communicate with the printer or modem.

- Warren
 
  • #3


In DOS/Windows, external devices such as printers or modems can be accessed through device drivers. Device drivers are software programs that act as an interface between the operating system and the external device. These drivers are responsible for translating the commands from the operating system into a language that the external device can understand and vice versa.

In order to access a printer or modem, your program would need to communicate with the device driver. This can be done through the use of specific commands or APIs (Application Programming Interfaces) that are provided by the driver. These commands allow your program to send and receive data to and from the external device.

Unlike in Linux, where everything is treated as a file, DOS/Windows uses a different approach. Each external device has its own device driver, and the operating system communicates with the device through this driver. This allows for more efficient and specific communication with the device.

I hope this helps answer your question and provides some insight into how external devices are accessed in DOS/Windows programming. Good luck with your programming class!
 

1. What is the purpose of programming external devices in DOS/Windows?

The purpose of programming external devices in DOS/Windows is to control and communicate with hardware devices connected to the computer, such as printers, scanners, and external storage devices. This allows for the exchange of data and information between the computer and the external device, expanding its functionality and capabilities.

2. What programming languages can be used for programming external devices in DOS/Windows?

There are several programming languages that can be used for programming external devices in DOS/Windows, including C, C++, Assembly, and Visual Basic. It is important to choose a language that is compatible with the device and the operating system.

3. What is a device driver and why is it important for programming external devices in DOS/Windows?

A device driver is a software component that acts as a bridge between the operating system and the external device. It allows the operating system to communicate with the device and control its functions. Device drivers are important for programming external devices in DOS/Windows because they provide the necessary interface for the device to function properly.

4. Are there any limitations to programming external devices in DOS/Windows?

While DOS/Windows offers a wide range of options for programming external devices, there are some limitations to consider. One limitation is the compatibility of the device with the operating system and programming language. Additionally, some devices may have specific drivers or software requirements that need to be met in order to properly program them.

5. How can I troubleshoot issues with programming external devices in DOS/Windows?

If you are experiencing issues with programming external devices in DOS/Windows, there are a few steps you can take to troubleshoot the problem. First, check that the device is properly connected to the computer and that all necessary drivers and software are installed. You can also try restarting the device and the computer. If the issue persists, consult the device's user manual or contact the manufacturer for further assistance.

Similar threads

  • Computing and Technology
Replies
5
Views
1K
  • Computing and Technology
Replies
7
Views
515
  • Computing and Technology
Replies
31
Views
2K
  • Computing and Technology
Replies
3
Views
2K
Replies
14
Views
2K
Replies
19
Views
2K
  • Programming and Computer Science
Replies
1
Views
493
  • Computing and Technology
Replies
2
Views
729
  • Computing and Technology
Replies
12
Views
2K
  • Computing and Technology
2
Replies
44
Views
3K
Back
Top