Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ipkdb(4) [netbsd man page]

IPKDB(4)						   BSD Kernel Interfaces Manual 						  IPKDB(4)

NAME
ipkdb -- IP-based kernel debugger SYNOPSIS
options IPKDB options IPKDBSECURE options IPKDBKEY=""IPKDB key for remote debugging"" options IPKDB_NE_PCISLOT=x DESCRIPTION
ipkdb is a kernel debugger that uses UDP and IP to communicate with a remote debugger (normally gdb(1)). Since the debugger uses its own driver to talk to the networking hardware, the number of supported network interfaces is a lot less than what is supported by the kernel. At the time of this writing, there is only support for a NE2000 compatible card in a PCI slot. In order for ipkdb to find your card, you need to specify the slot the card is in via the options IPKDB_NE_PCISLOT. To use ipkdb, you have to set up a DHCP server, from which ipkdb can get the IP address for the interface that is used for debugging. To enter ipkdb, the remote debugger has to send the protocol start packet. E.g., gdb will do this on the command target ipkdb debuggee IPKDB key for remote debugging where debuggee is the name of the machine to debug (which must resolve to the IP address of the interface), and the rest of the line corre- sponds to the definition of IPKDBKEY (see below). For ipkdb to actually see this packet, the interface which is used for debugging has to be set up to actually receive packets, i.e. it has to be up and running. To prevent messing around with a secured system, ipkdb normally also checks the security level at which the kernel is running. ipkdb will only work with security levels less than 1, unless the kernel is configured with options IPKDBSECURE. In addition, the debugger is forcedly entered on a panic, as well as on initial startup, if you boot the kernel with the -d option (note that this however is machine dependent). On such a forced enter to ipkdb there is no need for the interface in question to already be up and run- ning, since ipkdb only needs to send/receive packets via its own driver. As some form of security against the occasional hacker, ipkdb uses the definition of options IPKDBKEY to compute a checksum on the data in every packet. The remote debugger has to send this checksum, based on the data it sends and the key, or ipkdb ignores the packet. This is also used in order to check against data errors on the connection. SEE ALSO
gdb(1), ddb(4), ip(4), udp(4), init(8) HISTORY
ipkdb appeared in NetBSD 1.3 for the first time. Its configuration and setup changed quite a bit in NetBSD 1.5. BUGS
Since the kernel includes the definition of IPKDBKEY, anyone who can read the kernel can extract it and use it to enter ipkdb. There is no support for ip6(4). BSD
March 27, 2000 BSD

Check Out this Related Man Page

IPKDB(9)						   BSD Kernel Developer's Manual						  IPKDB(9)

NAME
ipkdb -- machine-dependent interface to ipkdb SYNOPSIS
#include <ipkdb/ipkdb.h> void ipkdb_init(void); void ipkdb_connect(int when); int ipkdbcmds(void); void ipkdbinit(void); void ipkdb_trap(void); int ipkdb_poll(void); int ipkdbif_init(struct ipkdb_if *kip); int ipkdbfbyte(u_char *c); int ipkdbsbyte(u_char *c, int i); DESCRIPTION
The machine-dependent code must support this interface for operation with ipkdb(4). During system bootstrap, machine-dependent code must invoke ipkdb_init(). If the kernel is booted with RB_KDB set in boothowto (see boothowto(9)), ipkdb(4) is enabled by invoking ipkdb_connect(), setting the when argument to 0. ipkdbcmds() is invoked by machine-dependent code when the trap mechanism determines that the debugger should be entered, i.e., on a single step or breakpoint interrupt from kernel code. The trapping mechanism should already have stored the registers into the global area ipkd- bregs. The layout of this area must be the same as that expected by gdb(1). Valid return values are: IPKDB_CMD_RUN user wants to continue IPKDB_CMD_STEP user wants to do single stepping IPKDB_CMD_EXIT user has detached from debugging FUNCTIONS
The machine-dependent code must provide the following functions for the machine-independent code. ipkdbinit() This routine gets called when the debugger should be entered for the first time. ipkdb_trap() This routine is part of the trap handler. Whenever a trap happens (e.g., when hitting a breakpoint during debugging), ipkdb_trap() decides if the Debugger needs to be called. If there are other ways to decide that, it's not necessary to provide an ipkdb_trap() implementation. ipkdb_poll() This routine gets called after a panic to check for a key press by the user. If implemented it allows the user to press any key on the console to do the automatic reboot after a panic. Otherwise the debugging interface will wait forever for some remote debugger to attach in case of a panic. ipkdbif_init(kip) In order to be able to find the debugging interface, the network driver must invoke ipkdbif_init() with kip specifying a struct ipkdb_if plus some additional parameters that allow it to access the devices registers, hopefully using bus_space(9) methods. In the ipkdb_if structure, the attach routine must initialize the following fields: myenetaddr fill this with the own ethernet address of the device/machine flags mark at least IPKDB_MYHW here name name of the device, only used for a message start routine called every time ipkdb is entered leave routine called every time ipkdb is left receive routine called to receive a packet send routine called to send a packet Additional fields that may be set are: myinetaddr fill this with the own internet address, and mark IPKDB_MYIP in flags port may be used as a pointer to some device ipkdbfbyte(c) This routine should fetch a byte from address c. It must not enter any trap handling code, but instead return -1 on inability to access the data. ipkdbsbyte(c, i) This routine should set the byte pointed to by c to the value given as i. The routine must not enter any trap handling code. Furthermore it should reset the modification bit in the relevant page table entry to the value before the store. SEE ALSO
ipkdb(4), boothowto(9) BSD
September 4, 2009 BSD
Man Page