Setup

Once you have the two machines on the same Ethernet segment, you'll need to add the experimental machine to the debugging machine's arp tables. This example assumes the machine hasn't crashed yet. If it has crashed, you'll be unable to ping it and obtain the hardware address. Generally it's a good idea to keep a list of the hardware/IP address pairs of your development machines so you don't need to ping them to get the HW address. To find the hardware address of the experimental machine when it hasn't crashed, do the following on the debugging machine:

	> ping -c 1 experimental-machine
	PING 198.11.19.24 (198.11.19.24): 56 data bytes
	64 bytes from 198.11.19.24: icmp_seq=0 ttl=255 time=3.439 ms

	--- 198.11.19.24 ping statistics ---
	1 packets transmitted, 1 packets received, 0% packet loss
	round-trip min/avg/max = 3.439/3.439/3.439 ms
	> arp -an
	experimental-machine (198.11.19.24) at 0:a:27:ab:8b:d8
	> arp -s experimental-machine 0:a:27:ab:8b:d8
	> arp -an
	experimental-machine (198.11.19.24) at 0:a:27:ab:8b:d8 permanent
	

The debugging machine now has the experimental machine added to it's arp table permanently (or until the next reboot).

Copy over the experimental kernel to the debugging machine. gdb will use this for following along.

Boot the experimental machine with the experimental kernel. When the experimental machine says Waiting for remote debugger connection, then you can fire up gdb on the debugging machine.

To bring up gdb on the debugging machine, do the following:

	> gdb mach_kernel
	GNU gdb 4.18.1-20000320 (Apple version gdb-166) (UI_OUT)
	Copyright 1998 Free Software Foundation, Inc.
	GDB is free software, covered by the GNU General Public License, and you are
	welcome to change it and/or distribute copies of it under certain conditions.
	Type "show copying" to see the conditions.
	There is absolutely no warranty for GDB.  Type "show warranty" for details.
	This GDB was configured as "powerpc-apple-macos10".

	warning: Error fetching LC_DYSYMTAB load command from object file
	"/Local/Users/bbraun/mach_kernel"
	(gdb) target remote-kdp
	(gdb) attach experimental-machine
	

and on success, the experimental machine will say Connected to remote debugger.

You are now ready to debug the kernel.