Prochaine révision | Révision précédente |
documentation:informatique:linux:wine:index [2021/01/19 09:42] – créée f1sls | documentation:informatique:linux:wine:index [2021/01/19 09:49] (Version actuelle) – [Port Série ou USB→série] f1sls |
---|
ln -s /dev/lp0 lpt1 | ln -s /dev/lp0 lpt1 |
</code> | </code> |
| |
| [[https://wiki.winehq.org/Wine_User%27s_Guide#Serial_and_Parallel_Ports|Source]] |
| |
| Since Wine 2.8, serial and parallel ports are detected automatically when Wine starts. Windows serial ports follow a naming convention of the word ''COM'' followed by a number, such as ''COM1'', ''COM2'', etc. Similarly, parallel ports use ''LPT'' followed by a number, such as ''LPT1''. Linux, Mac, and BSD each have their own device naming conventions, but in every case the serial or parallel device is located somewhere in ''/dev''. You can see the mapping of Windows devices to Unix devices by looking in ''~/.wine/dosdevices''. For example: |
| |
| <code bash> |
| $ ls -l ~/.wine/dosdevices/ |
| total 0 |
| lrwxrwxrwx 1 alex alex 10 May 13 21:21 c: -> ../drive_c |
| lrwxrwxrwx 1 alex alex 10 May 14 14:43 com1 -> /dev/ttyS0 |
| lrwxrwxrwx 1 alex alex 10 May 14 14:43 com2 -> /dev/ttyS1 |
| lrwxrwxrwx 1 alex alex 10 May 14 14:43 com3 -> /dev/ttyS2 |
| lrwxrwxrwx 1 alex alex 10 May 14 14:43 com4 -> /dev/ttyS3 |
| lrwxrwxrwx 1 alex alex 12 May 14 14:43 com5 -> /dev/ttyUSB0 |
| lrwxrwxrwx 1 alex alex 8 May 13 21:22 d:: -> /dev/sr0 |
| lrwxrwxrwx 1 alex alex 8 May 14 14:43 lpt1 -> /dev/lp0 |
| lrwxrwxrwx 1 alex alex 1 May 13 21:21 z: -> / |
| </code> |
| |
| Make sure you have the needed rights to access your computer's serial and parallel ports. On Linux, a user must typically be a member of the ''sys'' or ''dialout'' group to access serial ports, or the ''lp'' group to access parallel ports. |
| |
| To override Wine's default device mapping, run ''wine regedit'' and create string entries in ''HKEY_LOCAL_MACHINE\Software\Wine\Ports'' where the entry name is the Windows device name and the entry value is the path to the Unix device. Continuing with the above example, to make COM1 the first USB-attached serial port, create an entry with the name ''COM1'' and the value ''/dev/ttyUSB0''. You might also want to create an entry named ''COM5'' with no value to remove the COM5 device which is now a duplicate of COM1. After editing the registry, shut down Wine with ''wineserver -k'' and the next time Wine runs a program, your changes will take effect. |
| |
| If you use a version of Wine prior to 2.8, you'll likely have to create symbolic links in ''~/.wine/dosdevices'' yourself. For example, to make COM1 the first USB-attached serial port, run ''ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1''. |
| |