+3  A: 

Are you sure you have a good serial connection?

The cable must be a null modem cable - you should verify this using a terminal program (without kernel debugging enabled on the target). Run the program (HyperTerminal or whatever) on both the target and the host machines (remember, like I said before kernel debugging over that port must not be enabled on the target or the port can't be opened).

You can find some links to free terminal programs (I don't think Microsoft provides HyperTerminal anymore since Vista) here: http://www.lvr.com/serport.htm#software

Type some characters on one machine, and make sure they show up on the other side. Do the same on the other machine.

If you can't do this, then there's no serial connection and you'll have to get a null modem cable or adapter. There's no point in trying to get KD to work over that connection until you can do this.

Also, remember that the COM port used by kernel debugging on the target must be a standard 8250 family UART (usually a 16550 or better nowadays, and usually baked into the motherboard chipset). It can't be a USB serial port connector (although that kind will work fine on the host side, since on the host kd.exe is a regular Win32 program).

Edit:


If it's not a serial connection problem, the problem might be that your target doesn't support configuration using boot.ini. Since Vista, boot parameters have been specified using the "Boot Configuration Database" (BCD) which is manipulated with a program like bcdedit.exe. Unfortunately, configuring a system using BCDedit is much more complicated than just editing a simple text file like boot.ini.

You should read the debugger helpfile section "Configuring Software on the Target Computer"; in particular the "Using Boot Parameters" part. there are details there on how bcdedit can be used to enable debugging on Vista and later systems.

Michael Burr
Thanks for quick info. I disabled kernel debugging mode on Target system and verified that RS232 serial cable is good by using HyperTerminal program. I am able to send the characters from Host to Target system and VV. Both systems are running with Windows XP 32bit SP3 OS. COM ports are part on Mother board on both systems. I don't know exactly about UART spec..I will try get some info. Are there any other suggestion which I can try? Thanks King
kingas
If you're not using a USB to serial port device then the COM port hardware should be fine - you don't need to determine the actual UART part number. I was just trying to reinforce that it can't be a USB serial ort on the target.
Michael Burr
Sorry - I missed the line about both systems running WinXP SP3 32-bit. On re-reading I don't see the "/debug" boot.ini option mentioned - is that on the boot.ini entry?
Michael Burr
I have added “/debugport=com1 /baudrate=57600” to boot.ini file on Target system. Do I need to add /debug option ?
kingas
Yes, I am using win XP systems not Vista.
kingas
I've never tried it without (except maybe by accident). I'm not at a machine where I can verify, but I'm pretty sure it's necessary and is not implied by having '/debugport'.
Michael Burr
Michael, Thanks for your help. Some how I am able to make debug working using winDbg. I don't know exactly why it didn't work using kd. Presently I am continuing with WinDbg.
kingas
@kingas - that's very strange. As far as I know, WinDbg and kd use the same debugging engine DLL library, which is what should be responsible for the communications to the target (though it's possible that I don't know what I'm talking about). However, WinDbg and kd have exactly the same fundamental capabilities, so you're not losing anything (in fact the command window in WinDbg is essentially a kd console).
Michael Burr
A: 

The other thing you can test to see if debugging is working on the target is to invoke kd -kl on the target - if it tells you debugging isn't enabled, you haven't set up boot.ini correctly.

Paul Betts