Using serial ports for more than debug

Ask your support questions in here

Moderator: Moderator Team

pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Using serial ports for more than debug

Post by pbreneman »

Does anyone here have experience using serial ports in ReactOS for more than debugging? On recent builds here is what I've noticed:

I've installed the new release of puTTY in Ros:
http://www.chiark.greenend.org.uk/~sgtatham/putty/

In a console window in Ros I do this (the last "N" means no handshaking):
putty -serial COM2 -sercfg 9600,8,n,1,N

Bug 1 - Both Dbg and Rel bootcd installs show COM1 and COM2 are available, but COM1 always fails to open. It should at least open on the Rel install, right?

Bug 2 -When I get COM2 opened using puTTY in Ros, I have to connect my cable to COM1 rather than COM2 on my Ros PC.

Bug 3 - Then on my other (real) windows PC I have to use a baud rate of 19200 rather than 9600.

Bug 4 - On the dbg install the reply from the PC to Ros doesn't appear in the puTTY terminal window. On the rel install the reply from the PC appears OK in the terminal.

I'm going to search more on this forum and the bug list but these are my initial test results. I'm not sure yet about the source of the noted bugs: Ros, putty, terminal program on (real) windows PC.
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

Bug 1 - Both Dbg and Rel bootcd installs show COM1 and COM2 are available, but COM1 always fails to open. It should at least open on the Rel install, right?
Both COM ports work for me when I choose ReactOS instead of ReactOS (RosDbg). With dbg build.
Bug 2 -When I get COM2 opened using puTTY in Ros, I have to connect my cable to COM1 rather than COM2 on my Ros PC.
Confirmed.
Bug 3 - Then on my other (real) windows PC I have to use a baud rate of 19200 rather than 9600.
The following functions: IOCTL_SERIAL_GET_CHARS, IOCTL_SERIAL_SET_CHARS, IOCTL_SERIAL_GET_HANDFLOW, and IOCTL_SERIAL_SET_HANDFLOW are not implemented; puTTY refuses to set a baud rate without them. Try this driver. No real functions, just stubs…
Bug 4 - On the dbg install the reply from the PC to Ros doesn't appear in the puTTY terminal window. On the rel install the reply from the PC appears OK in the terminal.
I can't reproduce this bug.
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

Sorry for my delay but thank you for the serial.sys to test. I'm now able to use serial communications in the rel build (but not in the dbg build). Will the new serial.sys be part of a new trunk build?

I'll try to do more testing ASAP and get back here with more details.
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

Will the new serial.sys be part of a new trunk build?
Done.
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

Thanks, but can you make a rel build cd? All I see are dbg.
vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: Using serial ports for more than debug

Post by vicmarcal »

pbreneman wrote:Thanks, but can you make a rel build cd? All I see are dbg.
Hmm?A dbg cd is the same as a rel cd...You can run a rel cd in ReactOS[Normal] Mode so it won't spam with debug messages.
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

The serial port works differently (for me at least) even when I use the default boot selection. On the dbg version I can send characters from ReactOS to another PC but I can't receive any characters sent by the other PC. On the rel version things work correctly.
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

The rel builder is down…
On the dbg version I can send characters from ReactOS to another PC but I can't receive any characters sent by the other PC.
Can you collect debug messages to a file while trying to send/receive characters through com1, com2 ports? Use either a recent dbg build (r54468 or later) or this kernel; older revisions have a bug. Also, put the string filter +serial into C:\reactos\system32\drivers\etc\KDBinit
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

I've tried r54473 and things seem to work the same as before. I am unable to open COM1. When I open COM2 I am able to send characters (using COM1 connector) but incoming characters are not displayed.

In both cases, these are the only serial lines in the disk log file:
(ntoskrnl/mm/ARM3/sysldr.c:174) Loading: \SystemRoot\system32\drivers\serial.sys at FA0E2000 with 13 pages
and
(drivers/serial/serial/devctrl.c:697) IOCTL_SERIAL_SET_HANDFLOW not implemented.
(drivers/serial/serial/devctrl.c:655) IOCTL_SERIAL_SET_CHARS not implemented.

Any idea when the rel builder will be up again? It should allow me to have at least COM2 (using COM1 connector) working as before.
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

Here is a new bug report on these problems:
http://www.reactos.org/bugzilla/show_bug.cgi?id=6687
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

Just tried r54672 and problems remain. Is there any estimate of when rel boot cds will again be available?
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

Must be some simple way to search the source code and fix things so that the serial port is completely left alone when ReactOS is started normally? If we can do that then the dbg build cd should work just as well as the last rel build cd.
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

Is there any estimate of when rel boot cds will again be available?
No idea, but I just compiled a fresh rel boot cd.
If we can do that then the dbg build cd should work just as well as the last rel build cd.
Dbg builds work for me as well as the rel ones.
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

I just compiled a fresh rel boot cd.
Thanks! I'll give it a test and let you know how it works. If one port fully works I have several places I can put ReactOS into operation for real stuff.
Dbg builds work for me as well as the rel ones.
Could you please describe your system a little? Is it a real PC or a virtual machine? How many serial ports do you have? Could you tell me what addresses and IRQs are used by the ports?

I have 2 serial ports configured on real hardware:
COM1 3F8 IRQ4
COM2 2F8 IRQ3
pbreneman
Posts: 78
Joined: Wed Feb 25, 2009 5:12 am

Re: Using serial ports for more than debug

Post by pbreneman »

On the rel build I'm able to use COM2 (but connected to the physical COM1 port) to send and receive data as long as I have the hardware lines connected to my other PC (using a null-modem cable).

If I momentarily disconnect the serial cable (and thus the hardware lines) and then restore the cable things stop working until I reboot ReactOS (at least that is fast). After I disturb the hardware lines I can no longer receive anything from my other PC. The data sent to my other PC is no longer correct (it is buffered and what goes out is earlier data not sent when requested). Closing and reopening the port doesn't help. Stopping and restarting my test program doesn't help. Only a reboot gets things working again.

So as long as I keep hardware lines connected I seem to have one serial port working well on the release version.

If I try opening COM1 (with hardware lines connected on COM1) whatever I send out the port is echoed back, but nothing goes to the other PC. So if anyone tries this don't let the echo lead you to believe it is working. It never receives anything from the other PC. Without connected hardware lines what is sent out is not echoed back.

On a recent dbg build (r54672) opening COM1 fails the same as on the rel build. Opening COM2 (connected to physical COM1 port) fails the same as the rel build fails *after* the hardware lines are disturbed. So on the dbg build I'm unable to use any serial port, and that is all with starting ReactOS normally which should leave the serial port alone.

On the first part of the rel build install it randomly stops while copying files from the CD to the HD. I had to keep trying until it just happened to work. This is another problem I hope to report elsewhere. The dbg build works good (without this problem).
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests