Re: Host tool for KDP over serial
Re: Host tool for KDP over serial
- Subject: Re: Host tool for KDP over serial
- From: David Elliott <email@hidden>
- Date: Wed, 10 Jun 2009 13:06:45 -0400
Hi Shantonu,
I am bringing up Darwin on a different type of i386 and I need debug
earlier than either Ethernet or FireWire can provide. Ordinarily in a
case like this I'd use VMware's debug stub but the problem I'm having
is that I have a particular machine that seems to hang during startup
with the last IOLog message indicating that IOPCIConfigurator::attach
is running. Obviously it's not possible to debug stuff in a VM that
only happens on a particular physical machine.
Both the firewire and ethernet debuggers match on the PCI device nub
so they aren't available until after PCI configuration has occurred.
With a serial-based KDP connection that starts before the PE is
started I would presumably be able to figure out where it's hanging
and what's happening.
I'll go ahead and write the host-side tool and see if I can get that
working. It seems to me that this code must have been used fairly
recently since someone bothered to add an #if CONFIG_EMBEDDED to it.
So I have to assume the tool exists at Apple. I assume you have your
reasons for not wanting to give it up so that's that. I figured it
didn't hurt to ask though.
Thanks,
-Dave
On Jun 10, 2009, at 1:47 AM, Shantonu Sen wrote:
I don't believe we have any plans to provide a tool for this, since
the only Mac with built-in serial is the Xserve, which has both
firewire and ethernet.
Those are the supported transports for doing GDB interactive
debugging and saving kernel core dumps.
Shantonu
Sent from my MacBook
On Jun 9, 2009, at 9:46 PM, David Elliott wrote:
Hi,
I'd like to run KDP over RS232 serial on an i386 target.
Examination of source in osfmk/kdp indicates that the kernel
expects to see ethernet frames coming in over RS232 preceded with
0xFA and ending with 0xFB with occasional escaping using 0xFE to
indicate an escape, two's complement of the escaped bytes, and 0xFB
to end the escape.
I have succeeded in hand crafting an ARP packet of this format and
when I send it down the wire I appear to get the appropriate
response from the kernel.
So now I am wondering if Apple has provided or can provide a tool
similar to the one for Firewire debugging that listens on UDP 41139
and shuttles the data over a /dev/tty device and back.
If not, writing one would be reasonably easy but I figured I'd ask
before embarking on that. Source is preferable as I'd prefer to
run it on a Linux machine with a hardware serial port as the PL2303-
based USB I have on the host side seems to have strange issues with
the driver from sourceforge.
Also, there's an interesting "bug" of sorts in the code. The IP of
the KDP will actually be different depending on whether it's big or
little endian. The target's IP is set to 0xABADBABE so on little
endian targets the IP is 190.186.173.171 but on big endian targets
it would presumably be 171.173.186.190. A bad babe indeed.
-Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden