HTTPS clone URL
Subversion checkout URL
ADO ALLMAN APPLE ARM32_BROKEN_RELOCS ATT AVALON BERGAMINI BKTR_SF BOSTIC BSD CAGNEY CDC CDK CHRISTOS CITRUS CODA COLUMBIA CROOKS CRSG CSRG_contrib CSRG CVSHOME CYGNUS DARRENR DBJ DHCPCD DICKEY DMG DROCHNER EKERMIT ELRICshvfork ERYK_VERSHEN ERYK ESR EZK FILE FLEX FREDETTE FREEBSD_SMBFS FREEBSD FSF FlorianStoehr FreeBSD GCC_2_4_5 GENERIC GITHUB_JMMV GNU_EFI GNU_bc_1_03 GNU_dc_1_03 GNU GOOGLE_CODE GREENWOODSOFTWARE GWR GWR_2_3_8 HEIMDAL HM HPCMIPS HUBERTF IMAKEICIDE_II INTEL IPSEC_TOOLS IS_FPLSP_LIBM ISC ISDN4BSD JEREMY JHD_ECS JRT JSEWARD Jochen_Pohl John_M_Vinopal KAME KIENTZLE KJC KOCIELS KRISTAPS KTH_KRB LAURIKARI LBL LEFEBVRE LEMIS LIBEVENT LINUX LLVM LUA Leo MACKERRAS MALINEN MILLERT MN MOJ MOUSE MR Masaru Matthias Motorola NAWK NETBSD_I386 NETBSD NETPGP NONGNU NTFS NUDELMAN NUDLEMAN NVI NetBSD OPENBSD OPENLDAP OPENPAM OPENPGPSDK OPENSSH OPENSSL OpenBSD PAO PATHSCALE PIERMONT_NELSON PKGSRC PROVOS PROVOS00 Pfaller REDHAT RIPE SENDMAIL_INC SGI SQLITE SUN3 SYN_cache_branch SYNOPSYS Sun TAYLOR TCPDUMP TELTRONICS THORPEJ TMUX TNF TOOLS TROUSERS TZDATA UCB_JHAUSER UCSF UDEL UMD VENEMA VERN_PAXSON VJS WASABI WFJ_920714 WJF_920714 XZ Xen ZLIB abandoned_netbsd_4 ad_audiomp ad_audiomp2 ad_pmax_wscons adler agc_netpgp_standalone agc_pkgs agc_symver alice alpha_nwscons amiga_release atheros_hal before_newconf bjh21_hydra bjh21_wd33c93 bostic_nvi bouyer_ide bouyer_quota2 bouyer_scsipi bouyer_xen2 bouyer_xenamd64 bouyer_xeni386 bozohttpd briggs bsd4_4utah ccranor_mvme68k cgd chap_midi cherry_xenmp chris_arm_intr_rework christos_time_t chs_ubc chs_ubc2 cjs_build_against_obj_dir cmu_sup comdex_fall_1999 csrc_net2 csrg_net2 cube_autoconf curses_v3 darrenr dhcpcd digital draga dynamic_messages eef eeh_devprop eeh_paddr_t eeh elad_kernelauth expat ezk freebsd fsf fvdl_fs64 fvdl_softdep gdamore_uart gehenna_devsw gmcgarry_ctxsw gmcgarry_ucred gmp gwr_gdb gwr_3x3 gzip haad_dm hpcarm_cleanup ifpoll intel ipsec_tools_0_7_branch ipsec_tools_0_8_branch is_m68ktest is_newarp is itohy_usb1 ivory_soap ivory_soap2 jdc jmcneill_audiomp3 jmcneill_pm jmcneill_usbmp jmcneill jruoho_x86intr jwise jym_xensuspend kame keiichi_mipv6 kenh_if_detach kent_audio1 kent_audio2 khorben_n900 kohl kqueue ktrace_lwp leo lonhyn lukem_nsswitch2 madwifi magnum maja marc_pcmcia matt_armv6 matt_dainty matt_mips64 matt_nb4_arm matt_nb5_mips64 matt_nb5_pq3 matt_nb6_plus matt_timespec mesa_drm minoura_x68k_bus_h minoura_xpg4dl minoura mjacob mjf_devfs mjf_devfs2 mjf_ufs_trans mortalinstall mouse mpc mpfr mrg_and_rtr mrg_ohci_jmcneill_usbmp mrg_rcmd mrg_vm_object_collapse mrg_vm_swap mrg_vm_swap2 mrg mw_amiga_machdep_merge mycroft nathanw_sa netbsd_cryptosrc_intl netbsd_cryptosrc_us netbsd netbsd_0_9 netbsd_1_0 netbsd_1_1 netbsd_1_2 netbsd_1_3 netbsd_1_4 netbsd_1_5 netbsd_1_6 netbsd_2 netbsd_2_0 netbsd_2_1 netbsd_3 netbsd_3_0 netbsd_3_1 netbsd_4 netbsd_4_0 netbsd_5 netbsd_5_0 netbsd_5_1 netbsd_5_2 netbsd_6 netbsd_6_0 netbsd_6_1 netbsd_7 netbsd_7_0 newgrp_standalone newlock newlock2 nick_csl_alignment nick_hppapmap nick_net80211_sync nick_nhusb nisimura_pmax_wscons nsswitch nvm openbsd pefo perry perseant_lfsv2 peter_altq peter_eriksson phil_pc532 pkgsrc pkgviews pmax_base ppcoea_renovation ragge rcs reinoud_bufcleanup riastradh_drm2 rmind_smpnet rmind_uvmplock ross_ncr_fb1_123_merge roy rpaulo_netinet_merge_pcb rtr_xorg_branch schmorpforge scottr_mac68k_wscons scw_mvme68k_bus_space scw_mvme167 simonb_timecounters simonb_wapbl sjg sommerfeld_i386_mp_1 sommerfeld_i386mp_1 sun sun3_1_0_base sunpro thomas thorpej_atomic thorpej_bus_dma thorpej_devvp thorpej_mips_cache thorpej_scsipi thorpej_setroot thorpej_signal thorpej_syslogd_hack_branch thorpej_vnode_attr tls_earlyentropy tls_maxphys trunk uebayasi_xip vixie vmlocking vmlocking2 vtag wcurses wrstuden_devbsize wrstuden_fixsa wrstuden_revivesa ws_code yamt_idlelwp yamt_km_doc yamt_km yamt_kmem yamt_lazymbuf yamt_nfs_mp yamt_pagecache yamt_pdpolicy yamt_pf42 yamt_readahead yamt_splraiseipl yamt_uio_vmspace yamt_vop yamt_x86pmap zlib
Nothing to show
Nothing to show
Fetching latest commit...
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
$NetBSD: README.port,v 1.4 2006/11/24 22:52:16 wiz Exp $ What to Look for when Porting the IPKDB Interface =============================================== Try to avoid calling any routine from the rest of the kernel. (It's OK to call these routines during initialization). You wouldn't be able to set breakpoints within these routines during debugging, since this would hang the debugging interface. Interface between IPKDB and Ethernet Board (sys/dev/yy/if_xx.c) -------------------------------------------------------------- General Considerations There is a problem when the debugger uses the same ethernet board as does the rest of the kernel. For one thing there might arrive packets destined for the kernel during debugging sessions. These packets are currently lost. For packets on their way out the driver has to leave the interrupt pending condition alone, so the interrupt handler gets a chance to send more packets via the interface. Configuration Files For any interface that may be used for debugging there should be an option, put into opt_ipkdb.h, that is enabled if the kernel shall actually use this interface. The relevant part of the "files" file for interface "xx" would look like this: defopt opt_ipkdb.h IPKDB_XX : IPKDB device xx: ether, ifnet, arp file dev/zz/if_xx.c xx | ipkdb_xx The file dev/zz/if_xx.c contains both the code of the kernel driver and the IPKDB driver for this interface. You should #include "opt_ipkdb.h" in there and conditionalize the compilation of the IPKDB driver with #ifdef IPKDB_XX The appropriate part of the machine configuration would read like this: options IPKDBKEY="\"IPKDB key for remote debugging\"" options IPKDB_XX Driver Code In order to be able to find the debugging interface, the driver has to provide an attach routine that the machine dependent code can call at an appropriate time (see below). The attach routine should take as its first argument a pointer to a struct ipkdb_if plus some additional parameters that allow it to access the devices registers, hopefully using bus_space_* 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 everytime IPKDB is entered. leave routine called everytime 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 dependent data. Unused by other code. The routine should check for existence of the ethernet board. This routine should also note enough information so it is able to later find the system driver instance for the same board in order to coordinate its action with the system driver. The routine should return 0 on success and -1 on failure. The remainder of the routines are called via function pointers in the ipkdb_if structure. The probe routine needs to fill in these function pointers with proper values. void start(struct ipkdb_if *kip) This routine gets called every time the debugger is entered. kip is a pointer to the ipkdb_if structure used for debugging. It should initialize the hardware and software interface. This routine should also note the current state of the board (as far as it can) so a later call to leave can reinstantiate this state. void leave(struct ipkdb_if *kip) This routine is called whenever the debugger is left. It should restore the ethernet hardware to the state prior to the last call to start. int receive(struct ipkdb_if *kip, u_char *buf, int poll) This routine should return an ethernet packet to the buffer pointed to by buf and return its length. The packet should be complete with the ethernet header, i.e. it starts with the recipient address, but does not contain the ethernet checksum. If poll is set, it should return immediately, if no packet is available. Otherwise it should wait for the next packet. This routine shall return the number of bytes transferred to buf. void send(struct ipkdb_if *kip, u_char *buf, int l) This routine should send an ethernet packet out of the debugging interface. The packet is already complete with the ethernet header, but does not contain the ethernet checksum. Interface between IPKDB and Machine (sys/arch/xxx/xxx/ipkdb_glue.c) ----------------------------------------------------------------- void ipkdbinit(void) This routine gets called when the debugger should be entered for the first time. int ipkdb_poll(void) This routine gets called after a panic to check for a keypress 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. int ipkdbcmds(void) There should be call to this routine from somewhere in locore 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 ipkdbregs. The layout of this area must be the same as that expected by GDB. The return value of this routine is 0, if the user wants to continue, 1 if the user wants to do single stepping, and 2 if the user has detached from debugging. int ipkdbfbyte(u_char *p) This routine should fetch a byte from address p. It must not enter any trap handling code, but instead return -1 on inability to access the data. void ipkdbsbyte(u_char *p,u_char c) This routine should set the byte pointed to by p to the value given as c. 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. sys/arch/xxx/include/ipkdb.h Machine dependent definitions and protoypes should be in sys/arch/xxx/include/ipkdb.h, i.e. in <machine/ipkdb.h>. This includes the size of the array ipkdbregs, that holds the contents of the registers of the debuggee at the time IPKDB is entered.