Null modem cable setup

Hi,
I can’t set up a debug session. Windbg says “Debugger not connected”
after opening …/COM1.

(My target is Windows 7. Host is also Windows 7 but only has a USB port. I
have a USB-RS232 Adapter. The whole config and setup with the cable and
adapter work. It has worked before somehow!)

Next, I tried hyperterminal. I turned off debug off in boot options and
restarted. Then used hyperterminal to test the serial connection. It echoes
characters one way but not the other.

Can anyone tell me why hyperterminal is half-duplex?
Thanks
Terry

Did you happen to enable /debug on your both your debugger and your debuggee? Verify your debugger does not have /debug set.

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Kaushik S
Sent: Wednesday, May 01, 2013 6:42 PM
To: Kernel Debugging Interest List
Subject: [windbg] Null modem cable setup

Hi,
I can’t set up a debug session. Windbg says “Debugger not connected” after opening …/COM1.

(My target is Windows 7. Host is also Windows 7 but only has a USB port. I have a USB-RS232 Adapter. The whole config and setup with the cable and adapter work. It has worked before somehow!)

Next, I tried hyperterminal. I turned off debug off in boot options and restarted. Then used hyperterminal to test the serial connection. It echoes characters one way but not the other.

Can anyone tell me why hyperterminal is half-duplex?
Thanks
Terry

— WINDBG is sponsored by OSR OSR is hiring!! Info at http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

What baud rate are you using?

Have you tried using a different cable? We exclusively use serial debugging in our labs with physical machines and I’ve seen many strange issues resolved by switching cables.

-scott
OSR

> Hi,

I can’t set up a debug session. Windbg says “Debugger not connected”
after opening …/COM1.

(My target is Windows 7. Host is also Windows 7 but only has a USB port. I
have a USB-RS232 Adapter. The whole config and setup with the cable and
adapter work. It has worked before somehow!)

Next, I tried hyperterminal. I turned off debug off in boot options and
restarted. Then used hyperterminal to test the serial connection. It
echoes
characters one way but not the other.
***
No, that is not a good description of the problem. Which way works?
Host-to-target or target-to-host? And HyperTerminal does not “echo”
characters. Whatever you type on Host should appear on Target (but NOT on
Host), and what you type on Target should appear on Host, (but not on
Target)
****

Can anyone tell me why hyperterminal is half-duplex?
****
It isn’t. Half-duplex means the input is echoed locally but not sent back
from the recipient. HyperTerminal assumes full-duplex communication, that
is, what you type is sent to the recipient, and does not appear on the
machine on which you are typing, and similarly, what you type on the other
machine is only seen by the first machine.

Half-duplex was popular in the 1960s, when the cost to echo a character
back was extremely high (remember, most mainframes of that era had less
computing power than the 8088, and supercomputers were slower than what
you can get for under $1,000 at Best Buy or other computer store of your
choice)

AFAIK, the only thing that is required is that the output of one side of
the cable goes to the input on the other side, and vice-versa. A full
null-modem cable also crosses several other signals, but I think WinDbg
needs only three wires: in, out, and signal ground.
joe
****

Thanks
Terry


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Folklore of not-too-many years ago was that if someone at Microsoft had
problems with getting WinDbg to talk across a serial line, the expert
would show up with a pair of wire cutters and snip all connections except
in, out, and ground.

To the OP: if you are typing on your host and seeing the characters on
your host, there is something deeply screwed up with your cable, and all
bets are off.

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.
joe

What baud rate are you using?

Have you tried using a different cable? We exclusively use serial
debugging in our labs with physical machines and I’ve seen many strange
issues resolved by switching cables.

-scott
OSR


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi,
Firstly, the null modem cable is fine. I have already used the same
cable and the same usb adapter successfully. However, even when it worked
it took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using
hyper terminal. Its a symmetrical situation and both machines have the
same settings. The only difference is the ‘host’ has no serial port and
hence uses a USB-RS232 adapter. The ‘target’ has a serial port. When I
use hyperterminal, I am able to transmit characters from target to host but
not from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -

  1. What is the protocol for this null modem cable communication?.

  2. Can I debug the communication between host and target?. Meaning, I want
    to trace every single message that is being sent to and fro. Something
    like using Wireshark on network card in promiscous mode, I want to look at
    every incoming and outgoing message.

  3. The reason I want to do 1) and 2) above is that, this null modem setup
    never actually works predictably. (I disagree with people who claim it is
    simple to setup. Its not easy to get it to work, even if you sorted your
    cable confusion :)). This time I am trying to get to the bottom of it and
    understand what is happening underneath. (Is there a certain sequence in
    which we must start the host and targets?. Is there something with
    USB-RS232 adapter that is causing issues in my case?. )
    Regards
    T

On Thu, May 2, 2013 at 10:25 AM, wrote:

> Folklore of not-too-many years ago was that if someone at Microsoft had
> problems with getting WinDbg to talk across a serial line, the expert
> would show up with a pair of wire cutters and snip all connections except
> in, out, and ground.
>
> To the OP: if you are typing on your host and seeing the characters on
> your host, there is something deeply screwed up with your cable, and all
> bets are off.
>
> In the worst case, go to your local computer store and buy a null modem
> cable if you have made your own. And, as Scott has suggested, if you have
> purchased the cable, try purchasing another brand. We used cables from
> Radio Shack which worked just fine.
> joe
>
>
> > What baud rate are you using?
> >
> > Have you tried using a different cable? We exclusively use serial
> > debugging in our labs with physical machines and I’ve seen many strange
> > issues resolved by switching cables.
> >
> > -scott
> > OSR
> >
> > —
> > WINDBG is sponsored by OSR
> >
> > OSR is hiring!! Info at http://www.osr.com/careers
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

> The only difference is the ‘host’ has no serial port and hence uses a USB-RS232 adapter.

There’s your problem right there. Good luck getting that to work with WinDbg. Your WinDdg host needs to use a real serial port
located at COM1. I understand that most modern computers no longer come with real serial ports. And yes, that’s a problem. But
these USB-to-serial adapters are notoriously bad (for this task), and by most accounts, simply do not work for the purpose of doing
Windows debugging with WinDbg.

Thanks,
Don

“Kaushik S” wrote in message news:xxxxx@windbg…
Hi,
Firstly, the null modem cable is fine. I have already used the same cable and the same usb adapter successfully. However, even
when it worked it took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using hyper terminal. Its a symmetrical situation and both machines
have the same settings. The only difference is the ‘host’ has no serial port and hence uses a USB-RS232 adapter. The ‘target’ has a
serial port. When I use hyperterminal, I am able to transmit characters from target to host but not from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -
1. What is the protocol for this null modem cable communication?.
2. Can I debug the communication between host and target?. Meaning, I want to trace every single message that is being sent to and
fro. Something like using Wireshark on network card in promiscous mode, I want to look at every incoming and outgoing message.

3. The reason I want to do 1) and 2) above is that, this null modem setup never actually works predictably. (I disagree with people
who claim it is simple to setup. Its not easy to get it to work, even if you sorted your cable confusion :)). This time I am
trying to get to the bottom of it and understand what is happening underneath. (Is there a certain sequence in which we must start
the host and targets?. Is there something with USB-RS232 adapter that is causing issues in my case?. )
Regards
T

On Thu, May 2, 2013 at 10:25 AM, wrote:

Folklore of not-too-many years ago was that if someone at Microsoft had
problems with getting WinDbg to talk across a serial line, the expert
would show up with a pair of wire cutters and snip all connections except
in, out, and ground.

To the OP: if you are typing on your host and seeing the characters on
your host, there is something deeply screwed up with your cable, and all
bets are off.

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.
joe

> What baud rate are you using?
>
> Have you tried using a different cable? We exclusively use serial
> debugging in our labs with physical machines and I’ve seen many strange
> issues resolved by switching cables.
>
> -scott
> OSR
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

“Kaushik S” wrote in message news:xxxxx@windbg…
>Firstly, the null modem cable is fine. I have already used the same cable
>and the same usb adapter successfully. However, >even when it worked it
>took a few attempts of restarting and trying repeatedly.

Sorry, but you’re not thinking about this problem logically. How can you
assert that the null modem cable and USB adapter are not at fault if you’ve
never had a reliable environment? Even if you did have a rock solid
environment up until this point, components go bad sometimes.

Serial debugging does work reliably, that’s why we use it on hundreds of
lab machines every year over the other possible options. It’s also quite
easy to set up:

On the target:

1. bcdedit /set debug on (defaults to COM1 at 115200)

On the host:

1. Open WinDbg
2. File->Kernel Debug->Choose COM settings on host

Reboot the target, done! If it doesn’t work, you’re either using the wrong
COM ports or you have a bad physical connection.

Though this is even getting ahead of yourself. If you can’t properly test
the connection with HyperTerminal you have NO chance of getting WinDbg to
work reliably. In addition to the cable, USB to serial adapters are
notoriously crappy (we have a pile of them in the office at the ready to
replace dead ones). If I were you, I would do the following until I had
success:

1. Try a different cable
2. Try a different USB to serial adapter
3. Try a different target machine
4. If none of those worked, for my sanity I would ignore the physical serial
port on the target and plug a USB to serial adapter in. Then I’d try to get
those to talk over HyperTerminal. It wouldn’t be useful for kernel
debugging, but it would prove that you had the HyperTerminal settings
correct on the target.

>As I mentioned in my OP I have used the same cable before and it worked.

Just because something used to work doesn’t mean that it still works (my
garage door opener at home is proof of that). Also, you neglected to mention
that this setup never worked reliably.

-scott
OSR

USB to serial on the *host* (i.e. the machine running WinDbg) is fine.
You’re correct though that the serial port on the target must be a “real”
one.

-scott
OSR

“Don Matthews” wrote in message news:xxxxx@windbg…

The only difference is the ‘host’ has no serial port and hence uses a
USB-RS232 adapter.

There’s your problem right there. Good luck getting that to work with
WinDbg. Your WinDdg host needs to use a real serial port
located at COM1. I understand that most modern computers no longer come
with real serial ports. And yes, that’s a problem. But
these USB-to-serial adapters are notoriously bad (for this task), and by
most accounts, simply do not work for the purpose of doing
Windows debugging with WinDbg.

Thanks,
Don

“Kaushik S” wrote in message news:xxxxx@windbg…
Hi,
Firstly, the null modem cable is fine. I have already used the same
cable and the same usb adapter successfully. However, even
when it worked it took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using hyper
terminal. Its a symmetrical situation and both machines
have the same settings. The only difference is the ‘host’ has no serial
port and hence uses a USB-RS232 adapter. The ‘target’ has a
serial port. When I use hyperterminal, I am able to transmit characters
from target to host but not from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -
1. What is the protocol for this null modem cable communication?.
2. Can I debug the communication between host and target?. Meaning, I want
to trace every single message that is being sent to and
fro. Something like using Wireshark on network card in promiscous mode, I
want to look at every incoming and outgoing message.

3. The reason I want to do 1) and 2) above is that, this null modem setup
never actually works predictably. (I disagree with people
who claim it is simple to setup. Its not easy to get it to work, even if you
sorted your cable confusion :)). This time I am
trying to get to the bottom of it and understand what is happening
underneath. (Is there a certain sequence in which we must start
the host and targets?. Is there something with USB-RS232 adapter that is
causing issues in my case?. )
Regards
T

On Thu, May 2, 2013 at 10:25 AM, wrote:

Folklore of not-too-many years ago was that if someone at Microsoft had
problems with getting WinDbg to talk across a serial line, the expert
would show up with a pair of wire cutters and snip all connections except
in, out, and ground.

To the OP: if you are typing on your host and seeing the characters on
your host, there is something deeply screwed up with your cable, and all
bets are off.

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.
joe

> What baud rate are you using?
>
> Have you tried using a different cable? We exclusively use serial
> debugging in our labs with physical machines and I’ve seen many strange
> issues resolved by switching cables.
>
> -scott
> OSR
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Using a USB-RS232 adapter with windbg is not supported.

That is why it is not working.

Find yourself a computer with a 16550 serial UART embedded in the southbridge chipset, and use that as your host debugger.

Or even better move into the 21st century and use a modern debug transport. (Think network debugging or 1394.)

The serial debug transport does not work with infinite memory channels, and that is what the driver for the USB-232 adapter does by default. (Never drops anything on the floor.)

The serial debug transport expects a channel with at most 16 bytes of memory. (The size of the FIFO in a 16550.)

Joe.

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Kaushik S
Sent: Thursday, May 2, 2013 1:21 AM
To: Kernel Debugging Interest List
Subject: Re: [windbg] Null modem cable setup

Hi,
Firstly, the null modem cable is fine. I have already used the same cable and the same usb adapter successfully. However, even when it worked it took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using hyper terminal. Its a symmetrical situation and both machines have the same settings. The only difference is the ‘host’ has no serial port and hence uses a USB-RS232 adapter. The ‘target’ has a serial port. When I use hyperterminal, I am able to transmit characters from target to host but not from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -

  1. What is the protocol for this null modem cable communication?.

  2. Can I debug the communication between host and target?. Meaning, I want to trace every single message that is being sent to and fro. Something like using Wireshark on network card in promiscous mode, I want to look at every incoming and outgoing message.

  3. The reason I want to do 1) and 2) above is that, this null modem setup never actually works predictably. (I disagree with people who claim it is simple to setup. Its not easy to get it to work, even if you sorted your cable confusion :)). This time I am trying to get to the bottom of it and understand what is happening underneath. (Is there a certain sequence in which we must start the host and targets?. Is there something with USB-RS232 adapter that is causing issues in my case?. )
    Regards
    T

On Thu, May 2, 2013 at 10:25 AM, > wrote:
Folklore of not-too-many years ago was that if someone at Microsoft had
problems with getting WinDbg to talk across a serial line, the expert
would show up with a pair of wire cutters and snip all connections except
in, out, and ground.

To the OP: if you are typing on your host and seeing the characters on
your host, there is something deeply screwed up with your cable, and all
bets are off.

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.
joe

> What baud rate are you using?
>
> Have you tried using a different cable? We exclusively use serial
> debugging in our labs with physical machines and I’ve seen many strange
> issues resolved by switching cables.
>
> -scott
> OSR
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— WINDBG is sponsored by OSR OSR is hiring!! Info at http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks for the info. I’ve done this many times of the years for projects
that require serial debugging (e.g. servers with no spare PCI slots running
Server 2008) and rely on it for debugging at some customer sites (no serial
or 1394 on my Surface!). Good to know that it’s not officially supported
though, now I’ll know not to complain if it doesn’t work :slight_smile:

To clarify though the OP is currently in a state where the serial connection
cannot be validated using HyperTerminal, which takes KD entirely out of the
equation.

-scott
OSR

“Joe Ballantyne” wrote in message
news:xxxxx@windbg…

Using a USB-RS232 adapter with windbg is not supported.

That is why it is not working.

Find yourself a computer with a 16550 serial UART embedded in the
southbridge chipset, and use that as your host debugger.

Or even better move into the 21st century and use a modern debug transport.
(Think network debugging or 1394.)

The serial debug transport does not work with infinite memory channels, and
that is what the driver for the USB-232 adapter does by default. (Never
drops anything on the floor.)

The serial debug transport expects a channel with at most 16 bytes of
memory. (The size of the FIFO in a 16550.)

Joe.

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kaushik S
Sent: Thursday, May 2, 2013 1:21 AM
To: Kernel Debugging Interest List
Subject: Re: [windbg] Null modem cable setup

Hi,

Firstly, the null modem cable is fine. I have already used the same
cable and the same usb adapter successfully. However, even when it worked it
took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using hyper
terminal. Its a symmetrical situation and both machines have the same
settings. The only difference is the ‘host’ has no serial port and hence
uses a USB-RS232 adapter. The ‘target’ has a serial port. When I use
hyperterminal, I am able to transmit characters from target to host but not
from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -

1. What is the protocol for this null modem cable communication?.

2. Can I debug the communication between host and target?. Meaning, I want
to trace every single message that is being sent to and fro. Something
like using Wireshark on network card in promiscous mode, I want to look at
every incoming and outgoing message.

3. The reason I want to do 1) and 2) above is that, this null modem setup
never actually works predictably. (I disagree with people who claim it is
simple to setup. Its not easy to get it to work, even if you sorted your
cable confusion :)). This time I am trying to get to the bottom of it and
understand what is happening underneath. (Is there a certain sequence in
which we must start the host and targets?. Is there something with
USB-RS232 adapter that is causing issues in my case?. )

Regards

T

On Thu, May 2, 2013 at 10:25 AM, wrote:

Folklore of not-too-many years ago was that if someone at Microsoft had
problems with getting WinDbg to talk across a serial line, the expert
would show up with a pair of wire cutters and snip all connections except
in, out, and ground.

To the OP: if you are typing on your host and seeing the characters on
your host, there is something deeply screwed up with your cable, and all
bets are off.

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.
joe

> What baud rate are you using?
>
> Have you tried using a different cable? We exclusively use serial
> debugging in our labs with physical machines and I’ve seen many strange
> issues resolved by switching cables.
>
> -scott
> OSR
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

— WINDBG is sponsored by OSR OSR is hiring!! Info at
http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other
seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

xxxxx@flounder.com wrote:

In the worst case, go to your local computer store and buy a null modem
cable if you have made your own. And, as Scott has suggested, if you have
purchased the cable, try purchasing another brand. We used cables from
Radio Shack which worked just fine.

Our best results were always achieved with the old LapLink cables, which
had both 9-pin and 25-pin pigtails on each end. Those basically ended
all of my kernel debug cable machinations.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Joe Ballantyne wrote:

Using a USB-RS232 adapter with windbg is not supported.

That is why it is not working.

The serial debug transport does not work with infinite memory
channels, and that is what the driver for the USB-232 adapter does by
default. (Never drops anything on the floor.)

The serial debug transport expects a channel with at most 16 bytes of
memory. (The size of the FIFO in a 16550.)

Are you sure you’re describing the situation for the debug HOST? The
debug host transport mechanism uses standard system APIs to talk to the
serial port. Why would it care about the amount of buffering in the
hardware? Indeed, how would it even know?

No one doubts that there must be a genuine UART on the target system,
but this is the first time I’ve ever seen that assertion made for the
host, and I’m a bit dubious.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi,
Thanks everyone. I will stop kernel debugging with a USB adapter.
(Can I use a modern transport/network debugging with winxp or windows 7?.
)

Just one question - I have worked a little with (network) drivers. Is it
really that difficult to write a driver of USB-RS232 driver and why does
windbg NOT SUPPORT IT? And where in the msdn is it specified that it is
not supported?.
T

On Thu, May 2, 2013 at 10:14 PM, Tim Roberts wrote:

> Joe Ballantyne wrote:
>
> Using a USB-RS232 adapter with windbg is not supported.
>
>

>
> That is why it is not working.

>
>
>

> The serial debug transport does not work with infinite memory channels,
> and that is what the driver for the USB-232 adapter does by default.
> (Never drops anything on the floor.) **
>
>
**
>
> The serial debug transport expects a channel with at most 16 bytes of
> memory. (The size of the FIFO in a 16550.)
>
>
> Are you sure you’re describing the situation for the debug HOST? The
> debug host transport mechanism uses standard system APIs to talk to the
> serial port. Why would it care about the amount of buffering in the
> hardware? Indeed, how would it even know?
>
> No one doubts that there must be a genuine UART on the target system, but
> this is the first time I’ve ever seen that assertion made for the host, and
> I’m a bit dubious.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

> Hi,

Firstly, the null modem cable is fine. I have already used the same
cable and the same usb adapter successfully. However, even when it worked
it took a few attempts of restarting and trying repeatedly.

I will take back the phrase half-duplex if its incorrect. I am using
hyper terminal. Its a symmetrical situation and both machines have the
same settings. The only difference is the ‘host’ has no serial port and
hence uses a USB-RS232 adapter. The ‘target’ has a serial port. When I
use hyperterminal, I am able to transmit characters from target to host
but
not from host to target.

As I mentioned in my OP I have used the same cable before and it worked.

My question now is this -

  1. What is the protocol for this null modem cable communication?.
  2. Can I debug the communication between host and target?. Meaning, I want
    to trace every single message that is being sent to and fro. Something
    like using Wireshark on network card in promiscous mode, I want to look
    at
    every incoming and outgoing message.

I used to have an MS-DOS program that came with a funny T-connector. It
reflected data to and from; note that it required two serial ports on the
machine hosting it. It gave timings, reported CTS/DSR types of signals,
etc. I haven’t used it for at least 15 years, and no longer have a
machine that could support it. But it was the moral equivalent of
WireShark. I can’t remember the name, and don’t know if they have a Win32
version. Note that there is no concept of “message”, unless you believe a
single byte is a “message”. The program would list the bytes in the order
they arrived, showing each as a sequence of bytes until the other port saw
a byte going the other direction.

At least part of the reason I stopped using it was the fact that I simply
mo longer needed it.

Black Box Corporation used to sell a fairly expensive piece of hardware
that did this; you might check to see their current offerings, which might
be either cheaper, or your budget may be different than mine was.
joe

  1. The reason I want to do 1) and 2) above is that, this null modem setup
    never actually works predictably. (I disagree with people who claim it is
    simple to setup. Its not easy to get it to work, even if you sorted your
    cable confusion :)). This time I am trying to get to the bottom of it
    and
    understand what is happening underneath. (Is there a certain sequence in
    which we must start the host and targets?. Is there something with
    USB-RS232 adapter that is causing issues in my case?. )

We called it “The WinDbg two-step”. First, start WinDbg on the host. It
will say “Waiting for conection”. Then boot the target. If, for any
reason, you stop WinDbg, when you restart it, if it hangs on “Waiting for
connection”, Issue Debug>Break from the menus. That usually gets them
talking again. When the target stops (because you asked it to), F5 to
continue it.

As WinDbg matured, there was less and less need to dance the WinDbg
two-step; it was much better at re-establishing the connection. But, Your
Mileage May Vary.

As we hit the various problems in WinDbg (such as dialogs popping up UNDER
the debug window, because it had gotten detached), I would tell my
students that one of the values of the course was to teach them how to
roll their eyes, and sigh, “It’s WinDbg”, with appropriate feeling. This
happened less and less as the program matured.
joe

Regards
T

On Thu, May 2, 2013 at 10:25 AM, wrote:
>
>> Folklore of not-too-many years ago was that if someone at Microsoft had
>> problems with getting WinDbg to talk across a serial line, the expert
>> would show up with a pair of wire cutters and snip all connections
>> except
>> in, out, and ground.
>>
>> To the OP: if you are typing on your host and seeing the characters on
>> your host, there is something deeply screwed up with your cable, and all
>> bets are off.
>>
>> In the worst case, go to your local computer store and buy a null modem
>> cable if you have made your own. And, as Scott has suggested, if you
>> have
>> purchased the cable, try purchasing another brand. We used cables from
>> Radio Shack which worked just fine.
>> joe
>>
>>
>> > What baud rate are you using?
>> >
>> > Have you tried using a different cable? We exclusively use serial
>> > debugging in our labs with physical machines and I’ve seen many
>> strange
>> > issues resolved by switching cables.
>> >
>> > -scott
>> > OSR
>> >
>> > —
>> > WINDBG is sponsored by OSR
>> >
>> > OSR is hiring!! Info at http://www.osr.com/careers
>> >
>> > For our schedule of WDF, WDM, debugging and other seminars visit:
>> > http://www.osr.com/seminars
>> >
>> > To unsubscribe, visit the List Server section of OSR Online at
>> > http://www.osronline.com/page.cfm?name=ListServer
>> >
>>
>>
>>
>> —
>> WINDBG is sponsored by OSR
>>
>> OSR is hiring!! Info at http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

I could not remember the word “LapLink”. Thank you. Too many of these
bits dropped after the stroke.
joe

xxxxx@flounder.com wrote:
> In the worst case, go to your local computer store and buy a null modem
> cable if you have made your own. And, as Scott has suggested, if you
> have
> purchased the cable, try purchasing another brand. We used cables from
> Radio Shack which worked just fine.

Our best results were always achieved with the old LapLink cables, which
had both 9-pin and 25-pin pigtails on each end. Those basically ended
all of my kernel debug cable machinations.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> Thanks everyone. I will stop kernel debugging with a USB adapter.

It is fine on the host (debugger). Just not the target (debugee) side.

A USB serial port appears just like a regular com port on the host machine.
Windbg works just fine with it,
On the target, the kernel looks for “real” serial ports. This has nothing
to do with windbg.

On Fri, May 3, 2013 at 12:50 AM, Kaushik S wrote:

> Hi,
> Thanks everyone. I will stop kernel debugging with a USB adapter.
> (Can I use a modern transport/network debugging with winxp or windows 7?.
> )
>
> Just one question - I have worked a little with (network) drivers. Is it
> really that difficult to write a driver of USB-RS232 driver and why does
> windbg NOT SUPPORT IT? And where in the msdn is it specified that it is
> not supported?.
> T
>
>
>
> On Thu, May 2, 2013 at 10:14 PM, Tim Roberts wrote:
>
>> Joe Ballantyne wrote:
>>
>> Using a USB-RS232 adapter with windbg is not supported.
>>
>>

>>
>> That is why it is not working.

>>
>>
>>

>> The serial debug transport does not work with infinite memory channels,
>> and that is what the driver for the USB-232 adapter does by default.
>> (Never drops anything on the floor.) **
>>
>>
**
>>
>> The serial debug transport expects a channel with at most 16 bytes of
>> memory. (The size of the FIFO in a 16550.)
>>
>>
>> Are you sure you’re describing the situation for the debug HOST? The
>> debug host transport mechanism uses standard system APIs to talk to the
>> serial port. Why would it care about the amount of buffering in the
>> hardware? Indeed, how would it even know?
>>
>> No one doubts that there must be a genuine UART on the target system, but
>> this is the first time I’ve ever seen that assertion made for the host, and
>> I’m a bit dubious.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> WINDBG is sponsored by OSR
>>
>> OSR is hiring!! Info at http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> — WINDBG is sponsored by OSR OSR is hiring!! Info at
> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

On Fri, May 3, 2013 at 5:55 PM, Jim Donelson wrote:

> > Thanks everyone. I will stop kernel debugging with a USB adapter.
>
> It is fine on the host (debugger). Just not the target (debugee) side.
>

I am using USB Adapter, only on the host. I think we all agree that USB
Adapter on the host is not reliable. The question posed was why would
Windbg find it difficult to support it and where is it mentioned in msdn.
Why cant one write a driver that would present a nice RS232 interface to
Windbg?.

Kaushik S wrote:

On Fri, May 3, 2013 at 5:55 PM, Jim Donelson > mailto:xxxxx> wrote:
>
> > Thanks everyone. I will stop kernel debugging with a USB
> adapter.
>
> It is fine on the host (debugger). Just not the target (debugee) side.
>
> I am using USB Adapter, only on the host. I think we all agree that
> USB Adapter on the host is not reliable.

Do we? Scott Noone only said: “USB to serial adapters are notoriously
crappy (we have a pile of them in the office at the ready to replace
dead ones)”.

> The question posed was why
> would Windbg find it difficult to support it and where is it mentioned
> in msdn. Why cant one write a driver that would present a nice RS232
> interface to Windbg?.

Serial port drivers are a complex piece of work. Look at the size of the
code in src\serial\serial. It’s hard to get it right, and some vendors
are more successful than others. At the place where I work, FTDI has a
very good reputation.

So what brand of adapter are you using, i.e. what does the driver page
in the port properties say?</mailto:xxxxx>

Ok, perhaps the one you are using is unreliable, but in general it works.
I’ve been using USB on the host for quite some time with no issues…

On Fri, May 3, 2013 at 8:49 AM, Kaushik S wrote:

>
>
> On Fri, May 3, 2013 at 5:55 PM, Jim Donelson wrote:
>
>> > Thanks everyone. I will stop kernel debugging with a USB adapter.
>>
>> It is fine on the host (debugger). Just not the target (debugee) side.
>>
>
>
> I am using USB Adapter, only on the host. I think we all agree that
> USB Adapter on the host is not reliable. The question posed was why would
> Windbg find it difficult to support it and where is it mentioned in msdn.
> Why cant one write a driver that would present a nice RS232 interface to
> Windbg?.
>
>
> — WINDBG is sponsored by OSR OSR is hiring!! Info at
> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>