Serial port communication

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
eru
Level 1
Level 1
Posts: 6
Joined: Thu Jun 26, 2008 2:51 pm

Serial port communication

Post by eru »

Hi folks

I've been trying to programm some devices which need a serial port win-app http://a-m-c.com/download/software/amcds3-7-6.zip but can't get it to work :S

wine can run it without problem until the serial port is activated. I read about making the link to the port and I created on "dosdevices" folder.

I'm not sure what's the next step, does anyone have an idea?

thanks in advance :)
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Serial port communication

Post by vitamin »

eru wrote:Hi folks

I've been trying to programm some devices which need a serial port win-app http://a-m-c.com/download/software/amcds3-7-6.zip but can't get it to work :S

wine can run it without problem until the serial port is activated. I read about making the link to the port and I created on "dosdevices" folder.

I'm not sure what's the next step, does anyone have an idea?

thanks in advance :)
Assuming you have real com devices (not usb):

Code: Select all

ln -s /dev/ttyS0 ~/.wine/dosdevices/com1
ln -s /dev/ttyS1 ~/.wine/dosdevices/com2
ln -s /dev/ttyS2 ~/.wine/dosdevices/com3
ln -s /dev/ttyS3 ~/.wine/dosdevices/com4
Then make sure that all of those /dev/ttyS? "files" are accessible by your user.
eru
Level 1
Level 1
Posts: 6
Joined: Thu Jun 26, 2008 2:51 pm

Post by eru »

yes, I run that command and the user is part of the "dialout" group, it can read the port, already tested with a touchscreen using:

Code: Select all

cat </dev/ttYS0
that gave me some data when the touchscreen is activated
Uwe Bonnes

Serial port communication

Post by Uwe Bonnes »

eru> yes, I run that command and the user is part of the "dialout"
eru> group, it can read the port, already tested with a touchscreen
eru> using: Code: cat </dev/ttYS0



eru> that gave me some data when the touchscreen is activated

Simple reads and writes to the serial port should succeed, and most of the
contol possibilities that the Win32 API offers should work too. So either
your program uses soemthinhg unusual and not yet implemented, or you setup
doesn't work.

Again WINEDEBUG=+relay and a search where ther error is displayed and what
goes wrong before might get you starting.

Bye

--
Uwe Bonnes [email protected]

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
eru
Level 1
Level 1
Posts: 6
Joined: Thu Jun 26, 2008 2:51 pm

Post by eru »

well, I se this:

few lines before

Code: Select all

0024:Call msvcrt._except_handler3(0033db04,0033fef8,0033d838,0033d77c) ret=7bc621bd
0024:Call msvcrt._XcptFilter(c0000005,0033d620) ret=004e2dc3
0024:Ret  msvcrt._XcptFilter() retval=00000000 ret=004e2dc3
0024:Ret  msvcrt._except_handler3() retval=00000001 ret=7bc621bd
0024:Call KERNEL32.IsBadCodePtr(7ee3c968) ret=0035c621
0024:Ret  KERNEL32.IsBadCodePtr() retval=00000000 ret=0035c621
here is the crash:

Code: Select all

wine: Unhandled page fault on read access to 0x00740000 at address 0xb7d6934c (thread 0024), starting debugger...
Unhandled exception: page fault on read access to 0x00740000 in 32-bit code (0xb7d6934c).
now it tells what's going on in that moment

Code: Select all

Register dump:
 CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b
 EIP:b7d6934c ESP:0033db5c EBP:0033db78 EFLAGS:00210206(   - 00      - RIP1)
 EAX:00110078 EBX:7e9eaa20 ECX:0003fdcd EDX:00a0002c
 ESI:00740000 EDI:00a10970

Stack dump:
0x0033db5c:  7e973079 00a0002c 0072f6bc 00110078
0x0033db6c:  7bc8697c 0033dc24 0033db88 0033db94
0x0033db7c:  7bc53348 0072f6bc 00110078 b7e624ae
0x0033db8c:  0033dc24 ffffffff 0033dc04 7bc53d0c
0x0033db9c:  7e97300b 00000002 0033dc1c 7e9ec320
0x0033dbac:  7e9ec37b 0011d040 0033dc1c 00000094

Backtrace:
=>1 0xb7d6934c memcpy+0x1c() in libc.so.6 (0x0033db78)
  2 0x7bc53348 call_entry_point+0x20() in ntdll (0x0033db94)
  3 0x7bc53d0c SNOOP_Return+0x9a4() in ntdll (0x0033dc04)
  4 0x7e96d431 in oleaut32 (+0xd431) (0x7b8294bc)
  5 0xfde80201 (0x02976854)
  6 0x00000000 (0x00000000)
0xb7d6934c memcpy+0x1c in libc.so.6: repe movsl (%esi),%es:(%edi)
a lot of modules loaded

Code: Select all

Modules:
Module  Address                 Debug info      Name (76 modules)
PE        340000-  373000       Deferred        amc_~jh3
PE        400000-  5e6000       Deferred        amc_drivesuite
PE        810000-  8e4000       Deferred        mpivc60
PE      10000000-10082000       Deferred        amc_~dnq
PE      5f400000-5f4f2000       Deferred        mfc42
PE      780c0000-78121000       Deferred        msvcp60
ELF     7b800000-7b929000       Deferred        kernel32<elf>
  \-PE  7b820000-7b929000       \               kernel32
ELF     7bc00000-7bca2000       Export          ntdll<elf>
  \-PE  7bc10000-7bca2000       \               ntdll
ELF     7bf00000-7bf03000       Deferred        <wine-loader>
ELF     7e2bf000-7e316000       Deferred        shlwapi<elf>
  \-PE  7e2d0000-7e316000       \               shlwapi
ELF     7e316000-7e427000       Deferred        shell32<elf>
  \-PE  7e330000-7e427000       \               shell32
ELF     7e427000-7e43b000       Deferred        lz32<elf>
  \-PE  7e430000-7e43b000       \               lz32
ELF     7e43b000-7e454000       Deferred        version<elf>
  \-PE  7e440000-7e454000       \               version
ELF     7e454000-7e47f000       Deferred        ws2_32<elf>
  \-PE  7e460000-7e47f000       \               ws2_32
ELF     7e47f000-7e498000       Deferred        wsock32<elf>
  \-PE  7e480000-7e498000       \               wsock32
ELF     7e5a9000-7e5ca000       Deferred        atl<elf>
  \-PE  7e5b0000-7e5ca000       \               atl
ELF     7e5ca000-7e5fd000       Deferred        uxtheme<elf>
  \-PE  7e5d0000-7e5fd000       \               uxtheme
ELF     7e625000-7e62e000       Deferred        libxcursor.so.1
ELF     7e62e000-7e633000       Deferred        libxfixes.so.3
ELF     7e633000-7e636000       Deferred        libxcomposite.so.1
ELF     7e636000-7e63c000       Deferred        libxrandr.so.2
ELF     7e63c000-7e644000       Deferred        libxrender.so.1
ELF     7e644000-7e664000       Deferred        imm32<elf>
  \-PE  7e650000-7e664000       \               imm32
ELF     7e664000-7e669000       Deferred        libxdmcp.so.6
ELF     7e669000-7e75a000       Deferred        libx11.so.6
ELF     7e75a000-7e768000       Deferred        libxext.so.6
ELF     7e768000-7e76d000       Deferred        libxxf86vm.so.1
ELF     7e76d000-7e785000       Deferred        libice.so.6
ELF     7e785000-7e78e000       Deferred        libsm.so.6
ELF     7e799000-7e82d000       Deferred        winex11<elf>
  \-PE  7e7b0000-7e82d000       \               winex11
ELF     7e87b000-7e89b000       Deferred        libexpat.so.1
ELF     7e89b000-7e8c6000       Deferred        libfontconfig.so.1
ELF     7e8d1000-7e8e5000       Deferred        libz.so.1
ELF     7e8e5000-7e950000       Deferred        libfreetype.so.6
ELF     7e950000-7e9f1000       Export          oleaut32<elf>
  \-PE  7e960000-7e9f1000       \               oleaut32
ELF     7e9f1000-7ea04000       Deferred        libresolv.so.2
ELF     7ea04000-7ea07000       Deferred        libxau.so.6
ELF     7ea0f000-7ea2d000       Deferred        iphlpapi<elf>
  \-PE  7ea20000-7ea2d000       \               iphlpapi
ELF     7ea2d000-7ea8c000       Deferred        rpcrt4<elf>
  \-PE  7ea40000-7ea8c000       \               rpcrt4
ELF     7ea8c000-7eb2d000       Deferred        ole32<elf>
  \-PE  7eaa0000-7eb2d000       \               ole32
ELF     7eb2d000-7ebed000       Deferred        comctl32<elf>
  \-PE  7eb40000-7ebed000       \               comctl32
ELF     7ebed000-7ed2e000       Deferred        user32<elf>
  \-PE  7ec00000-7ed2e000       \               user32
ELF     7ed2e000-7ed7d000       Deferred        advapi32<elf>
  \-PE  7ed40000-7ed7d000       \               advapi32
ELF     7ed7d000-7ee16000       Deferred        gdi32<elf>
  \-PE  7ed90000-7ee16000       \               gdi32
ELF     7ee16000-7ee7b000       Deferred        msvcrt<elf>
  \-PE  7ee20000-7ee7b000       \               msvcrt
ELF     7efa2000-7efad000       Deferred        libnss_files.so.2
ELF     7efad000-7efb7000       Deferred        libnss_nis.so.2
ELF     7efb7000-7efce000       Deferred        libnsl.so.1
ELF     7efce000-7eff5000       Deferred        libm.so.6
ELF     7eff7000-7f000000       Deferred        libnss_compat.so.2
ELF     b7cf6000-b7cfa000       Deferred        libdl.so.2
ELF     b7cfa000-b7e3b000       Export          libc.so.6
ELF     b7e3c000-b7e53000       Deferred        libpthread.so.0
ELF     b7e5e000-b7f93000       Deferred        libwine.so.1
ELF     b7f95000-b7fb0000       Deferred        ld-linux.so.2
and finish with this:

Code: Select all

Threads:
process  tid      prio (all id:s are in hex)
0000000c 
        00000012    0
        0000000e    0
        0000000d    0
0000000f 
        00000016    0
        00000015    0
        00000011    0
        00000010    0
00000023 (D) Z:\home\generadores\.wine\drive_c\Archivos de programa\AMC Software\DriveSuite\AMC_DriveSuite.exe
        00000027    1
        00000024    0 <==
00000025 
        00000026    0
Backtrace:
=>1 0xb7d6934c memcpy+0x1c() in libc.so.6 (0x0033db78)
  2 0x7bc53348 call_entry_point+0x20() in ntdll (0x0033db94)
  3 0x7bc53d0c SNOOP_Return+0x9a4() in ntdll (0x0033dc04)
  4 0x7e96d431 in oleaut32 (+0xd431) (0x7b8294bc)
  5 0xfde80201 (0x02976854)
  6 0x00000000 (0x00000000)

I found some questions on forums about a crash similar to this, but it was with winecfg, none posted solution :(
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

eru wrote:well, I se this:

Code: Select all

Backtrace:
=>1 0xb7d6934c memcpy+0x1c() in libc.so.6 (0x0033db78)
  2 0x7bc53348 call_entry_point+0x20() in ntdll (0x0033db94)
  3 0x7bc53d0c SNOOP_Return+0x9a4() in ntdll (0x0033dc04)
  4 0x7e96d431 in oleaut32 (+0xd431) (0x7b8294bc)
  5 0xfde80201 (0x02976854)
  6 0x00000000 (0x00000000)
0xb7d6934c memcpy+0x1c in libc.so.6: repe movsl (%esi),%es:(%edi)
Snoop channel is unreliable and can cause crashes like that. So don't spend time trying to chase something that's not your problem.
eru
Level 1
Level 1
Posts: 6
Joined: Thu Jun 26, 2008 2:51 pm

Post by eru »

understood.. :(

I already reported as bug, I hope some day can run this software :wink:
Locked