### Produce a Device Driver (OS/2)

You can produce both physical device drivers and virtual device drivers in OS/2:

- A physical device driver (.SYS) allows the operating system to interact with a system peripheral, such as a monitor or printer.
- A virtual device driver (.VDD) allows the operating system to handle input and output with multiple DOS or WIN-OS/2 sessions. Each session can then act as if it has complete control of the input or output device, while actually sharing the control with other sessions.

To produce a device driver (.SYS or .VDD) file as output, specify the /PDD or /VDD options, or specify the PHYSICAL DEVICE or VIRTUAL DEVICE statement in your module definition (.def) file.

If you are creating a physical device driver, use the SEGMENTS statement in your module definition file or the /SECTION linker option to specify which segments have I/O privilege.

If you are creating a virtual device driver, compile with the /Gr+ and Rn+ compiler options, and use the subsystem libraries.

If you do not specify an extension for the output file name, the linker automatically adds the appropriate extension (either .sys or.vdd) to the name you provide. If you do not specify an output filename at all, the linker generates an executable file with the same filename as the first object file it linked.

Module Definition Files

Develop Virtual Device Drivers on OS/2

Linker Output
Summary of Module Definition Statements