?? readme.txt
字號(hào):
######################################################### README.txt## how to build an i386-linux to ppc-linux Cross Debugger# with the new gdb target mpcbdm## Version: 1.2.3# Date: 2002/04/05# Firstdate: 1999/09/03# Author: FP, mailto: Frank.Przybylski@vas-gmbh.de# Copyright:(c) 1999,2000,2001,2002 VAS GmbH########################################################Contact and Help: Please mailto:bdm4gdb-users@lists.sourceforge.netif you have any questions, problems, new ideas! This list is search able viahttp://www.geocrawler.com/redir-sf.php3?list=bdm4gdb-users. Here's a for non-commercial usage free blueprint for a BDM interfacefor the MPC860. Included in the archive is the source code for a newgdb target mpcbdm. This target communicates over a standard printer portwith the BDM-Port of the MPC8xx processor family.The adapter uses only two 74HC14 (six inverting Schmitt-Triggers)and a couple of discrete elements.Features: access to MPC860 registers, special purpose registers(with names of bit fields), memory, download code ( about 114kbit/s,kernel takes about 20s), disassemble and debug code in MPC860 system,starting, stopping, software breakpoints, single stepping (both assembler instructions and source code), FLASH support (right now only for AMD 29LV160),booting the MPC without any PROM, starting linux kernel from target's RAMwithout any firmware or boot ROM.Acknowledgments:Based on Sergey Drazhnikov work, thanks Sergey!Tested with a MPC860SR 50MHz on a TQ-Components TQM860-Board.Thanks goes also to Wolfgang Denk, www.denx.de, for lots of ideas and hints and aid to get the board running linux.Thanks to Raphael Bossek for the sourceforge project site!http://bdm4gdb.sourceforge.net/ and http://sourceforge.net/projects/bdm4gdb/Thanks to Erwin Rol for his VFLS solution for the first adapter version.Thanks to Jean-Paul Iribarren for bug fixes and his Cygwin / Insight version of the mpcbdm target.Thanks to anybody else who have taken part in developing this project and I forgot to mention here explicitly.Thanks to No Warranty! Use at own risk!Watch out especially for the voltages allowed on the BDM port input pins of your target processor!Requires a host running linux, tons of installed software...Have fun!Copyright (c) 1999, 2000, 2001, 2002 VAS GmbH, Hamburg , Germany.Visit our home page at www.vas-gmbh.de.Contact me via mailto:Frank.Przybylski@vas-gmbh.de-------------------------------------------------------------List of files in mpcbdm.tar.gz:MPCBDM/README.txt # you're just reading meMPCBDM/index.html # the mpcbdm html project descriptionMPCBDM/VDB2.gif # schematic of adapter version 2MPCBDM/mpcbdm.c # the target source code filesMPCBDM/mpcbdm.hMPCBDM/Makefile.in # the adapted makefileMPCBDM/linux.mt # tell gdb which target can use mpcbdmMPCBDM/mpc.init # gdb script file for TQM boardsBuildGDB # shell script to build the cross gdbBuildLinux # shell script to fix image and initrd sections for download-------------------------------------------------------------Because 'mpcbdm' is no official target for the gdb (not yet?),you need to build your own gdb with 'mpcbdm' support.Therefore gdb needs to know about the new target (linux.mt),how to make it (Makefile.in) and the source files mpcbdm.[ch].For those who are not familiar with compiling gdb, I have includeda simple shell script 'BuildGDB' which automates the building steps.See below, how to invoke 'BuildGDB'.If you know what you do, just copy the two source files and theMakefile.in into the $GDB/gdb dir and the target definitionsinto $GDB/gdb/config/powerpc/, configure for target=powerpc-linuxand build gdb.-------------------------------------------------------------Invoking 'BuildGDB':All 'BuildGDB' needs is the source archive gdb-5.0.tar.gzand the extracted mpcbdm archive in the same directory.1. make directory (place holder $DirGDB) where to build (and install) the cross debugger:> mkdir $DirGDB> cd $DirGDB2. copy mpcbdm and gdb source archives to $DirGDB:> cp gdb-5.0.tar.gz $DirGDB> cp mpcbdm.tar.gz $DirGDB3. extract mpcbdm.tar.gz archive:> tar -xzvf mpcbdm.tar.gz this should produce the directory 'MPCBDM/' and one script 'BuildGDB'. If you want to use the script to build also a linux kernel to use with gdb download procedures, you have to adapt the script to your directory structure. Building just gdb should be possible without any modifications.4. run the 'BuildGDB' script:> ./BuildGdb gdb this should produce tons of output. All this output is logged to 'build-gdb'. If everything works fine there should be two new directories: gdb-5.0 (the gdb source tree) and build-gdb (the VPATH) and the cross debugger: powerpc-linux-gdb.If you want to debug the debugger replace '-O2' with '-g' inSET_CFLAGS=CFLAGS=-O2in 'BuildGDB'.----------------------------------------------------------------Running the cross debugger:Here's a quick tour of how to run the gdb with mpcbdm target.The mpcbdm target needs access to the ioport address space.The obvious way to get these access rights is to runpowerpc-linux-gdb as root (e.g. via sudo).Another way is now to SUID root on powerpc-linux-gdb:>chmod a+s powerpc-linux-gdb>chown root powerpc-linux-gdb # you need root rights for this stepDepending on your Linux distribution, SUID might only function in specialdirectories, e.g. /usr/bin.Start the debugger with executing a gdb script to disableMPC internal watchdog (default is about 2.5s)(use 'gdb's 'source' command to run script files inside')>powerpc-linux.gdb -x MPCBDM/mpc.initSee gdb script mpc.init for details(especially the MPC's internal watchdog took me some time)help target # show available targetsh mp # help mpcbdm:list target mpcbdm obscure commandsinfo target # show actual targettarget mpcbdm 0 # start debugging over BDM, resets processorshow target # show active targets parametershow mpcbdm_delay # show delay value for BDM signalsset mpcbdm_delay 10 # set delay value to 10 (default 0)mp spr # show list of gdb supported special purpose registersmp sprs # list important special purpose registersmp spr der = 0x7002400f # set Debug Enable Register to a reasonable valuemp upms # show contents of UPM A and memory mappinghelp mp flash # show help for FLASH support normal gdb functionality:x/20i 0x100 # disassemble the first 20 instructions from monitor programj *0x100 # with TQM860 Board: jump to start monitor after reseting # to have all processor settings correct (UPMs etc)c # continue will do also start up the monitor on TQM # break with <ctrl>-c if there is an auto application # with TQM it's also possible to use the 'init' macro # for reset and 'tqmmem' for a simple memory setupset {int} 0x500000 = 2880293630 # check, if you can write into RAMx/1xw 0x500000 # and if memory holds that informationlo jen 0x30000 # load object file with offset 0x30000 (assume jen begins at 0x0)sym jen # load also debugging informations (gcc -g option)b *0x30060 # set break point at address 0x30000i b # info about breakpointsj *0x30000 # start program at 0x30000i r # info about registers, see 'rd' macroset $r12 = 0x1234 # set gpr 12 to 0x1234c # continue after hitting breakpointsi # step one processor instructiond 1 # delete breakpoint number 1dis 1 # disable breakpoint 1en 1 # enable breakpoint 1disp /i $pc # after stopping display next instructionp/x $r9 # print gpr9 in hexl main # list functionTry 'help' inside the gdb for lot's of information.Try 'show mpcbdm[TAB][TAB]' to get a list of mpcbdm specific variables.----------------------------------------------------------------Included in 'BuildGDB' is a part of how to build a cross kerneland make gdb uploading this kernel into the MPC860 system via BDM.To use the FLASH routines your target has to be configured(GPCM, using the fast flash routines also the UPM).See 'Init' and 'TQMMem' macros in mpc.init for memory setup.I use 'Init' and 'DoInit' to upload my kernel into the target,setting up a kernel command line, then 'c' for continue to startthe kernel.----------------------------------------------------------------New features in version 1.2.3: hopefully flexible flash routines using a text configuration file, fixed MSR/SRR1 bug (machine state got corrupted, disturbing especially early kernel debugging)----------------------------------------------------------------New features in version 1.2.2-pre: adapted tablewalk to linux-2.4, fixed several bugs in the BDM protocol, mem upload/download, mmu and cache debugging and dcache flushing debugging of specific layer routines via 'set mpcbdm_verbose 0xXX' (see mpcbdm.h for VERBOSE_XXX, nice is 0x8 for MMU debugging)----------------------------------------------------------------New features in version 1.2: supporting 8,16 and 32 bit wide FLASH over layered routines new layered PORT routines (try 'mp port') better reattach strategy----------------------------------------------------------------Bugs: segmentation faults on running object files without main() no user guide yet ;-)----------------------------------------------------------------Have fun! Frank
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -