PPCBug Firmware Package User's Manual Part 1 And 2 PPCBUGA1 A2_UM5_Feb2001 A2 UM5 Feb2001
PPCBUGA1-A2_UM5_Feb2001 PPCBUGA1-A2_UM5_Feb2001
User Manual: PPCBUGA1-A2_UM5_Feb2001
Open the PDF directly: View PDF .
Page Count: 508
Download | |
Open PDF In Browser | View PDF |
PPCBug Firmware Package User’s Manual Part 1 and 2 PPCBUGA1/UM5 and PPCBUGA2/UM5 February 2001 Edition © Copyright 2001 Motorola, Inc. All rights reserved. Printed in the United States of America. Motorola® and the Motorola symbol are registered trademarks of Motorola, Inc. PowerPC™ is a trademark of IBM, and is used by Motorola with permission. AIXTM is a trademark of IBM Corp. All other products mentioned in this document are trademarks or registered trademarks of their respective holders. Safety Summary The following general safety precautions must be observed during all phases of operation, service, and repair of this equipment. Failure to comply with these precautions or with specific warnings elsewhere in this manual could result in personal injury or damage to the equipment. The safety precautions listed below represent warnings of certain dangers of which Motorola is aware. You, as the user of the product, should follow these warnings and all other safety precautions necessary for the safe operation of the equipment in your operating environment. Ground the Instrument. To minimize shock hazard, the equipment chassis and enclosure must be connected to an electrical ground. If the equipment is supplied with a three-conductor AC power cable, the power cable must be plugged into an approved three-contact electrical outlet, with the grounding wire (green/yellow) reliably connected to an electrical ground (safety ground) at the power outlet. The power jack and mating plug of the power cable meet International Electrotechnical Commission (IEC) safety standards and local electrical regulatory codes. Do Not Operate in an Explosive Atmosphere. Do not operate the equipment in any explosive atmosphere such as in the presence of flammable gases or fumes. Operation of any electrical equipment in such an environment could result in an explosion and cause injury or damage. Keep Away From Live Circuits Inside the Equipment. Operating personnel must not remove equipment covers. Only Factory Authorized Service Personnel or other qualified service personnel may remove equipment covers for internal subassembly or component replacement or any internal adjustment. Service personnel should not replace components with power cable connected. Under certain conditions, dangerous voltages may exist even with the power cable removed. To avoid injuries, such personnel should always disconnect power and discharge circuits before touching components. Use Caution When Exposing or Handling a CRT. Breakage of a Cathode-Ray Tube (CRT) causes a high-velocity scattering of glass fragments (implosion). To prevent CRT implosion, do not handle the CRT and avoid rough handling or jarring of the equipment. Handling of a CRT should be done only by qualified service personnel using approved safety mask and gloves. Do Not Substitute Parts or Modify Equipment. Do not install substitute parts or perform any unauthorized modification of the equipment. Contact your local Motorola representative for service and repair to ensure that all safety features are maintained. Observe Warnings in Manual. Warnings, such as the example below, precede potentially dangerous procedures throughout this manual. Instructions contained in the warnings must be followed. You should also employ all other safety precautions which you deem necessary for the operation of the equipment in your operating environment. Warning To prevent serious injury or death from dangerous voltages, use extreme caution when handling, testing, and adjusting this equipment and its components. Notice While reasonable efforts have been made to assure the accuracy of this document, Motorola, Inc. assumes no liability resulting from any omissions in this document, or from the use of the information obtained therein. Motorola reserves the right to revise this document and to make changes from time to time in the content hereof without obligation of Motorola to notify any person of such revision or changes. Electronic versions of this material may be read online, downloaded for personal use, or referenced in another document as a URL to the Motorola Computer Group website. The text itself may not be published commercially in print or electronic form, edited, translated, or otherwise altered without the permission of Motorola, Inc. It is possible that this publication may contain reference to or information about Motorola products (machines and programs), programming, or services that are not available in your country. Such references or information must not be construed to mean that Motorola intends to announce such Motorola products, programming, or services in your country. Limited and Restricted Rights Legend If the documentation contained herein is supplied, directly or indirectly, to the U.S. Government, the following notice shall apply unless otherwise agreed to in writing by Motorola, Inc. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (b)(3) of the Rights in Technical Data clause at DFARS 252.227-7013 (Nov. 1995) and of the Rights in Noncommercial Computer Software and Documentation clause at DFARS 252.227-7014 (Jun. 1995). Motorola, Inc. Computer Group 2900 South Diablo Way Tempe, Arizona 85282 Contents About This Manual Summary of Changes .................................................................................................xvi Overview of Contents ................................................................................................xvi Comments and Suggestions .....................................................................................xviii Conventions Used in This Manual...........................................................................xviii CHAPTER 1 General Information PPCBug Overview .....................................................................................................1-1 Comparison with other Motorola Bugs......................................................................1-2 PPCBug Implementation ...........................................................................................1-2 Memory Requirements...............................................................................................1-3 Size and Address Requirements for NVRAM....................................................1-3 Set-up .........................................................................................................................1-3 Start-up.......................................................................................................................1-4 MPU, Hardware, and Firmware Initialization ....................................................1-5 LED/Serial Startup Diagnostic Codes .........................................................1-7 Running the Diagnostics and Debugger ..................................................................1-12 Auto Boot.................................................................................................................1-13 ROMboot .................................................................................................................1-14 Sample ROMboot Routine................................................................................1-16 Network Auto Boot..................................................................................................1-18 Restarting the System ..............................................................................................1-19 Reset..................................................................................................................1-19 Abort .................................................................................................................1-19 Reset/Abort .......................................................................................................1-20 Break.................................................................................................................1-20 Board Failure ....................................................................................................1-21 SYSFAIL* Assertion and Negation (VMEbus Boards)............................1-21 MPU Clock Speed Calculation .........................................................................1-22 Disk I/O Support ......................................................................................................1-22 Blocks and Sectors............................................................................................1-23 Device Probe.....................................................................................................1-23 Disk I/O via Debugger Commands...................................................................1-24 IOI (Input/Output Inquiry).........................................................................1-24 v IOP (Physical I/O to Disk) ........................................................................ 1-24 IOT (I/O Configure) .................................................................................. 1-24 IOC (I/O Control)...................................................................................... 1-24 PBOOT (Bootstrap Operating System)..................................................... 1-25 Disk I/O via Debugger System Calls ............................................................... 1-26 Default PPCBug Controller and Device Parameters ........................................ 1-27 Disk I/O Error Codes........................................................................................ 1-27 Network I/O Support ............................................................................................. 1-28 Physical Layer Manager Ethernet Driver ......................................................... 1-28 UDP and IP Modules........................................................................................ 1-28 RARP and ARP Modules ................................................................................. 1-30 BOOTP Module ............................................................................................... 1-30 TFTP Module.................................................................................................... 1-30 Network Boot Control Module......................................................................... 1-30 Network I/O Error Codes ................................................................................. 1-31 Multiprocessor Support (Remote Start)................................................................... 1-31 Multiprocessor Control Register (MPCR) Method .......................................... 1-32 GCSR Method .................................................................................................. 1-35 Data and Address Sizes ........................................................................................... 1-37 Byte Ordering .......................................................................................................... 1-37 CHAPTER 2 Using the Debugger Entering Commands .................................................................................................. 2-1 Command Syntax ............................................................................................... 2-1 Command Arguments......................................................................................... 2-2 EXP ............................................................................................................. 2-2 ADDR ......................................................................................................... 2-4 PORT........................................................................................................... 2-6 Command Options.............................................................................................. 2-6 Control Characters.............................................................................................. 2-6 Entering and Debugging Programs............................................................................ 2-7 System Call Routines in User Programs.................................................................... 2-8 Preserving the Operating Environment ..................................................................... 2-8 Memory Requirements ....................................................................................... 2-9 Exception Vectors............................................................................................... 2-9 MPU Registers ................................................................................................. 2-10 MPU Register SPR275.............................................................................. 2-10 MPU Registers SPR272-SPR274.............................................................. 2-10 Context Switching ................................................................................................... 2-10 Floating Point Support............................................................................................. 2-12 vi Single Precision Real ........................................................................................2-13 Double Precision Real ......................................................................................2-13 Scientific Notation ............................................................................................2-14 CHAPTER 3 Debugger Commands Introduction................................................................................................................3-1 Debugger Commands.................................................................................................3-1 AS - One-Line Assembler...................................................................................3-5 BC - Block of Memory Compare .......................................................................3-6 BF - Block of Memory Fill .................................................................................3-8 BI - Block of Memory Initialize .......................................................................3-11 BM - Block of Memory Move..........................................................................3-13 BR - Breakpoint Insert NOBR - Breakpoint Delete...............................................................................3-16 BS - Block of Memory Search..........................................................................3-18 BV - Block of Memory Verify ..........................................................................3-23 CACHE - Cache Control ..................................................................................3-26 CM - Concurrent Mode NOCM - No Concurrent Mode.........................................................................3-27 CNFG - Configure Board Information Block...................................................3-31 CS - Checksum .................................................................................................3-35 CSAR - PCI Configuration Space READ Access ............................................3-37 CSAW - PCI Configuration Space WRITE Access..........................................3-38 DC - Data Conversion.......................................................................................3-39 DMA - Block of Memory Move.......................................................................3-42 DS - One-Line Disassembler ............................................................................3-49 DU - Dump S-Records......................................................................................3-50 ECHO - Echo String .........................................................................................3-52 ENV - Set Environment....................................................................................3-54 FORK - Fork Idle MPU at Address ..................................................................3-59 FORKWR - Fork Idle MPU with Registers......................................................3-60 GD - Go Direct (Ignore Breakpoints) ...............................................................3-61 GEVBOOT - Global Environment Variable Boot ............................................3-63 GEVDEL - Global Environment Variable Delete.............................................3-69 GEVDUMP - Global Environment Variable(s) Dump .....................................3-70 GEVEDIT - Global Environment Variable Edit ...............................................3-72 GEVINIT - Global Environment Variable Initialization ..................................3-73 GEVSHOW - Global Environment Variable(s) Display ..................................3-74 GN - Go to Next Instruction .............................................................................3-75 G, GO - Go Execute User Program ..................................................................3-77 vii GT - Go to Temporary Breakpoint ................................................................... 3-80 HE - Help.......................................................................................................... 3-83 IBM - Indirect Block Move.............................................................................. 3-86 IDLE - Idle Master MPU.................................................................................. 3-88 IOC - I/O Control for Disk ............................................................................... 3-89 IOI - I/O Inquiry ............................................................................................... 3-92 IOP - I/O Physical (Direct Disk Access).......................................................... 3-95 IOT - I/O Configure Disk Controller ............................................................. 3-101 IRD, IRM, IRS - Idle MPU Register Display/Modify/Set ............................. 3-109 LO - Load S-Records from Host .................................................................... 3-110 MA - Macro Define/Display NOMA - Macro Delete................................................................................... 3-115 MAE - Macro Edit.......................................................................................... 3-118 MAL - Enable Macro Listing NOMAL - Disable Macro Listing .................................................................. 3-120 MAR - Load Macros ...................................................................................... 3-121 MAW - Save Macros ...................................................................................... 3-123 MD, MDS - Memory Display ........................................................................ 3-125 MENU - System Menu................................................................................... 3-129 M, MM - Memory Modify ............................................................................. 3-130 MMD - Memory Map Diagnostic .................................................................. 3-134 MMGR - Memory Manager ........................................................................... 3-136 MS - Memory Set ........................................................................................... 3-140 MW - Memory Write...................................................................................... 3-141 NAB - Network Auto Boot ............................................................................ 3-143 NAP - NAP MPU ........................................................................................... 3-144 NBH - Network Boot Operating System, Halt............................................... 3-145 NBO - Network Boot Operating System........................................................ 3-147 NIOC - Network I/O Control ......................................................................... 3-151 NIOP - Network I/O Physical ........................................................................ 3-157 NIOT - Network I/O Teach (Configuration) .................................................. 3-161 NPING - Network Ping .................................................................................. 3-168 OF - Offset Registers Display/Modify ........................................................... 3-170 PA - Printer Attach NOPA - Printer Detach ................................................................................... 3-173 PBOOT - Bootstrap Operating System .......................................................... 3-175 PF - Port Format NOPF - Port Detach ....................................................................................... 3-183 PFLASH - Program FLASH Memory............................................................ 3-188 PS - Put RTC into Power Save Mode............................................................. 3-192 RB - ROMboot Enable NORB - ROMboot Disable ............................................................................ 3-193 viii RD - Register Display.....................................................................................3-195 REMOTE - Remote ........................................................................................3-201 RESET - Cold/Warm Reset ............................................................................3-202 RL - Read Loop ..............................................................................................3-204 RM - Register Modify.....................................................................................3-205 RS - Register Set.............................................................................................3-208 RUN - MPU Execution/Status ........................................................................3-210 SD - Switch Directories ..................................................................................3-212 SET - Set Time and Date ................................................................................3-213 SROM - SROM Examine/Modify ..................................................................3-214 SYM - Symbol Table Attach NOSYM - Symbol Table Detach ....................................................................3-218 SYMS - Symbol Table Display/Search ..........................................................3-221 T - Trace..........................................................................................................3-223 TA - Terminal Attach ......................................................................................3-227 TIME - Display Time and Date ......................................................................3-228 TM - Transparent Mode..................................................................................3-229 TT - Trace to Temporary Breakpoint..............................................................3-231 VE - Verify S-Records Against Memory ........................................................3-234 VER - Revision/Version Display ....................................................................3-238 WL - Write Loop ............................................................................................3-242 CHAPTER 4 One-Line Assembler/ Disassembler Introduction................................................................................................................4-1 PowerPC Assembly Language...................................................................................4-1 Machine-Instruction Operation Codes................................................................4-2 Directives ............................................................................................................4-2 Comparison with the Standard Assembler.................................................................4-2 Source Program Coding .............................................................................................4-3 Source Line Format ............................................................................................4-3 Operation Field ............................................................................................4-3 Operand Field ..............................................................................................4-4 Disassembled Source Line...........................................................................4-4 Mnemonics and Delimiters..........................................................................4-4 Instructions ..................................................................................................4-6 Character Set................................................................................................4-7 Addressing Modes ..............................................................................................4-8 WORD Define Constant Directive .....................................................................4-9 SYSCALL System Call Directive ....................................................................4-10 Entering and Modifying Source Programs ..............................................................4-11 ix Invoking the Assembler/Disassembler ............................................................. 4-11 Entering a Source Line ..................................................................................... 4-12 Entering Branch Operands ............................................................................... 4-13 Assembler Output/Program Listings ................................................................ 4-13 Assembler Error Messages ............................................................................... 4-14 CHAPTER 5 System Calls Introduction ............................................................................................................... 5-1 Invoking System Calls........................................................................................ 5-1 String Formats for I/O ........................................................................................ 5-2 System Call Routines................................................................................................. 5-2 .INCHR .............................................................................................................. 5-7 .INSTAT ............................................................................................................ 5-8 .INLN ................................................................................................................. 5-9 .READSTR ..................................................................................................... 5-10 .READLN ....................................................................................................... 5-12 .CHKBRK ....................................................................................................... 5-13 .DSKRD .DSKWR .......................................................................................................... 5-14 .DSKCFIG ....................................................................................................... 5-17 Configuration Area Block CFGA Fields................................................... 5-22 .DSKFMT ....................................................................................................... 5-27 .DSKCTRL ...................................................................................................... 5-30 .NETRD .NETWR .......................................................................................................... 5-32 .NETCFIG ...................................................................................................... 5-34 .NETFOPN ...................................................................................................... 5-40 .NETFRD ........................................................................................................ 5-42 .NETCTRL....................................................................................................... 5-44 .OUTCHR ....................................................................................................... 5-47 .OUTSTR .OUTLN .......................................................................................................... 5-48 .WRITE .WRITELN ...................................................................................................... 5-49 .PCRLF ........................................................................................................... 5-50 .ERASLN ........................................................................................................ 5-51 .WRITD .WRITDLN ...................................................................................................... 5-52 .SNDBRK ....................................................................................................... 5-54 .DELAY .......................................................................................................... 5-55 .RTC_TM ........................................................................................................ 5-56 x .RTC_DT .........................................................................................................5-57 .RTC_DSP .......................................................................................................5-58 .RTC_RD .........................................................................................................5-59 .REDIR ............................................................................................................5-60 .REDIR_I .REDIR_O ........................................................................................................5-61 .RETURN ........................................................................................................5-62 .BINDEC ..........................................................................................................5-63 .CHANGEV .....................................................................................................5-64 .STRCMP ........................................................................................................5-65 .MULU32 ........................................................................................................5-66 .DIVU32 ..........................................................................................................5-67 .CHK_SUM .....................................................................................................5-68 .BRD_ID ..........................................................................................................5-69 .ENVIRON ......................................................................................................5-72 .PFLASH Function ..........................................................................................5-76 .DIAGFCN .......................................................................................................5-79 .SIOPEPS ........................................................................................................5-91 .FORKMPU Function.......................................................................................5-93 .FORKMPUR Function....................................................................................5-94 .IDLEMPU Function .......................................................................................5-99 .IOINQ ...........................................................................................................5-100 .IOINFORM ..................................................................................................5-105 .IOCONFIG ...................................................................................................5-107 .IODELETE ...................................................................................................5-108 .SYMBOLTA .................................................................................................5-110 .SYMBOLTD ................................................................................................5-112 APPENDIX A Related Documentation Motorola Computer Group Documents ....................................................................A-1 Microprocessor and Controller Documents ..............................................................A-3 Related Specifications...............................................................................................A-9 APPENDIX B System Menu Introduction............................................................................................................... B-1 Menu Items ............................................................................................................... B-1 Continue System Start-up .................................................................................. B-1 Select Alternate Boot Device............................................................................. B-1 Go to System Diagnostics.................................................................................. B-2 xi Initiate Service Call ........................................................................................... B-2 Display System Test Errors ............................................................................... B-2 Dump Memory to Tape ..................................................................................... B-2 Using the Service Call Function ............................................................................... B-5 Operation ........................................................................................................... B-5 Sending Messages ...................................................................................... B-7 Concurrent Mode ....................................................................................... B-7 Terminating the Conversation and Concurrent Modes .............................. B-8 Manual Connection ........................................................................................... B-9 Terminal Connection ....................................................................................... B-10 APPENDIX C PPCBug Messages Introduction .............................................................................................................. C-1 Error Messages ......................................................................................................... C-2 Other Messages......................................................................................................... C-3 APPENDIX D S-Record Format Introduction .............................................................................................................. D-1 S-Record Content ..................................................................................................... D-1 S-Record Types......................................................................................................... D-2 Creating S-Records................................................................................................... D-3 Example .................................................................................................................... D-4 APPENDIX E Disk and Tape Controllers Disk and Tape Support ..............................................................................................E-1 Floppy Drive Configuration Parameters....................................................................E-2 APPENDIX F Disk Status Codes Introduction ...............................................................................................................F-1 SCSI....................................................................................................................F-1 ATA (Hard Disks/CD-ROM Drives) ..................................................................F-2 ATAPI (CD-ROM Drives)..................................................................................F-2 Controller-Independent Status Codes ........................................................................F-3 SCSI Firmware Status Codes ....................................................................................F-3 ATA/ATAPI Firmware Status Codes .........................................................................F-6 xii APPENDIX G Establishing Network Connections with PPCBug APPENDIX H Network Communication Status Codes xiii xiv List of Figures Figure 1-1. Network Boot Modules .........................................................................1-29 Figure 3-1. Boot Record ........................................................................................3-177 Figure 3-2. PowerPC Reference Platform Partition Table Entry ...........................3-178 Figure 3-3. Layout of the $41-Type Partition ........................................................3-179 xv xvi List of Tables Table 1-1. LED/Serial Startup Diagnostic Codes ......................................................1-8 Table 1-2. MPCR Method Remote Start Register Model ........................................1-33 Table 1-3. GCSR Method Remote Start Register Model.........................................1-35 Table 1-4. LM/SIG Register Bit Assignments .........................................................1-36 Table 3-1. Debugger Commands ...............................................................................3-1 Table 5-1. System Call Routines -- Hex Code Order.................................................5-2 Table 5-2. System Call Routines -- Alphabetical Order ............................................5-4 Table 5-3. Disk Packet Parameters ..........................................................................5-20 Table 5-4. IOSATM Fields (CFGA) ........................................................................5-22 Table 5-5. IOSPRM Fields (CFGA) ........................................................................5-23 Table 5-6. IOSEPRM Fields (CFGA) ......................................................................5-23 Table 5-7. IOSATW Fields (CFGA) ........................................................................5-24 Table 5-8. CFGA Fields ...........................................................................................5-25 Table A-1. Motorola Computer Group Documents .................................................A-1 Table A-2. Microprocessor and Controller Documents ...........................................A-3 Table A-3. Related Specifications ...........................................................................A-9 Table C-1. Debugger Error Messages ...................................................................... C-2 Table C-2. Other Messages ...................................................................................... C-3 Table D-1. S-Record Fields .....................................................................................D-1 Table E-1. Disk and Tape Controllers Supported .................................................... E-1 Table E-2. Floppy Drive Configuration Parameters ................................................ E-2 Table F-1. Controller-Independent Status Codes ..................................................... F-3 Table F-2. SCSI Firmware Status Codes ................................................................. F-4 Table F-3. ATA/ATAPI Controller-Dependent Errors ............................................ F-7 Table H-1. Controller-Independent Status Codes ....................................................H-1 Table H-2. DEC21040/21140/21143 Controller Status Codes ................................H-2 Table H-3. Intel 82559/ER Controller Status Codes................................................H-3 xvii xviii About This Manual The PPCBug Firmware Package User’s Manual provides information on the PPCBug firmware, the start-up and boot routines, the debugger commands, the one-line assembler/disassembler, and the debugger system calls. Information in this manual applies to Motorola PowerPC™-based boards that use PPCBug as its resident debugger program. The majority of Motorola’s PowerPC™-based boards including most VME, CompactPCI and ATX form factors are equipped with PPCBug. This document is bound in two parts: Part 1 (PPCBUGA1/UM5) contains the Table of Contents, List of Figures, and List of Tables for Chapters 1 through 3, Chapters 1 through 3 and the Index. Part 2 (PPCBUGA2/UM5) contains the Table of Contents and List of Tables for Chapters 4 and 5 and Appendices A through H, and Chapters 4 and 5, Appendixes A through H, and the Index. The diagnostics are covered in the PPCBug Diagnostics Manual (PPCDIAA/UM). xix Summary of Changes This is the fifth edition of the PPCbug Firmware Package User’s Manual. It supersedes the fourth edition (UM4) and incorporates the following updates. Where Updated Description of Change Overall Change Most instances of PPC1Bug or PPC1 were changed to PPCxBug or PPCx to accommodate multiple versions of Bug, which have been released. Chapter 1 Since PPCBug resides on most PowerPC boards, specific boards are no longer listed at the beginning of this chapter. A correction was made to the starting address (from $03F80000 to $03F40000) of the example described in the section titled Memory Requirements on page 1-3. A second example for the size and address requirements of NVRAM was added in the sections titled Size and Address Requirements for NVRAM on page 1-3. New LED/Serial Startup Diagnostic codes were added to Table 1-1 on page 1-8. The section titled Multiprocessor Support (Remote Start) on page 1-31 was completely revised. Chapter 3 Several new commands were added (e.g., CACHE, IBM and MMGR), and several existing command descriptions were updated (e.g., ENV, NIOT, SROM, and TA). Appendix G The content was completely revised from the previous version of this manual. Appendix H Status codes were added for the 21143 and 82559ER controllers. Overview of Contents Chapter 1, General Information, provides an overview of PPCBug, memory requirements, an explanation of the start-up process, a "highlevel" list of what PPCBug checks, a list of the LED/Serial startup diagnostic codes, a brief explanation on how to run the Debugger and Diagnostics firmware interactively, an explanation of the auto boot xx process, an explanation of the ROMboot process, an explanation of the network auto boot process, an explanation on restarting the system, a description of the types of board failures, an explanation of the MPU clock speed calculation, a description of the disk I/O support, a description of the network I/O support, and an explanation of the multiprocessor support (remote start). Chapter 2, Using the Debugger, contains a series of explanations on the various aspects of Debugger use including such subjects as command syntax, command arguments, command options, control characters, entering and debugging programs, system call routines in user programs, preserving the operating environment, context switching, and floating point support. Chapter 3, Debugger Commands, a list of all current commands, and a detailed explanation of each command including command input and description. Chapter 4, One-Line Assembler/ Disassembler, describes a PPCBug tool that allows you to create, modify and debug code written in PowerPC assembly language. Chapter 5, System Calls, describes the PPCBug System Call handler, which allows system calls from user programs. Appendix A, Related Documentation, lists related Motorola documentation, as well as other vendor documents and specifications. Appendix B, System Menu, describes each menu item within the PPCxBug> or PPCx-Diag> environment. Appendix C, PPCBug Messages, contains a series of tables listing all PPCBug messages and their meaning. Appendix D, S-Record Format, describes the purpose and use of the SRecord format. Appendix E, Disk and Tape Controllers, lists and describes the types of disk and tape controllers supported by PPCBug. Appendix F, Disk Status Codes, lists and describes the various disk status codes supported by PPCBug. xxi Appendix G, Establishing Network Connections with PPCBug, describes a procedure that can be used to establish a network connection using standard PPCBug commands from a PowerPC board with a compatible network connectivity device. Appendix H, Network Communication Status Codes, lists and describes two main types of network communication status codes: controller independent and controller dependent. Comments and Suggestions Motorola welcomes and appreciates your comments on its documentation. We want to know what you think about our manuals and how we can make them better. Mail comments to: Motorola Computer Group Reader Comments DW164 2900 S. Diablo Way Tempe, Arizona 85282 You can also submit comments to the following e-mail address: reader-comments@mcg.mot.com In all your correspondence, please list your name, position, and company. Be sure to include the title and part number of the manual and tell how you used it. Then tell us your feelings about its strengths and weaknesses and any recommendations for improvements. Conventions Used in This Manual The following typographical conventions are used in this document: bold is used for user input that you type just as it appears. Bold is also used for commands, options and arguments to commands, and names of programs, directories and files. italic xxii is used for names of variables to which you assign values. Italic is also used for comments in screen displays and examples, and to introduce new terms. courier is used for system output (for example, screen displays, reports), examples, and system prompts., or represents the carriage return or Enter key. CTRL represents the Control key. Execute control characters by pressing the Ctrl key and the letter simultaneously, for example, Ctrl-d. | separates two or more items from which to choose (one only) [] encloses an optional item that may not occur at all, or may occur once. {} encloses an optional item that may not occur at all, or may occur one or more times. A character precedes a data or address parameter to specify the numberic format, as follows (if not specified, the format is hexadecimal): $ dollar 0x Zero-x % percent a binary number. & ampersand a decimal number. a hexadecimal character. Data and address sizes are defined as follows: A byte is eight bits, numbered 0 through 7, with bit 0 being the least significant. xxiii A half-word is 16 bits, numbered 0 through 15, with bit 0 being the least significant. A word is 32 bits, numbered 0 through 31, with bit 0 being the least significant. The MPU on the PowerPC board is programmed to big-endian byte ordering. Any attempt to use little-endian byte ordering will immediately render the debugger unusable xxiv 1General Information 1 PPCBug Overview PPCBug is a powerful evaluation and debugging tool for systems built around the Motorola PowerPC microprocessors. PPCBug firmware consists of three parts: ❏ Command-driven user-interactive software debugger. It is hereafter referred to as the debugger, which is described in this manual. Debugging commands are available for loading and executing user programs under complete operator control for system evaluation. ❏ Command-driven diagnostic package for testing and troubleshooting the PowerPC board, which is hereafter called the diagnostics. Refer to the PPCBug Diagnostics Manual for information on the diagnostics and the diagnostics utilities and selftests. ❏ MPU, firmware, and hardware initialization routines, which are described in this manual. The PPCBug firmware is implemented on most Motorola PowerPC-based products: A PMCspan board added to any main board also interfaces with PPCBug. They are collectively referred to in this manual as the PowerPC board or board. The debugger includes: ❏ Commands for display and modification of memory ❏ Breakpoint and tracing capabilities ❏ Assembler and disassembler useful for patching programs Various PPCBug routines that handle I/O, data conversion, and string functions are available to user programs through the System Call handler. 1-1 1 General Information Because PPCBug is command-driven, it performs its various operations in response to user commands entered at the keyboard. Comparison with other Motorola Bugs The PPCBug is similar to previous Motorola firmware packages (e.g., MVME147Bug, MVME167Bug, MVME187Bug), with differences due to microprocessor architectures. These differences are primarily reflected in the instruction mnemonics, register displays, addressing modes of the assembler/disassembler, and argument passing to the system calls. PPCBug Implementation PPCBug is written largely in the C programming language, providing benefits of portability and maintainability. Where necessary, the assembly language has been used in separately compiled program modules that deal with processor-specific issues. No mixed-language modules are used. Physically, PPCBug is contained in two socketed 32-pin PLCC Flash devices that together provide 1MB (256KB words) of storage. PPCBug uses the entire memory contained in the two devices. The executable code is checksummed at every power-on or reset firmware entry. The result is checked with a pre-calculated checksum contained in the last 16-bit word of the Flash image. ! Caution 1-2 Although a command to allow the erasing and reprogramming of this Flash memory is available to you, keep in mind that reprogramming any portion of Flash memory will erase everything currently contained in Flash, including PPCBug. Computer Group Literature Center Web Site Memory Requirements Memory Requirements The debugger requires approximately 768KB of read/write memory (i.e., DRAM). The debugger allocates this memory from the top, down. For example, on a system which contains 64MB ($04000000) of read/write memory, the debugger’s memory page will be located at $03F40000 to $03FFFFFF. Size and Address Requirements for NVRAM Currently, Motorola uses the SGS-Thompson Timekeeper SRAM device (48T559, or M48T35), or equivalent. This is used on the PowerPlus boards and is structured by the Debugger as follows: Example 1: NVRAM = 8192 bytes total size (with rtc): Size/Area Offset 5880 bytes user area 0000 - 16f7 2048 bytes debugger area 16f8 - 1ef7 256 bytes configuration area 1ef8 - 1ff7 8 bytes real time clock registers 1ff8 - 1fff Example 2: NVRAM = 32768 bytes total size Size/Area Offset 30456 bytes user area 0000 - 76f7 2048 bytes debugger area 76f8 - 7ef7 256 bytes configuration area 7ef8 - 7ff7 8 bytes real time clock registers 7ff8 - 7fff Set-up Refer to the board installation and use manual for information on installing the hardware, configuring jumpers, and assigning the console monitor. http://www.motorola.com/computer/literature 1-3 1 1 General Information Start-up At either power-up or system reset, PPCBug performs the MPU, hardware, and firmware initialization process (refer to MPU, Hardware, and Firmware Initialization on page 1-5). This process includes a checksum of the FLASH memory contents. The following types of messages are displayed on the firmware console during the initialization process: Copyright Motorola Inc. 1988 - 1997, All Rights Reserved PPCx Debugger/Diagnostics Release Version 4.x - xx/xx/xx/RMxx COLDStart Local Memory Found =04000000 (&67108864) MPU Clock Speed =167Mhz BUS Clock Speed =67Mhz Reset Vector Location : Mezzanine Configuration: Current 60X-Bus Master : Idle MPU(s) : ROM Bank B Single-MPU MPU0 NONE System Memory: 64MB, ECC Enabled (ECC-Memory Detected) L2 Cache: NONE PPCx-Bug> At this point, PPCBug is waiting for you to enter one of the commands described in Chapter 3, of this manual. PPCBug may alternatively be configured via the ENV command to run selftest and/or autoboot automatically during startup. If so, then PPCBug will instead behave as follows: The system pauses five seconds, during which you may terminate start-up, and exit to the diagnostics prompt, by pressing ESC or the Break key. The system performs the self test diagnostics if you do not terminate system start-up. Upon successful completion of these tests, the system pauses another five seconds. You may terminate start-up, and exit to the diagnostics prompt, by pressing ESC or the Break key. 1-4 Computer Group Literature Center Web Site Start-up If you do not terminate system start-up, the system begins the boot routine that has been set up in the ENV command, either NVRAM Boot List Boot, Auto Boot, ROMboot, or Network Auto Boot. If the self-tests fail, various error messages appear, and the diagnostics prompt appears. Refer to Chapter 3, for information on setting the ENV command parameters. MPU, Hardware, and Firmware Initialization The MPU, hardware, and firmware initialization process is performed by the PPCBug power-up or system reset. The steps below are a high-level outline; not all of the detailed steps are listed. 1. Set MPU.MSR to known value. 2. Invalidate the MPU’s data/instruction caches. 3. Clear all segment registers of the MPU. 4. Clear all block address translation registers of the MPU. 5. For “dual CPU only” boards (MVME460x or MTX), catch one CPU of a dual CPU and place it in a waiting loop. 6. Initialize the MPU bus to PCI bus bridge device. 7. Initialize the PCI bus to ISA bus bridge device. 8. Calculate the external bus clock speed of the MPU. 9. Delay for 750 milliseconds. 10. Determine the CPU board type. 11. Size the local read/write memory (i.e., DRAM). 12. Initialize the read/write memory controller. 13. Set base address of memory to $00000000. 14. Retrieve the speed of read/write memory. http://www.motorola.com/computer/literature 1-5 1 1 General Information 15. Initialize read/write memory controller with the speed of read/write memory. 16. Retrieve the speed of read only memory (Flash). 17. Initialize read only memory controller with the speed of read only memory. 18. Enable the MPU’s instruction cache. 19. Copy the MPU’s exception vector table from $FFF00000 to $00000000. 20. Initialize the SIO (PC87303/PC87307/PC87308) resources’ base addresses for boards that have the SIO device. 21. Initialize the Z8536 device if the board has the device. 22. Verify MPU type. 23. Enable the super-scalar feature of the MPU (boards with MPC604type chips only). 24. Initialize the Keyboard Controller (PC87303/PC87307/PC87308) for boards that have the device. 25. Determine the debugger’s Console/Host ports, and initialize the appropriate UART or Graphic devices. 26. Display the debugger’s copyright message. 27. Display any hardware initialization errors that may have occurred. 28. Checksum the debugger object, and display a warning message if the checksum failed to verify. 29. Display the amount of local read/write memory found. 30. Verify the configuration data that is resident in NVRAM, and display a warning message if the verification failed. 31. Calculate and display the MPU clock speed. Verify that the MPU clock speed matches the configuration data, and display a warning message if the verification fails. 1-6 Computer Group Literature Center Web Site Start-up 32. Display the BUS clock speed. Verify that the BUS clock speed matches the configuration data, and display a warning message if the verification fails. 33. For boards that have a Keyboard Controller display initialization errors that have occurred. 34. Probe PCI bus for supported Network devices. 35. Probe PCI bus for supported Mass Storage devices. 36. Initialize the memory/IO addresses for the supported PCI bus devices. 37. Execute self-test, if configured. 38. Extinguish the board fail LED, if there are no self-test failures or initialization/configuration errors. 39. Execute the configured boot routine, either ROMboot, Autoboot, or Network Autoboot. (PowerPlus architecture boards do not execute a configured boot routine.) 40. Execute the user interface (i.e., the PPCx-Bug> or PPCx-Diag> prompt). LED/Serial Startup Diagnostic Codes These codes are displayed on seven-segment LEDs at key points in the initialization of the hardware devices. Should the debugger fail to come up to a prompt, the last code displayed will indicate how far the initialization sequence had progressed before stalling. The serial port version of the startup codes is enabled by an ENV parameter: Serial Startup Code Master Enable [Y/N]=N? Under normal conditions, the startup sequence begins at 0x1100 and continues to the PPC1-Bug> prompt just after 0x11D4. RAM initialization problems may cause the startup sequence to terminate at the: (RawBug) prompt just after 0x11D8 instead. http://www.motorola.com/computer/literature 1-7 1 1 General Information The operating system boot sequence begins at 0x11E0 with the creation of residual data and continues to 0x11EC just before execution is passed to the boot image. The OS may have its own LED codes which are displayed after 0x11EC. A line feed can be inserted after each serial code is displayed to prevent it from being overwritten by the next code. This is also enabled by an ENV parameter: Serial Startup Code LF Enable [Y/N]=N? The following firmware codes are always sent to 7-segment LEDs located at ISA I/O address 0x8C0. These codes can also be sent to the debugger serial port if the ENV parameter “Serial Startup Code Master Enable” is set to ‘Y’. The list of LED/serial codes follows. Table 1-1. LED/Serial Startup Diagnostic Codes Code (Hex) 1-8 Location in Startup 1100 Setting up MSR (startup begins) 1102 Invalidating caches 1104 Determining ROM or RAM execution mode 1106 Setting up machine state register 1108 Setting up CPU’s address translation registers 110A Setting up CPU’s address translation table 110C Shutting down redundant processors 110D Init I/O path out to serial port 110E Initializing super I/O chip (CPU initialization completed) 110F Enable ISA bus access 1110 Initializing raw I/O device 1111 Initialize early stack memory 1112 Getting PHB (PCI Host Bridge) Table Pointer 1113 Disable all caches 1114 Initializing PCI bridge 1116 Initializing the powerup flag indicator 1118 Calculating the speed of the processor bus Computer Group Literature Center Web Site Start-up Table 1-1. LED/Serial Startup Diagnostic Codes (Continued) Code (Hex) Location in Startup 111A Waiting for hardware to initialize memory 111C Setting up the DRAM init parameters 111E Initializing DRAM in bridge/memory controller 1120 Setting up debugger memory page area 1122 Calculating and setting DRAM speed 1124 Calculating and setting ROM speed 1126 Enabling instruction cache 1128 Setting up debugger memory page tables 112A Setting up debugger kernel pointers and saving registers 112B Setup the exception control description 112C Setting up buginit section pointers and runtime variables 1130 Retrieving the processor board type 1132 Initializing the Z8536 1134 Initializing local board status 1136 Retrieving the base board type 1138 Checking the level of the ABORT push-button 113A Initializing the interrupt/timer controller 113C Retrieving MPU identifier 113E Enabling super-scalar modes 1140 Adding processor-specific work-arounds 1142 Getting the bus clock speed 1144 Initializing the keyboard controller 1145 Probe for PCI functions 1146 Initializing the PCI interrupt route control registers 1148 Starting PCI hierarchy configuration process 12nn Probing PCI config space (nn = bbbddddd; bbb = bus#, ddddd = dev# 1149 Allocating PCI I/O & memory space and initializing PCI devices. http://www.motorola.com/computer/literature 1-9 1 1 General Information Table 1-1. LED/Serial Startup Diagnostic Codes (Continued) Code (Hex) 1-10 Location in Startup 114A Initializing RAVEN PCI space 114C Initializing RAVEN time base registers 114D Initialize RAVEN interrupt controller 114E Initializing FALCON ROM 1150 Initializing VME bridge 1152 Initializing ISA bridge 1154 Sending speaker beep 1160 Checking abort switch state 1162 Initializing exception handling 1164 Initializing board identifier structure 1166 Initializing point break table 1168 Initializing macro subsystem 116A Initializing configuration data area 116C Initializing board information data area 116E Initializing I/O (character) subsystem 1170 Initializing register file 1172 Getting bridge pointer 1174 Setting up local memory pointers 1176 Setting up local memory size variables 1178 Displaying sign-on messages 117A displaying board initialization errors 117C Verifying the ROM checksum 117E Displaying memory size and misc errors 1180 Displaying MPU clock speed 1182 Verifying MPU clock speed 1184 Displaying bus clock speed 1186 Initializing network I/O subsystem Computer Group Literature Center Web Site Start-up Table 1-1. LED/Serial Startup Diagnostic Codes (Continued) Code (Hex) Location in Startup 1188 Initializing disk I/O subsystem 118A Initializing direction flags 118C Initializing NVRAM (PReP) environment 118E Initializing residual data pointer 1190 Initializing input/output pointers 1192 Initializing diagnostic subsystem 1194 Setting up special init section pointers and runtime variables 1196 Initializing abort switch 1198 Setting up board suffix and return environment 11A0 Retrieving the processor board type 11A2 Displaying memory warning and MPU configuration 11A4 Clearing MPU idle semaphores 11A6 Waiting for MPU logins 11A8 Displaying MPU status information 11AA Setting up DRAM and bridge pointers 11AC Initializing DRAM ECC/parity 11AE Displaying DRAM information 11B0 Setting up misc. L2 cache variables 11B2 Setting up L2 cache size variables 11B4 Initializing and flushing L2 cache data parity 11B6 Displaying L2 cache parity state 11B8 Reading NVRAM contents 11BA Verifying NVRAM header 11BC Initializing NVRAM contents 11BE Retrieving global environment variable pointers 11D0 Initializing processor timebase/decrementer registers 11D2 Enabling interrupts http://www.motorola.com/computer/literature 1-11 1 1 General Information Table 1-1. LED/Serial Startup Diagnostic Codes (Continued) Code (Hex) Location in Startup 11D4 Transferring control to monitor (initialization complete) 11D8 Error - dropping to RawBug 11E0 Initializing residual data structure 11E2 Adding vital product data 11E4 Adding processor information 11E6 Adding memory information 11E8 Adding PCI device information 11EA Adding ISA device information 11EC Residual data completed 12nn Probing PCI config space (board specific) Running the Diagnostics and Debugger In order to use the diagnostics, terminate the start-up process by pressing ESC or the Break key during one of the four pauses (PowerPlus architecture boards in their default configuration may not pause at any of the four places.) The diagnostics prompt (PPCx-Diag>) appears. You may switch to the debugger prompt (PPCx-Bug>) by using the SD command. Both the debugger and diagnostic commands are available from the diagnostic prompt. Only the debugger commands are available from the debugger prompt. You may view a list of the diagnostics or debugger commands by using the HE (Help) command. Note 1-12 Some diagnostics depend on restart defaults that are set up only in a particular restart mode. Refer to the PPCBug Diagnostics Manual, PPCDIAA/UM, for the correct mode. Computer Group Literature Center Web Site Auto Boot Refer to the PPCBug Diagnostics Manual for complete descriptions of the diagnostic routines available and instructions on how to invoke them. Auto Boot Note The PowerPlus architecture boards do not execute a configured boot routine. Auto Boot is the default boot routine. It provides an independent mechanism for booting an operating system. No console is required. Autoboot selects the boot device from either a scan list of device types, a floppy diskette, a CD-ROM, tape, or a hard disk. You may change the scan order, or configure Auto Boot to boot from a specific Controller Logical Unit Number (CLUN) and Device Logical Unit Number (DLUN) by changing the ENV command parameters for enabling Auto Boot (refer to Chapter 3, for information). At power-up, Auto Boot is enabled. The following message is displayed on the system console: Autoboot in progress... To abort hit Following this message there is a delay to allow you to abort the Auto Boot process and gain control. Press either the BREAK key or the software abort or reset switch to abort Autoboot. If you do not abort Auto Boot, the actual I/O is begun. The program pointed to within the boot-record of the media specified is loaded into RAM, and control is passed to it. Upon power-up or system reset, PPCBug examines the validity of the configuration parameters in NVRAM. If there is a configuration error (e.g., corrupted data or checksum error), the PPCBug will initialize the configuration parameters using default values, and run AutoBoot. Following the auto-initialization of the configuration parameters, the PPCBug will reset the system to allow a start-up with the now default configuration parameters. http://www.motorola.com/computer/literature 1-13 1 1 General Information ROMboot Note The PowerPlus architecture boards do not execute a configured boot routine. ROMboot is a mechanism for booting an operating system from a userdefined routine stored in ROM. ROMboot executes at power-up (or optionally at reset) if it is configured and enabled in parameters set with the ENV command. It may also be executed with the RB (ROMboot) command. Refer to Chapter 3, for information on setting the ENV command parameters for enabling ROMboot. For ROMboot to work, a ROMboot routine must be stored in the FLASH memory to support it. If ROMboot code is installed, a user-written routine is given control (if the routine meets the format requirements). One use of ROMboot might be resetting SYSFAIL* on an unintelligent controller board. The NORB command disables ROMboot. For a user’s ROMboot routine to gain control through the ROMboot linkage, four requirements must be met: ❏ Power must have just been applied (or at reset, if configured to do so with the ENV command). ❏ Your ROMboot routine must be stored within the PowerPC board FLASH memory map (or elsewhere in onboard memory, if configured to do so with the ENV command). ❏ The ASCII string “BOOT” must be located within the specified memory range. ❏ Your ROMboot routine must pass a checksum test, which ensures that this routine was really intended to receive control at power-up. When the module is ready, it can be loaded into RAM. Use the CS command to generate, install, and verify the checksum. 1-14 Computer Group Literature Center Web Site ROMboot The format of the beginning of the routine is: Offset Length Contents Description $00 4 bytes BOOT ASCII string indicating possible routine; the checksum must be valid $04 4 bytes Entry Address Word offset from “BOOT” $08 4 bytes Routine Length Word; includes length from “BOOT” to and including a twobyte checksum $0C Length of name Routine name ASCII string containing routine name If you want to make use of ROMboot, you do not have to fill a complete FLASH device. Any partial amount is acceptable, as long as: ❏ The identifier string “BOOT” starts on a word (FLASH and Direct spaces) or 8KB (local RAM and VMEbus spaces) boundary. ❏ The ROMboot routine size (in bytes) is evenly divisible by 2. ❏ The length parameter (offset $8) reflects where the checksum is, and the checksum is correct. ROMboot searches predefined areas of the memory map for possible routines and checks for the “BOOT” indicator. Two events are of interest for any location being tested: ❏ The map is searched for the ASCII string “BOOT”. ❏ If the ASCII string “BOOT” is found, it is still undetermined whether the routine is meant to gain control at power-up or reset. To verify that this is the case, the bytes starting from “BOOT” through the end of the routine, excluding the two byte checksum, are run through the debugger checksum algorithm. If the result of the checksum is equal to the final two bytes of the ROMboot routine (the checksum), it is established that the routine was meant to be used for ROMboot. Under control of the ENV command, the sequence of searches is as follows: http://www.motorola.com/computer/literature 1-15 1 1 General Information 1. Search direct address for “BOOT”. The direct address points to an installed ROMboot routine. It is a variable that may be set using the ENV command. 2. Search complete ROM map. 3. Search local RAM, at all 8KB boundaries starting at the beginning of local RAM. 4. Search the VMEbus map (if so selected by the ENV command) on all 8KB boundaries starting at the end of the onboard RAM. VMEbus address space is searched both below (if the start address of local RAM is not located at 0) and above local RAM up to the beginning of FLASH Space. Sample ROMboot Routine The example ROMboot routine performs the following: 1-16 ❏ Outputs a sequence to the default output port. ❏ Displays the date and time from the current cursor position. ❏ Outputs two more sequences to the default output port. ❏ Returns control to PPCBug. Computer Group Literature Center Web Site ROMboot Do the following to prepare the ROMboot routine (includes checksum calculation): 1. Assemble and link the code, leaving $00 in the even and odd locations destined to contain the checksum. 2. Load the routine into RAM (with S-records via the LO command, or from magnetic media using IOP). 3. Display entire ROMboot routine (checksum bytes are at $00010038 and $00010039). PPC1-Bug>MD 10000 :10 00010000 00010010 00010020 00010030 424F4F54 39400026 39400026 39400063 00000010 44000002 44000002 44000002 0000003A 39400052 39400026 0000FFFF 54455354 44000002 44000002 FFFFFFFF BOOT.......:TEST 9@.&D...9@.RD... 9@.&D...9@.&D... 9@.cD........... 4. Disassemble executable instructions. PPC1-Bug>MD 10010:5;DI 00010010 39400026 SYSCALL .PCRLF 00010018 39400052 SYSCALL .RTC_DSP 00010020 39400026 SYSCALL .PCRLF 00010028 39400026 SYSCALL .PCRLF 00010028 39400063 SYSCALL .RETURN 5. Perform checksum on locations $10000 through $10037 (refer to the CS command information in Chapter 3, ). PPC1-Bug>CS 10000:38/2;H Effective address: 00010000 Effective count : &56 Checksum: ACFA 6. Insert checksum into bytes $10038, $10039. PPC1-Bug>M 10038;H 00010038 0000? ACFA. 7. Display the entire ROMboot routine with checksums. PPC1-Bug>MD 10000 :10 00010000 424F4F54 00000010 0000003A 00010010 39400026 44000002 39400026 00010020 39400026 44000002 39400026 00010030 39400063 44000002 ACFAFFFF http://www.motorola.com/computer/literature 54455354 44000002 44000002 FFFFFFFF BOOT.......:TEST 9@.&D...9@.RD... 9@.&D...9@.&D... 9@.cD........... 1-17 1 1 General Information 8. Verify the functionality of the user ROMboot routine with the RB command. PPC1-Bug>RB; V ROMboot about to Begin... Press to Bypass, to Continue Direct Add: FFC00000 FFFFFFFC: Searching for ROMboot Module at: 00010000 Executing ROMboot Module “TEST” at 00010000 MON MAR 27 10:39:08.00 1995 PPC1-Bug> The sample ROMboot routine is now ready for use. Network Auto Boot Network Auto Boot (or Network Boot) is a software routine that provides a mechanism for booting an operating system using an Ethernet network as the boot device. Network Auto Boot executes at power-up (or optionally at reset) if it is configured and enabled in parameters set with the ENV command. This routine selects the boot device based on the Controller Logical Unit Number (CLUN) and Device Logical Unit Number (DLUN) which have been set in the ENV command. Refer to Chapter 3, for information on setting the ENV command parameters for enabling Network Auto Boot. If Network Boot is enabled, the following message is displayed on the system console at power-up: Network Boot in progress... To abort hit Following this message there is approximately a five-second delay before the actual I/O is begun. The program pointed to within the volume ID of the media specified is loaded into RAM and control is passed to it. During the delay, you can gain control without Network Autoboot by pressing either the BREAK key or the software abort or reset switches. 1-18 Computer Group Literature Center Web Site Restarting the System Network Autoboot is controlled by parameters contained in the NIOT and ENV commands. These parameters allow the selection of specific boot devices, systems, and files and allow programming of the boot delay. Refer to the NIOT and ENV commands in Chapter 3, for more details. Restarting the System You can initialize the system to a known state in three different ways: reset, abort, and break. Each has characteristics which make it more appropriate than the others in certain situations. Reset Pressing and releasing the board front panel RESET switch initiates a system reset. Cold and warm reset modes are available. By default, PPCBug is in cold mode (refer to the RESET command description in Chapter 3). During cold reset, a total system initialization takes place, as if the PowerPC board had just been powered up. All static variables are restored to their default states. The breakpoint table and offset registers are cleared. The target registers are invalidated. Input and output character queues are cleared. Onboard devices are reset, and the first two serial ports are reconfigured to their default state. During warm reset, the PPCBug variables and tables are preserved, as well as the target state registers and breakpoints. Reset must be used if the processor ever halts, or if the PPCBug environment is ever lost, such as if the vector table is destroyed, or the stack is corrupted. Abort Abort is invoked by pressing and releasing the ABORT switch. Whenever abort is invoked while executing a user program (running target code), a snapshot of the processor state is captured and stored in the target registers. (When working in the debugger, abort captures and stores only the Instruction Pointer, status register, and format and vector information.) For http://www.motorola.com/computer/literature 1-19 1 1 General Information this reason, abort is most appropriate when terminating a user program that is being debugged. Abort should be used to regain control if the program gets caught in a loop. The target IP and register contents help to pinpoint the malfunction. Pressing and releasing the ABORT switch generates a local board condition which interrupts the microprocessor. The target registers, reflecting the machine state at the time the abort switch was pressed, are displayed on the screen. Any breakpoints installed in the user code are removed, and the breakpoint table remains intact. Control is returned to the debugger. Reset/Abort You may wish to perform “double-button reset” by pressing the RESET and ABORT switches at the same time. Release RESET first, wait seven seconds, and then release ABORT. This resets all onboard devices, as well as sending a SYSRESET* signal if the board is the VMEbus system controller. It also ignores the parameters stored in NVRAM, and starts debugger execution with the same ENV parameters as if you had used the command ENV;D. Break A break is generated by pressing and releasing the BREAK key on the current-console keyboard. Break does not generate an interrupt. The only time break is recognized is when characters are sent or received by the console port. Break removes any breakpoints in the user code and keeps the breakpoint table intact. Break also takes a snapshot of the machine state if the function was entered using SYSCALL. This machine state is then accessible to you for diagnostic purposes. Many times it may be desirable to terminate a debugger command prior to its completion; for example, the display of a large block of memory. Break allows you to terminate the command. 1-20 Computer Group Literature Center Web Site Restarting the System Board Failure The following conditions result in a board failure. These conditions also give a WARNING message, if possible: ❏ Board initialization error/failure ❏ Debugger object checksum error ❏ Configuration data (NVRAM ENV parameters) failure (i.e., checksum) ❏ Configuration data (NVRAM CNFG parameters) failure (i.e., checksum) ❏ Calculated MPU clock speed does not match the associative CNFG parameter ❏ Calculated BUS clock speed does not match the associative CNFG parameter ❏ Selftest error/failure If the board is equipped with a board fail LED, the LED will be illuminated when a board failure occurs. SYSFAIL* Assertion and Negation (VMEbus Boards) On VMEbus boards, the board fail is the same as the SYSFAIL indicator. At reset or power-up, the debugger asserts the VMEbus SYSFAIL* line (refer to the VMEbus specification). The SYSFAIL* line is negated if debugger initialization is done and if none of the board failure conditions have occurred. However, SYSFAIL* stays asserted if any of the board failure conditions have occurred. In this way, the state of the debugger is indicated to the user or VMEbus masters. In a multi-computer configuration, other VMEbus masters could view the pertinent control and status registers to determine which CPU is asserting SYSFAIL* in the event of a board failure. SYSFAIL* assertion and negation is also affected by the ENV command (refer to the ENV command in Chapter 3, for more information). http://www.motorola.com/computer/literature 1-21 1 1 General Information Notes Assert indicates a signal is active or true. Negate indicates a signal is inactive or false. These terms are used independently of the voltage levels (high or low) that they represent. The asterisk (*) in the signal name SYSFAIL* denotes that the signal is true or valid when the it is low (SYSFAIL* is level sensitive). MPU Clock Speed Calculation The MPU clock speed is calculated and checked against the MPU clock speed parameter located in NVRAM, which you may set in the CNFG command. If the check fails, a warning message is displayed. The calculated clock speed is also checked against known clock speeds and tolerances. Refer to Chapter 3, for information on setting the CNFG command parameters. Disk I/O Support The debugger can initiate disk input and output by communicating with intelligent disk controllers over the PCI bus. Disk support facilities built into the debugger consist of command-level disk operations, disk I/O system calls (only via one of the system call instructions) for use by user programs, and defined data structures for disk parameters (refer to Chapter 5, System Calls for information on system calls). Parameters such as the address where the module is mapped and the type and number of devices attached to the controller module are kept in tables by PPCBug. Default values for these parameters are assigned at power-up and cold-start reset, but may be altered as described in Default PPCBug Controller and Device Parameters on page 1-27. You can obtain a list of supported controllers with the IOI command. Appendix E contains a list of the controllers presently supported, as well as a list of the default configurations for each controller. 1-22 Computer Group Literature Center Web Site Disk I/O Support Blocks and Sectors The logical block defines the unit of information for disk devices. A disk is viewed by PPCBug as a storage area divided into logical blocks. By default, the logical block size is set to 256 bytes for every block device in the system. The block size can be changed on a per device basis with the IOT command. The sector defines the unit of information for the media itself, as viewed by the controller. The sector size varies for different controllers, and the value for a specific device can be displayed and changed with the IOT command. When a disk transfer is requested, the start and size of the transfer is specified in blocks. PPCBug translates this into an equivalent sector specification, which is then passed on to the controller to initiate the transfer. If the conversion from blocks to sectors yields a fractional sector count, an error is returned and no data is transferred. Device Probe A device probe with entry into the device descriptor table is done whenever a specified device is accessed. This happens when system calls .DSKRD, .DSKWR, .DSKCFIG, .DSKFMT, and .DSKCTRL, and commands IOC, IOP, IOT, MAR, MAW, and PBOOT are used. The device probe mechanism utilizes the SCSI commands Inquiry and Mode Sense. If the specified controller is non-SCSI, the probe simply returns a status of device present and unknown. The device probe makes an entry into the device descriptor table with the pertinent data. After an entry has been made, the next time a probe is done it simply returns with device present status (pointer to the device descriptor). http://www.motorola.com/computer/literature 1-23 1 1 General Information Disk I/O via Debugger Commands The following debugger commands are provided for disk I/O. Refer to Chapter 3, for instructions for their use. When a command is issued to a particular controller LUN and device LUN, these LUNs are remembered in the debugger so that the next disk command uses the same controller and device. IOI (Input/Output Inquiry) The IOI command is used to probe the system for all possible CLUN/DLUN combinations and display inquiry data for devices which support it. The device descriptor table only has space for 16 device descriptors. With the IOI command, you can view the table and clear it if necessary. IOP (Physical I/O to Disk) ! Caution If you start the IOP format procedure, it must be allowed to complete (PPCxBug> prompt returns) or else the disk drive may be totally disabled. This format procedure may take as long as half an hour. The IOP command allows you to read or write blocks of data, or to format the specified device in a certain way. IOP creates a command packet from the arguments you specify, and then invokes the proper system call function to carry out the operation. IOT (I/O Configure) The IOT command allows you to change any configurable parameters and attributes of the device. In addition, it allows you to see the controllers available in the system. IOC (I/O Control) The IOC command allows you to send command packets as defined by the particular controller directly. IOC can also be used to look at the resultant device packet after using the IOP command. 1-24 Computer Group Literature Center Web Site Disk I/O Support PBOOT (Bootstrap Operating System) The PBOOT command reads an operating system or control program from the specified device into memory, and then transfers control to it. With the H option, PBOOT reads an operating system or control program from a specified device into memory, and then returns control to the debugger. http://www.motorola.com/computer/literature 1-25 1 1 General Information Disk I/O via Debugger System Calls All operations that actually access the disk are done directly or indirectly by debugger system calls. (The command-level disk operations provide a convenient way of using these system calls without writing and executing a program.) The following system calls are provided to allow user programs to do disk I/O: .DSKRD Disk read - system call to read blocks from a disk into memory .DSKWR Disk write - system call to write blocks from memory onto a disk .DSKCFIG Disk configure - system call to change the configuration of the specified device .DSKFMT Disk format - system call to send a format command to the specified device .DSKCTRL Disk control - system call to implement any special device control functions that cannot be accommodated easily with any of the other disk functions Refer to Chapter 5, System Calls for information on using these and other system calls. To perform a disk operation, the debugger must present a particular disk controller module with a controller command packet which has been prepared for the particular type of controller module. (This is accomplished in the respective controller driver module.) Typically, the command packets are different for each of the controller modules. The system call facilities which do disk I/O accept a generalized (controllerindependent) packet format as an argument, and translate it into a controller-specific packet, which is then sent to the specified device. Refer to the system call descriptions in Chapter 5, System Calls for details on the format and construction of these standardized user packets. The packets which a controller module expects to receive vary from controller to controller. The disk driver module for the particular board module must take the standardized packet given to a trap function and create a new packet which is specifically tailored for the disk drive 1-26 Computer Group Literature Center Web Site Disk I/O Support controller it is sent to. Refer to documentation on the particular controller module for the format of its packets. Refer to the IOC command section in Chapter 3, Debugger Commands for information on sending command packets. Default PPCBug Controller and Device Parameters PPCBug initializes the parameter tables for a default configuration of controllers (refer to Appendix E, Disk and Tape Controllers). If the system needs to be configured differently than this default configuration (for example, to use a different drive), then these tables must be changed. Use the IOT command to reconfigure the parameter table manually for any controller and/or device that is different from the default. This is a temporary change and is overwritten if a cold-start reset occurs. Disk I/O Error Codes PPCBug returns an error code if an attempted disk operation is unsuccessful. Refer to Appendix F, Disk Status Codes for an explanation of disk I/O error codes. http://www.motorola.com/computer/literature 1-27 1 1 General Information Network I/O Support The network autoboot firmware provides the capability to boot the CPU through the ROM debugger using a network (local Ethernet interface) as the boot device. The booting process is executed in two distinct phases. ❏ The first phase allows the diskless remote node to discover its network identify and the name of the file to be booted. ❏ The second phase has the diskless remote node reading the boot file across the network into its memory. Figure 1-1 on page 1-29 depicts the various modules (capabilities) and the dependencies of these modules that support the overall network boot function. They are described in the following paragraphs. Physical Layer Manager Ethernet Driver This driver surrounds and manages the Ethernet controller chip or module. Management includes the reception of packets, the transmission of packets, flushing of the receive buffer, and interface initialization. This module ensures that the packaging and unpackaging of Ethernet packets is done correctly in the Boot PROM. UDP and IP Modules The Internet Protocol (IP) is designed for use in interconnected systems of packet-switched computer communication networks. The Internet Protocol provides for transmitting blocks of data called datagrams (hence User Datagram Protocol, or UDP) from sources to destinations, where sources and destinations are hosts identified by fixed length addresses. The UDP and IP protocols are necessary for the TFTP and BOOTP protocols; TFTP and BOOTP require a UDP/IP connection. 1-28 Computer Group Literature Center Web Site Network I/O Support Boot Control Module (Two phases) Bootstrap Protocol (BOOTP) RFC 951 Trivial File Transfer Protocol (TFTP) RFC 783 User Datagram Protocol (UDP) RFC 768 Address Resolution Protocol (ARP) RFC 826 Reverse Address Resolution Protocol (RARP) - RFC 903 Internet Protocol (IP) RFC 791 Ethernet Driver Physical Layer Manager 1273 9401 Figure 1-1. Network Boot Modules http://www.motorola.com/computer/literature 1-29 1 1 General Information RARP and ARP Modules The Reverse Address Resolution Protocol (RARP) basically consists of an identity-less node that broadcasts a “whoami” packet onto the Ethernet and waits for an answer. The RARP server fills an Ethernet reply packet up with the target's Internet Address and sends it. The Address Resolution Protocol (ARP) basically provides a method of converting protocol addresses (e.g., IP addresses) to local area network addresses (e.g., Ethernet addresses). The RARP protocol module supports systems which do not support the BOOTP protocol (refer to BOOTP Module below). BOOTP Module The Bootstrap Protocol (BOOTP) basically allows a diskless client machine to discover its own IP address, the address of a server host, and the name of a file to be loaded into memory and executed. TFTP Module The Trivial File Transfer Protocol (TFTP) is a simple protocol to transfer files. It is implemented on top of the Internet User Datagram Protocol (UDP or Datagram) so it may be used to move files between machines on different networks implementing UDP. The only thing it can do is read and write files from/to a remote server. Network Boot Control Module The control capability of the Network Boot Control Module is needed to tie together all the necessary modules (capabilities) and to sequence the booting process. The booting sequence consists of two phases. The first is address determination and bootfile selection, and the second is file transfer. The first phase utilizes the RARP/BOOTP capability and the second phase utilizes the TFTP capability. 1-30 Computer Group Literature Center Web Site Multiprocessor Support (Remote Start) Network I/O Error Codes PPCBug returns an error code if an attempted network operation is unsuccessful. Refer to Appendix H, Network Communication Status Codes for an explanation of network I/O error codes. Multiprocessor Support (Remote Start) PPCBug can be configured to monitor a dual-ported resource and, upon receipt of a certain ‘signal’, pass program control to (that is, commence execution at) a user specified address. Note PCI Remote Start is only supported on boards equipped with the DEC2155x PCI-to-PCI Bridge device. A dual-ported resource is a hardware feature that makes local memory locations or registers available to remote processors as well as to the local processor. This ‘remote start’ capability is provided to allow the user to take advantage of boards with dual-ported resources to implement and “bootstrap” a multiprocessor system where member processor boards can be tightly coupled via an interface such as the VME bus. The PPCBug remote start package offers remote access to certain other PPCBug features in addition to the initiation of remote program execution. http://www.motorola.com/computer/literature 1-31 1 1 General Information PPCBug remote start can be utilized by either the MPCR or GCSR methods, which are described in the next subsections. Either or both methods can be enabled or disabled in the non-volatile PPCBug configuration by the ENV command. The name of this ENV parameter is “Remote Start Method Switch”. The valid choices for this parameter are: ENV Parameter Value Remote Start Method Setting G GCSR method only M MPCR method only B both GCSR and MPCR methods active N none - remote start is disabled Multiprocessor Control Register (MPCR) Method The MPCR method of remote start is based on the use of dual-ported local memory resources. A remote processor board (the host) can initiate PPCBug functions on the target processor board by issuing commands through the remote start memory interface. The target processor board is the one executing PPCBug, out of its local (on-board) resources. The remote start memory interface is implemented using two contiguous words of local memory, defined as the Multiprocessor Control Register (MPCR), and Multiprocessor Address Register (MPAR). The local address of MPCR is fixed, within PPCBug’s reserved memory area which is located in the topmost portion of local RAM. This address can be calculated as -$1C000. Note: Care should be taken not to write to memory locations adjacent to the MPCR and MPAR as this could cause corruption of PPCBug internal variables and vector tables, resulting in possible PPCBug malfunction. 1-32 Computer Group Literature Center Web Site Multiprocessor Support (Remote Start) The host’s access address of the MPCR is affected by memory mapping which is configured by the user and must be calculated accordingly. The MPCR consists of two words used to control communication between processors. It is organized as follows: Table 1-2. MPCR Method Remote Start Register Model Register Byte Name Offset MPCR 0 MPAR 4 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Command /Status Reserved Address The status codes stored in the MPCR command/status byte are of two types: ❏ Status returned from PPCBug (the target processor) ❏ Status set (by the host processor) The MPCR status codes that may be written to this location by PPCBug (the target processor) are: ASCII Value Hex Value 0 ($00) Wait. PPCBug initialization is not yet complete. ‘E’ ($45) The program pointed to by the MPAR address is executing. ‘R’ ($52) Ready. The target board (PPCBug) is ready for a remote start command to be written to this register. http://www.motorola.com/computer/literature Indicated Status 1-33 1 1 General Information The MPCR command codes that may be set by the host processor are: ASCII Value Hex Value Host Command Description ‘G’ ($47) Commence program execution using Go Direct logic (refer to the GD command). The address of execution is specified in the MPAR address register. ‘B’ ($42) Install breakpoints using the GO logic (refer to the GO command). ($50) Program flash memory. The MPAR location contains the address of the flash memory programing control packet. Note: You can only program FLASH memory by the MPCR method. See the.PFLASH system call for a description of the FLASH memory program control packet structure. ‘P’ The MPAR register contents specify an address parameter to be associated with the remote command. At power-up, the PPCBug self-test routines initialize RAM, including the memory locations used for multi-processor support (MPCR and MPAR). The MPCR contains $00 at power-up, indicating that initialization is not yet complete. As the initialization proceeds, the execution path comes to the "prompt" routine. Before sending the prompt, this routine places an R in the MPCR to indicate that initialization is complete. Then the prompt is sent. If no terminal is connected to the port, the MPCR is still polled to see whether an external processor requires control to be passed to the dual-port RAM. If a terminal does respond, the MPCR is polled for the same purpose while the serial port is being polled for user input. An ASCII G placed in the MPCR by a remote processor requests a Go Direct type of transfer; an ASCII B indicates that breakpoints are to be armed before control is transferred (like the GO command). 1-34 Computer Group Literature Center Web Site Multiprocessor Support (Remote Start) In either sequence, an E is placed in the MPCR to indicate that execution is underway just before control is passed to RAM. (Any remote processor could examine the MPCR contents.) If the code being executed in dual-port RAM is to re-enter PPCBug, a system call using function $0063 (SYSCALL .RETURN) returns control to PPCBug with a new display prompt. Note that every time PPCBug returns to the prompt, an R is moved into the MPCR to indicate that control can be transferred once again to a specified RAM location. GCSR Method PPCBug supports the GCSR method of remote start, over the VMEbus, on boards equipped with the Universe PCI to VMEbus bridge. When PPCBug is executing on the target processor board, a host processor board may initiate program execution by the target board’s MPU using the GCSR method of remote start. This method of remote start is implemented through the dual-ported register interface provided by the Universe MBOX registers. This interface is located at offset of $348 from the base address of the Universe CSR. The GCSR register model and its offset within the Universe CSR is the same regardless of which bus (VME or PCI) it is accessed from. The GCSR method remote start register model is organized as shown in the following table: Table 1-3. GCSR Method Remote Start Register Model Universe Byte Register Offset Name 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 LM/SIG Register MBOX0 $348 MBOX1 $34C GCSR1 GCSR2 MBOX2 $350 GCSR3 GCSR4 MBOX3 $354 GCSR5 Not Used Reserved http://www.motorola.com/computer/literature GCSR0 1-35 1 1 General Information The LM/SIG register is assigned the following bit definitions: Table 1-4. LM/SIG Register Bit Assignments Bit 31 30 29 28 27 26 25 24 Name Reserved Reserved Reserved Reserved Reserved Reserved Reserved SIG0 The VME host board can initiate program execution by the target board’s MPU by issuing a remote GO command using the GCSR registers. The result is equivalent to the MPCR method (using command code B) described in a previous section. The target board GO command is invoked by the VME host with the following sequence: ❏ The remote processor places the execution address for the target board MPU in general purpose registers 0 and 1 (GPCSR0=MS 16 bits, GPCSR1=LS 16 bits) ❏ The remote processor sets bit SIG0 of the LM/SIG register. ❏ The PPCBug firmware which is executing on the host board will clear SIG0, install breakpoints, and begin execution at the specified address. Note: The above steps assume that the Universe CSR has been mapped to the VME address space so the host may access the Universe mailbox registers. The recommended method of mapping the Universe CSR is to configure the desired address and attributes with PPCBug’s ENV command. The ENV command parameter identifiers for this are “VMEbus Register Access Image Control Register“ and “VMEbus Register Access Image Base Address Register“. For specific programming values, refer to the UniverseII User Manual, available from Tundra Semiconductor Corporation. 1-36 Computer Group Literature Center Web Site Data and Address Sizes Data and Address Sizes Data and address sizes are defined as follows: A byte is eight bits, numbered 0 through 7, with bit 0 being the least significant. A half-word is 16 bits, numbered 0 through 15, with bit 0 being the least significant. A word is 32 bits, numbered 0 through 31, with bit 0 being the least significant. Byte Ordering The MPU on the PowerPC board is programmed to big-endian byte ordering. Any attempt to use little-endian byte ordering will immediately render the debugger unusable. http://www.motorola.com/computer/literature 1-37 1 1 General Information 1-38 Computer Group Literature Center Web Site 2Using the Debugger 2 Entering Commands The debugger is command-driven and performs its various operations in response to commands that you enter at the keyboard. When the PPCxBug> prompt appears on the screen, the debugger is ready to accept commands. What you enter is stored in an internal buffer. Execution begins only after you press the Return key, allowing you to correct entry errors, if necessary, using the control characters (refer to Control Characters on page 2-6). After the debugger executes the command, the prompt reappears. However, if the command causes execution of target code (for example GO) then control may or may not return to the debugger, depending on what the program does. For example, if a breakpoint has been specified, then control returns to the debugger when the breakpoint is encountered during execution of the user program. For more about this, refer to the GD, GO, and GT command descriptions in Chapter 3, Debugger Commands. Alternately, the user program could return to the debugger by means of the System Call Handler routine .RETURN (refer to Chapter 5, System Calls). Command Syntax A debugger command is made up of the following parts: ❏ The command name ❏ Any required arguments, delineated with either a space or comma (precede the first argument with a space) ❏ Any required options. Precede an option or a string of options with a semi-colon (;). If no option is selected, the default options are used. Command entry is either uppercase or lowercase. 2-1 Using the Debugger 2 Command Arguments The following arguments are common to many of the commands. Additional arguments are defined in the description of the particular command in which they occur. EXP Expression (refer to EXP below) ADDR Address (refer to ADDR on page 2-4) COUNT Count; this is a numeric expression and has the same syntax as EXP (refer to EXP below) RANGE A range of memory addresses specified with a pair of arguments, either ADDR ADDR or ADDR : COUNT TEXT An ASCII string of up to 255 characters, delimited at each end by the single quote mark (’) PORT Port Number (refer to PORT on page 2-6) Use either a space or a comma as a delimiter between arguments. You may select the default value for an argument by inserting a pair of commas in place of the argument. EXP The EXP (expression) argument can be one or more numeric values separated by the arithmetic operators: 2-2 + plus - minus * multiply by / divide by & logical AND << shift left >> shift right Computer Group Literature Center Web Site Entering Commands Numeric values may be expressed in either hexadecimal, decimal, octal, or binary by immediately preceding them with the proper base identifier. Data Type Base Identifier Example Integer Hexadecimal $ $FFFFFFFF Integer Decimal & &1974, &10-&4 Integer Octal @ @456 Integer Binary % %1000110 If no base identifier is specified, then the numeric value is assumed to be hexadecimal. A numeric value may also be expressed as a string literal of up to four characters. The string literal must begin and end with the single quote mark (’). The numeric value is interpreted as the concatenation of the ASCII values of the characters. This value is right-justified, as any other numeric value would be. String Literal Numeric Value (Hexadecimal) ’A’ 41 ’ABC’ 414243 ’TEST’ 54455354 Evaluation of an expression is always from left to right unless parentheses are used to group part of the expression. There is no operator precedence. Subexpressions within parentheses are evaluated first. Nested parenthetical subexpressions are evaluated from the inside out. Valid expression examples: Expression Result (Hex) FF0011 FF0011 45+99 DE &45+&99 90 @35+@67+@10 5C http://www.motorola.com/computer/literature 2-3 2 Using the Debugger 2 Expression Result (Hex) %10011110+%1001 A7 88<<4 880 AA&F0 A0 << represents shift-left & represents logical AND The total value of the expression must be between 0 and $FFFFFFFF. ADDR The syntax for the ADDR argument is similar to the syntax accepted by the PowerPC one-line assembler. All control addressing modes are allowed. Refer to Addressing Modes in Chapter 4, One-Line Assembler/ Disassembler. ADDR may also be specified in the address + offset form. ADDR Formats The ADDR format is: HexadecimalNumber {[^S]|[^s]|[^U]|[^u]}|Rn Enter ADDR as a hexadecimal number (e.g., 20000 for address $00020000). The address, or starting address of a range, can be qualified by a suffix, either ^S or ^s for supervisor address space, or ^U or ^u for user address space. The default, when the suffix is not specified, is supervisor. Once a qualifier has been entered, it remains valid for all addresses entered for that command sequence, until either the debugger is reentered or another qualifier is provided. In the alternate register number (Rn) form, the debugger uses the address contained in MPU Register Rn, where n is 0 through 31 (i.e., 0, 1, . . . 31). 2-4 Computer Group Literature Center Web Site Entering Commands If the address range specified as ADDR ADDR, with a size option of either H (half-word) or W (word), data at the second (ending) address is acted on only if the second address is a proper boundary for a half-word or word. Otherwise, the range is truncated so that the last byte acted upon is at an address that is a proper boundary. Offset Registers Eight pseudo-registers (Z0-Z7) called offset registers are used to simplify the debugging of relocatable and position-independent modules. The listing files in these types of programs usually start at an address (normally 0) that is not the one at which they are loaded, so it is harder to correlate addresses in the listing with addresses in the loaded program. The offset registers solve this problem by taking into account this difference and forcing the display of addresses in a relative address+offset format. Offset registers have adjustable ranges and may even have overlapping ranges. The range for each offset register is set by two addresses, base and top, both of which are standard in a given 64-bit offset register. Specifying the base and top addresses for an offset register sets its range. In the event that an address falls in two or more offset registers’ ranges, the one that yields the least offset is chosen. Note Relative addresses are limited to 1MB (5 digits), regardless of the range of the closest offset register. http://www.motorola.com/computer/literature 2-5 2 Using the Debugger 2 PORT The PORT argument is the logical number of the port to be used to input or output. Valid port numbers which may be used for these commands are as follows: 0 or 00 Terminal port 0 (console port) is used for interactive user input and output (the default), or may also be used for the graphics adapter device. This port is labeled COM1 or SER1 or DEBUG on the PowerPC board or transition module. 1 or 01 Terminal port 1 (host port) is the default for downloading, uploading, concurrent mode, and transparent modes. This port is labeled either COM2 or SER2 on the PowerPC board or transition module. Command Options Many commands have one or more options, represented in boldface type in the command descriptions. Precede an option or a string of options with a semi-colon (;). If no option is entered, the command’s default options are used. Control Characters Some commands, such as CNFG, MM, or RM, allow you to edit parameter fields or the contents of registers or memory. You may use the following control characters to scroll through the listed items: 2-6 V or v Go to the next field, register, or memory location. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up to the previous field register, or memory location. This remains in effect until changed by entering one of the other special characters. = Re-open the same field register, or memory location. . Terminate the command, and return to PPC1-Bug> prompt Computer Group Literature Center Web Site Entering and Debugging Programs You may use the following control characters for limited editing while entering commands at the PPC1-Bug> prompt: DEL Delete: move the cursor back one position and erase the character at the new cursor position. If a printer port is configured (hardcopy mode), a slash (/) character is typed along with the deleted character. CTRL-h Performs the same function as DEL. CTRL-x Cancel line: move the cursor to the beginning of the line. If a printer port is configured (hardcopy mode), a sequence is issued along with another PPC1-Bug> prompt. CTRL-d Redisplay the entire command line entered on the following line CTRL-a Repeat the previous line. This happens only at the command line. The last line entered is redisplayed but not executed. The cursor is positioned at the end of the line. You may enter the line as is or you can add more characters to it. You can edit the line by backspacing and typing over old characters. The XON and XOFF characters in effect for the terminal port may be entered to control the output from any debugger command, if the XON/XOFF protocol is enabled (default). The characters initialized by PPCBug are (you may change them with the PF command): CTRL-s Wait: halt console output (XON) CTRL-q Resume console output (XOFF). Entering and Debugging Programs There are various ways to enter a user program into system memory for execution. One way is to create the program using the Assembler/Disassembler, entering the program one source line at a time. After each source line is entered, it is assembled and the object code is loaded to memory. Refer to Chapter 4 for information on using the PPCBug Assembler/Disassembler. http://www.motorola.com/computer/literature 2-7 2 Using the Debugger Another way is to download an object file from a host system. The program must be in S-record format (refer to Appendix D) and may have been assembled or compiled on the host system. Alternately, you may create a program using the Assembler/Disassembler, and store the program to the host using the DU command. A communication link must exist between the host system and PowerPC board port 1 (Refer to the board installation and use manual). Later, download the file from the host to PowerPC board memory with the LO command. 2 Once the object code has been loaded into memory, you can set breakpoints if desired and run the code or trace through it. System Call Routines in User Programs Access to various debugger routines is provided via the System Call Handler. This gives a convenient way of doing character input/output and many other useful operations so that you do not have to write these routines into the target code. The System Call handler is accessible through the SC (system call) instruction, with exception vector $00C00 (System Call Exception). Refer to Chapter 5, System Calls for details on the routines available and how to invoke them from within a user program. Preserving the Operating Environment This section explains how to avoid contaminating the operating environment of the debugger. PPCBug uses some of the PowerPC board onboard resources to contain temporary variables and exception vectors. If the resources that PPCBug relies upon are disturbed, PPCBug may not function reliably. If your application enables translation through the Memory Management Unit (MMU), and utilizes resources of the debugger (e.g., system calls), your application must create the necessary translation tables for the debugger to have access to its various resources. The debugger honors the enabling of the MMU; it does not alter or disable translation. 2-8 Computer Group Literature Center Web Site Preserving the Operating Environment Memory Requirements 2 The debugger requires approximately 768KB (maybe less) of read/write memory. It allocates this amount of memory from the top portion of memory space. For example, on a system which contains 64 megabytes ($04000000) of read/write memory (DRAM), the debugger’s memory page is located at $03F40000 to $03FFFFFF. This memory space is used by the debugger for program stack, I/O buffers, variables, and register files. If a user program is loaded (booted, SRecords) into memory, and if this program is utilizing the debugger’s programmatic interface (i.e., system calls), the program must not modify this allocated memory. Whenever the host hardware is reset, the target IP is initialized to $00004000 (i.e., just above the memory space of the exception vector table), and the target pseudo stack pointer is initialized to the starting location of the debugger’s read/write memory space. The target IP is set to the appropriate address if a program load operation (for example, the PBOOT command) is initiated. Note that user programs should handle the stack area properly in that it should not write starting at the initialized location. Some compilers and assemblers may write to the stack prior to decrementing the stack. The amount of read/write memory space that is allocated for the debugger, and by the debugger, may increase in future releases. To properly compensate for the increased read/write memory requirements, user programs may use the target register R1 as indicator for the top (plus 1) of usable memory. Exception Vectors The following exception vectors are reserved for use by the debugger: 00100 - System Reset Used for the abort switch soft reset feature 00700 - Program Used for instruction breakpoints 00C00 - System Call Used for the System Call Handler 02000 - Run Mode Used for instruction tracing http://www.motorola.com/computer/literature 2-9 Using the Debugger These vectors may be taken over under a user’s application. However, prior to returning control to the debugger these vectors must be restored for proper operation of the affected features. 2 MPU Registers Certain MPU registers must be preserved for their specific uses. MPU Register SPR275 MPU register SPR275 is reserved for usage by the debugger. If SPR275 is to be used by the user program, it must be restored prior to using debugger resources (system calls) and or returning control to the debugger. MPU Registers SPR272-SPR274 These MPU registers are used by the debugger as scratch registers. Context Switching Context switching is the switching from the debugger state to the user (target) state, or vice versa. This switching occurs upon the invocation of either the GD, GN, GO, GT, T, or TT commands, or the return from user state to the debugger state. When the context switch transitions from the user state to the debugger state, the following MPU registers are captured: PPC603-based boards: 2-10 R0-R31 General Purpose Registers FR0-FR31 Floating Point Unit Data Registers SR0-SR15 Segment Registers SPRn Special Purpose Registers (n is 1, 8, 9, 18, 19, 22, 25, 26, 27 268, 269, 275, 282, 287, 528 - 543, 976 - 981, 1008, 1010) IP Instruction Pointer (copy of SPR26) MSR Machine State Register (copy of SPR27) Computer Group Literature Center Web Site Context Switching CR Condition Register FPSCR Floating Point Status/Control Register 2 PPC604-based boards: R0-R31 General Purpose Registers FR0-FR31 Floating Point Unit Data Registers SR0-SR15 Segment Registers SPRn Special Purpose Registers (n is 1, 8, 9, 18, 19, 22, 25, 26, 27 268, 269, 275, 282, 287, 528 - 543, 1008, 1010, 1013, 1023) IP Instruction Pointer (copy of SPR26) MSR Machine State Register (copy of SPR27) CR Condition Register FPSCR Floating Point Status/Control Register When the context switch transitions from the debugger state to the user state, the following MPU registers are restored: PPC603-based boards: R0-R31 General Purpose Registers FR0-FR31 Floating Point Unit Data Registers SPRn Special Purpose Registers (n is 1, 8, 9, 275, 1010) IP Instruction Pointer, copied to SPR26 MSR Machine State Register, copied to SPR27 CR Condition Register FPSCR Floating Point Status/Control Register PPC604-based boards: 0-R31 General Purpose Registers FR0-FR31 Floating Point Unit Data Registers SPRn Special Purpose Registers (n is 1, 8, 9, 275, 1010, 1013, 1023) http://www.motorola.com/computer/literature 2-11 Using the Debugger 2 IP Instruction Pointer, copied to SPR26 MSR Machine State Register, copied to SPR27 CR Condition Register FPSCR Floating Point Status/Control Register Note that on a restoration context switch, registers whose perspectives feature MMU characteristics and operating modes of the MPU are not restored. The debugger honors the user’s MMU configuration. If the user’s program wishes to utilize the programmatic interface (i.e., system calls) of the debugger, it must maintain the address translation of 1 to 1, and the I/O resources utilized by the debugger must be data cache inhibited. Floating Point Support The MD and MM commands allow display and modification of floating point data in memory. Use either the MD command or the MM command to assemble or disassemble floating point instructions. Valid data types that can be used when modifying a floating point data register or a floating point memory location: Integer Data Types Byte 12 Half-Word 1234 Word 12345678 Floating Point Data Types Single Precision Real 1_FF_7FFFFF Double Precision Real 1_7FF_FFFFFFFFFFFFF Scientific Notation (decimal) -3.12345678901234501_E+123 When entering data in single or double precision format, observe the following rules: ❏ 2-12 The sign field is the first field and is a binary field. Computer Group Literature Center Web Site Floating Point Support ❏ The exponent field is the second field and is a hexadecimal field. ❏ The mantissa field is the last field and is a hexadecimal field. ❏ The sign field, the exponent field, and at least the first digit of the mantissa field must be present (any unspecified digits in the mantissa field are set to zero). ❏ Each field must be separated from adjacent fields by an underscore. ❏ All the digit positions in the sign and exponent fields must be present. Single Precision Real The single precision real format would appear in memory as: 1-bit sign field (1 binary digit) 8-bit biased exponent field (2 hex digits, Bias = $7F) 23-bit fraction field (6 hex digits) A single precision number takes 4 bytes in memory. Double Precision Real The double precision real format would appear in memory as: 1-bit sign field (1 binary digit) 11-bit biased exponent field (3 hex digits, Bias = $3FF) 52-bit fraction field (13 hex digits) A double precision number takes 8 bytes in memory. Note The single and double precision formats have an implied integer bit (always 1). http://www.motorola.com/computer/literature 2-13 2 Using the Debugger 2 Scientific Notation The scientific notation format provides a convenient way to enter and display a floating point decimal number. Internally, the number is assembled into a packed decimal number and then converted into a number of the specified data type. Entering data in this format requires the following fields: ❏ An optional sign bit (+ or -). ❏ One decimal digit followed by a decimal point. ❏ Up to 17 decimal digits (at least one must be entered). ❏ An optional Exponent field that consists of: – An optional underscore. – The Exponent field identifier, letter E. – An optional Exponent sign (+, -). – From 1 to 3 decimal digits. For more information about the floating point unit, refer to the PowerPC 603 RISC Microprocessor User’s Manual, the PowerPC 604 RISC Microprocessor User’s Manual, or the PowerPC 750 RISC Microprocessor User’s Manual. 2-14 Computer Group Literature Center Web Site 3Debugger Commands 3 Introduction This chapter contains descriptions of each debugger command, with one or more examples of each. The debugger commands are listed in Table 3-1. Debugger Commands All valid debugger commands are listed in the table below, and are described in alphabetical order on the following pages. The command syntax is shown using the symbols explained in Chapter 2. Table 3-1. Debugger Commands Command AS BC BF BI BM BR NOBR BS BV CACHE CM NOCM CNFG CS CSAR CSAW DC DMA DS DU ECHO ENV Description One Line Assembler Block of Memory Compare Block of Memory Fill Block of Memory Initialize Block of Memory Move Breakpoint Insert Breakpoint Delete Block of Memory Search Block of Memory Verify Modify Cache State Concurrent Mode No Concurrent Mode Configure Board Information Block Checksum PCI Configuration Space READ Access (NOTE 2) PCI Configuration Space WRITE Access (NOTE 2) Data Conversion Move Block of Memory One Line Disassembler Dump S-Records Echo String Set Environment 3-1 Debugger Commands Table 3-1. Debugger Commands (Continued) Command FORK FORKWR GD GEVBOOT GEVDEL GEVDUMP GEVEDIT GEVINIT GEVSHOW GN G, GO GT HE IBM IDLE IOC IOI IOP IOT IRD IRM IRS LO MA NOMA MAE MAL NOMAL MAR MAW MD, MDS MENU M, MM MMD MMGR MS MW NAB NAP NBH NBO 3 3-2 Description Fork Idle MPU at Address (NOTE 2) Fork Idle MPU with Registers (NOTE 2) Go Direct (Ignore Breakpoints) Global Environment Variable Boot (NOTE 1) Global Environment Variable Delete (NOTE 1) Global Environment Variable(s) Dump (NOTE 1) Global Environment Variable Edit (NOTE 1) Global Environment Variable Initialization (NOTE 1) Global Environment Variable(s) Display (NOTE 1) Go to Next Instruction Go Execute User Program Go to Temporary Breakpoint Help Indirect Block Move Idle Master MPU (NOTE 2) I/O Control for Disk I/O Inquiry I/O Physical (Direct Disk Access) I/O Teach for Configuring Disk Controller Idle MPU Register Display (NOTE 2) Idle MPU Register Modify (NOTE 2) Idle MPU Register Set (NOTE 2) Load S-Records from Host Macro Define/Display Macro Delete Macro Edit Enable Macro Listing Disable Macro Listing Load Macros Save Macros Memory Display System Menu Memory Modify Memory Map Diagnostic Memory Manager Memory Set Memory Write Automatic Network Boot Nap MPU (NOTE 2) Network Boot Operating System, Halt Network Boot Operating System Computer Group Literature Center Web Site Debugger Commands Table 3-1. Debugger Commands (Continued) Command NIOC NIOP NIOT NPING OF PA NOPA PBOOT PF NOPF PFLASH PS RB NORB RD REMOTE RESET RL RM RS RUN SD SET SROM SYM NOSYM SYMS T TA TIME TM TT VE VER WL Description Network I/O Control Network I/O Physical Network I/O Teach (Configuration) Network Ping Offset Registers Display/Modify Printer Attach Printer Detach Bootstrap Operating System Port Format Port Detach Program FLASH Memory Put RTC into Power Save Mode ROMboot Enable ROMboot Disable Register Display Remote Cold/Warm Reset Read Loop Register Modify Register Set MPU Execution/Status (NOTE 2) Switch Directories Set Time and Date SROM Examine/Modify (NOTE 2) Symbol Table Attach Symbol Table Detach Symbol Table Display/Search Trace Terminal Attach Display Time and Date Transparent Mode Trace to Temporary Breakpoint Verify S-Records Against Memory Revision/Version Display Write Loop http://www.motorola.com/computer/literature 3 3-3 Debugger Commands Notes 1. This command was added at revision 1.8 of PPCBug, dated 10/05/95. 2. This command was added at Revision 3.1 of PPCBug, dated 2/26/97. 3 3-4 Computer Group Literature Center Web Site Debugger Commands AS - One-Line Assembler Command Input 3 AS ADDR Description The AS command provides access to the one-line assembler. It is synonymous with the Memory Modify (MM) command when used with the DI option (MM ADDR ;DI). Refer to M, MM - Memory Modify on page 3-130 for details on using the MM command. Refer to Chapter 4, One-Line Assembler/ Disassembler for information on using the one-line assembler. http://www.motorola.com/computer/literature 3-5 Debugger Commands BC - Block of Memory Compare Command Input 3 BC RANGE ADDR [;B|H|W] Options B Byte H Half-word W Word Description The BC command compares the contents of memory defined by RANGE with another place in memory, beginning at ADDR. The option field is only allowed when RANGE is specified using a COUNT. In this case, the B, H, or W defines the size of the data that the COUNT is referring to. For example, a COUNT of 4 with an option of W would mean to compare 4 words (16 bytes). The default data type is word. No confirmation is printed if the memory being compared matches. If the memory does not match, each mismatch is displayed. If the RANGE beginning address is greater than or equal to the end address, an error message is displayed and no comparison takes place. For the following examples, assume that memory blocks 20000-20020 and 21000-21020 contain identical data. Examples Example 1: Compare the memory, with nothing printed. PPC1-Bug>BC 20000 2001F 21000 Effective address: 00020000 Effective address: 0002001F Effective address: 00021000 PPC1-Bug> 3-6 Computer Group Literature Center Web Site Debugger Commands Example 2: Compare the memory, with nothing printed. PPC1-Bug>BC 20000:20 21000;B Effective address: 00020000 Effective count : &32 Effective address: 00021000 PPC1-Bug> 3 Example 3: Create a mismatch (using the MM command), and prints out the mismatches. PPC1-Bug>MM 2100F;B 0002100F 21? 0. PPC1-Bug> PPC1-Bug>BC 20000:20 21000;B Effective address: 00020000 Effective count : &32 Effective address: 00021000 0002000F|21 0002100F|00 PPC1-Bug> http://www.motorola.com/computer/literature 3-7 Debugger Commands BF - Block of Memory Fill Command Input 3 BF RANGE data [increment] [;B|H|W] Arguments data Data pattern to be written to memory. If data does not fit into the selected data field length, then leading bits are truncated to make it fit. If truncation occurs, then a message is printed stating the data pattern which was actually written (or initially written if you specified an increment). increment Value that data is incremented following each write. If increment does not fit into the data field size, then leading bits are truncated to make it fit. If truncation occurs, then a message is printed stating the increment which was actually used. Options B Byte H Half-word W Word Description The BF command fills the specified range of memory with a data pattern (data). If an increment is specified, then data is incremented by this value following each write, otherwise data remains a constant value. A decrementing pattern may be accomplished by entering a negative increment. The data you enter is right-justified in either a byte, half-word, or word field (as specified by the data field length selected). The default field length is W (word). 3-8 Computer Group Literature Center Web Site Debugger Commands If the upper address of the range is not on the correct boundary for an integer multiple of the data to be stored, then data is stored to the last boundary before the upper address. No address outside of the specified range is ever disturbed in any case. The Effective address messages displayed by the command show exactly where data was stored. Examples Example 1: For this example, assume that memory from $20000 through $2002F is clear. Because no option is specified, the length of the data field defaults to word. PPC1-Bug>BF 20000,2001F 4E71 Effective address: 00020000 Effective address: 0002001F PPC1-Bug> PPC1-Bug>MD 20000:18;H 00020000 0000 4E71 0000 4E71 0000 4E71 0000 4E71 00020010 0000 4E71 0000 4E71 0000 4E71 0000 4E71 00020020 0000 0000 0000 0000 0000 0000 0000 0000 ..Nq..Nq..Nq..Nq ..Nq..Nq..Nq..Nq ................ Example 2: For this example, assume that memory from $20000 through $2002F is clear. The specified data does not fit into the specified data field size, the data is truncated, and the Data = message is output. PPC1-Bug>BF 20000:10 4E71;B Effective address: 00020000 Effective count : &16 Data = $71 PPC1-Bug> PPC1-Bug>MD 20000:18;H 00020000 7171 7171 7171 7171 7171 7171 7171 7171 00020010 0000 0000 0000 0000 0000 0000 0000 0000 00020020 0000 0000 0000 0000 0000 0000 0000 0000 PPC1-Bug> qqqqqqqqqqqqqqqq ................ ................ Example 3: For this example, assume that memory from $20000 through $2002F is clear. The word pattern does not fit evenly in the given range. Only one word is written and the Effective address messages reflect the fact that data is not written all the way up to the specified address. http://www.motorola.com/computer/literature 3-9 3 Debugger Commands PPC1-Bug>BF 20000,20006 12345678;W Effective address: 00020000 Effective address: 00020003 PPC1-Bug> 3 PPC1-Bug>MD 20000:18;H 00020000 1234 5678 0000 0000 0000 0000 0000 0000 00020010 0000 0000 0000 0000 0000 0000 0000 0000 00020020 0000 0000 0000 0000 0000 0000 0000 0000 .4Vx............ ................ ................ Example 4: For this example, assume memory from $20000 through $2002F is clear. PPC1-Bug>BF 20000:18 0 1;H Effective address: 00020000 Effective count : &48 PPC1-Bug> PPC1-Bug>MD 20000:18;H 00020000 0000 0001 0002 0003 0004 0005 0006 0007 00020010 0008 0009 000A 000B 000C 000D 000E 000F 00020020 0010 0011 0012 0013 0014 0015 0016 0017 PPC1-Bug> 3-10 ................ ................ ................ Computer Group Literature Center Web Site Debugger Commands BI - Block of Memory Initialize Command Input 3 BI RANGE [;B|H|W] Options B Byte H Half-word W Word Description The BI initializes parity for a block of memory. The BI command is nondestructive; if the parity is correct for a memory location, then the contents of that memory location are not altered. The limits of the block of memory to be initialized may be specified using a RANGE. The option field specifies the data size in which memory is initialized if RANGE is specified using a COUNT. The option also specifies the size of data element to which the COUNT refers. The length option is valid only when a COUNT is used. The default data type is word. BI works through the memory block by reading from locations and checking parity. If the parity is not correct, then the data read is written back to the memory location in an attempt to correct the parity. If the parity is not correct after the write, then the message RAM FAIL is output and the address is given. This command may take several seconds to initialize a large block of memory. Examples Example 1: PPC1-Bug>BI 0:10000;B Effective address: 00000000 Effective count : &65536 PPC1-Bug> http://www.motorola.com/computer/literature 3-11 Debugger Commands Example 2: For this example, assume system memory from $0 to $000FFFFF. PPC1-Bug>BI 0,1FFFFF Effective address: 00000000 Effective address: 001FFFFF RAM FAIL AT $00100000 PPC1-Bug> 3 3-12 Computer Group Literature Center Web Site Debugger Commands BM - Block of Memory Move Command Input 3 BM RANGE ADDR [;B|H|W] Options B Byte H Half-word W Word Description The BM command copies the contents of the memory addresses defined by RANGE to another place in memory, beginning at ADDR. The option field is only allowed when RANGE is specified using a COUNT. In this case, the B, H, or W defines the size of the data that the COUNT is referring to. For example, a COUNT of 4 with an option of W would mean to move 4 words (or 16 bytes) to the new location. If an option field is specified without a COUNT in the RANGE, an error results. The BM command is useful for patching assembly code in memory (refer to example 2). The default data size is word. Examples Example 1: For this example, assume that memory from 20000 to 2000F is clear. PPC1-Bug>MD 21000:10;H 00021000 5448 4953 2049 5320 4120 5445 5354 2121 00021010 0000 0000 0000 0000 0000 0000 0000 0000 PPC1-Bug> THIS IS A TEST!! ................ PPC1-Bug>BM 21000 2100F 20000 Effective address: 00021000 Effective address: 0002100F Effective address: 00020000 PPC1-Bug> http://www.motorola.com/computer/literature 3-13 Debugger Commands PPC1-Bug>MD 20000:10;H 00020000 5448 4953 2049 5320 4120 5445 5354 2121 00020010 0000 0000 0000 0000 0000 0000 0000 0000 PPC1-Bug> 3 THIS IS A TEST!! ................ Example 2: Patch assembly code in memory For this example, assume that you had a short program in memory at address 20000 (displayed with the MD command). PPC1-Bug>MD 20000 2000F;DI 00020000 3C401000 ADDIS R2,R0,$1000 00020004 60420001 ORI R2,R2,$1 00020008 7C631378 OR R3,R3,R2 0002000C 7CA53214 ADD R5,R5,R6 PPC1-Bug> To insert an ANDC between the OR instruction and the ADD instruction, Block Move the object code down four bytes to make room for the ANDC. PPC1-Bug>BM 20008 20010 2000C Effective address: 00020008 Effective address: 0002000F Effective address: 0002000C PPC1-Bug> PPC1-Bug>MD 20000 20014;DI 00020000 3C401000 ADDIS R2,R0,$1000 00020004 60420001 ORI R2,R2,$1 00020008 7C631378 OR R3,R3,R2 0002000C 7C631378 OR R3,R3,R2 00020010 7CA53214 ADD R5,R5,R6 PPC1-Bug> Enter the ANDC at address 20008 using the MM command. PPC1-Bug>MM 20008;DI 00020008 7C631378 OR 00020008 7C631078 ANDC 0002000C 7C631378 OR PPC1-Bug> 3-14 R3,R3,R2? ANDC R3,R3,R2 R3,R3,R2 R3,R3,R2? . Computer Group Literature Center Web Site Debugger Commands PPC1-Bug>MD 20000 20014;DI 00020000 3C401000 ADDIS R2,R0,$1000 00020004 60420001 ORI R2,R2,$1 00020008 7C631078 ANDC R3,R3,R2 0002000C 7C631378 OR R3,R3,R2 00020010 7CA53214 ADD R5,R5,R6 PPC1-Bug> http://www.motorola.com/computer/literature 3 3-15 Debugger Commands BR - Breakpoint Insert NOBR - Breakpoint Delete 3 Command Input BR [ADDR[:COUNT]] NOBR [ADDR] Description The BR command sets a target code instruction address as a breakpoint address for debugging purposes. If, during target code execution, a breakpoint with 0 count is found, the target code state is saved in the target registers and control is returned back to the debugger. This allows you to see the actual state of the processor at selected instructions in the code. Up to eight breakpoints can be defined. The breakpoints are kept in a table which is displayed each time either BR or NOBR is used. If an address is specified with the BR command, that address is added to the breakpoint table. The COUNT argument specifies how many times the instruction at the breakpoint address must be fetched before a breakpoint is taken. The COUNT, if greater than zero, is decremented with each fetch. Every time a breakpoint with zero count is found, a breakpoint handler routine prints the CPU state on the screen and control is returned to the debugger. NOBR is used for deleting breakpoints from the breakpoint table. If an address is specified, then that address is removed from the breakpoint table. If NOBR is entered with no address, then all entries are deleted from the breakpoint table and the empty table is displayed. Examples Example 1: Set some breakpoints. PPC1-Bug>BR 1E000,1E200 1E700:&12 BREAKPOINTS 0001E000 0001E200 0001E700:C PPC1-Bug> 3-16 Computer Group Literature Center Web Site Debugger Commands Example 2: Delete specified breakpoint. PPC1-Bug>NOBR 1E200 BREAKPOINTS 0001E000 0001E700:C PPC1-Bug> 3 Example 3: Delete all breakpoints. PPC1-Bug>NOBR BREAKPOINTS PPC1-Bug> http://www.motorola.com/computer/literature 3-17 Debugger Commands BS - Block of Memory Search Command Input 3 BS RANGE TEXT [;B|H|W] or BS RANGE data [mask] [;B|H|W [,N] [,V]] Arguments TEXT An ASCII text string that is matched against a range of memory data Data pattern that is matched against a range of memory mask A string that indicates which bit positions in data to compare to memory (a one is compared, a zero is not). The default is all ones. Options B Byte H Half-word W Word N Non-aligned. The search is conducted on a byte-by-byte basis, rather than by half-words or words, regardless of the size of data. V Verify. Addresses and data are displayed only when the memory contents do not match data. Description The BS command searches the specified range of memory for a match with a an ASCII text string or a data pattern. This command has three modes. String Search In the string search mode, a search is carried out for the TEXT argument. The size option field indicates whether the COUNT field of RANGE refers to bytes, half-words, or words. If RANGE is not specified using a COUNT, then no options are allowed. If a match is found, then the address of the first byte of the match is output. 3-18 Computer Group Literature Center Web Site Debugger Commands Data Search In the Data Search mode, a data pattern (data) is matched against a range of memory. The size option indicates whether the COUNT field in RANGE refers to bytes, half-words, or words (the default is word). The following actions occur during a data search: 1. data is right-justified and leading bits are truncated or leading zeros are added as necessary to make the data pattern the specified size. 2. A compare is made with successive bytes, half-words, or words (depending on the size in effect) within the range for a match with data. Comparison is made only on those bits at bit positions corresponding to a one in mask. If mask is not specified, the default is all ones (all bits are compared). The size of the mask is taken to be the same size as the data. If the N (non-aligned) option is selected, data is searched for on a byte-by-byte basis, rather than by half-words or words, regardless of the size of data. This is useful if a half-word (or word) pattern is being searched for, but is not expected to lie on a half-word (or word) boundary. 3. If a match is found, then the address of the first byte of the match is output along with the memory contents. If a mask was in use, then the actual data at the memory location is displayed, rather than the data with the mask applied. Data Verification If the V (verify) option has been selected, the addresses and data are displayed only when the memory contents do not match data. Otherwise this mode is identical to the Data Search mode. For all three modes, information on matches is output to the screen in a four-column format. If more than 24 lines of matches are found, then output is inhibited to prevent the first match from rolling off the screen. A message is printed at the bottom of the screen indicating that there is more http://www.motorola.com/computer/literature 3-19 3 Debugger Commands to display. To resume output, you should simply press any character key. To cancel the output and exit the command, you should press the BREAK key. 3 If a match is found (or, in the case of Mode 3, a mismatch) with a series of bytes of memory whose beginning is within the range but whose end is outside of the range, then that match is output and a message is output stating that the last match does not lie entirely within the range. You may search non-contiguous memory with this command without causing a Bus Error. For the examples below, assume the following data is in memory. 00030000 0000 0045 7272 6F72 00030010 3446 2F2F 436F 6E66 00030020 7461 7274 3A00 0000 2053 7461 7475 733D 6967 5461 626C 6553 0000 0000 0000 0000 ...Error Status= 4F//ConfigTableS tart:........... Examples Example 1: Mode 1: The string is not found, so a message is output. PPC1-Bug>BS 30000 3002F ’Task Status’ Effective address: 00030000 Effective address: 0003002F -not foundPPC1-Bug> Example 2: Mode 1: The string is found, and the address of its first byte is output. PPC1-Bug>BS 30000 3002F ’Error Status’ Effective address: 00030000 Effective address: 0003002F 00030003 PPC1-Bug> Example 3: Mode 1: The string is found, but it ends outside of the range, so the address of its first byte and a message are output. PPC1-Bug>BS 30000 3001F ’ConfigTableStart’ Effective address: 00030000 Effective address: 0003001F 00030014 -last match extends over range boundaryPPC1-Bug> 3-20 Computer Group Literature Center Web Site Debugger Commands Example 4: Mode 1, using RANGE with COUNT and size option: COUNT is displayed in decimal, and address of each occurrence of the string is output. PPC1-Bug>BS 30000:30 ’t’;B Effective address: 00030000 Effective count : &48 0003000A 0003000C 00030020 PPC1-Bug> 3 00030023 Example 5: Mode 2, using RANGE with COUNT: COUNT is displayed in decimal bytes, and the data pattern is found and displayed. PPC1-Bug>BS 30000:18,2F2F;H Effective address: 00030000 Effective count : &48 00030012|2F2F PPC1-Bug> Example 6: Mode 2, the default size is word and the data pattern is not found, so a message is output. PPC1-Bug>BS 30000,3002F 3D34 Effective address: 00030000 Effective address: 0003002F -not foundPPC1-Bug> Example 7: Mode 2, the size is half-word and non-aligned option is used, so the data pattern is found and displayed. PPC1-Bug>BS 30000,3002F 3D34;HN Effective address: 00030000 Effective Address: 0003002F 0003000F|3D34 PPC1-Bug> http://www.motorola.com/computer/literature 3-21 Debugger Commands Example 8: Mode 2, using RANGE with COUNT, mask option, and size option: COUNT is displayed in decimal, and the actual unmasked data patterns found are displayed. 3 PPC1-Bug>BS 30000:30 60,F0;B Effective address: 00030000 Effective count : &48 00030006|6F 0003000B|61 00030015|6F 00030017|66 00030018|69 00030019|67 0003001C|62 0003001D|6C 0003001E|65 PPC1-Bug> 00030016|6E 0003001B|61 00030021|61 Example 9: Mode 3, on a different block of memory, mask option, scan for words with low nibble nonzero: two locations failed to verify. PPC1-Bug>BS 3000 1FFFF 0000 000F;VH Effective address: 00003000 Effective address: 0001FFFF 0000C000|E501 0001E224|A30E PPC1-Bug> 3-22 Computer Group Literature Center Web Site Debugger Commands BV - Block of Memory Verify Command Input 3 BV RANGE data [increment] [;B|H|W] Arguments data Data pattern to be compared to memory. If data does not fit into the selected data field length, then leading bits are truncated to make it fit. If truncation occurs, then a message is printed stating the data pattern which was actually written (or initially written if you specified an increment). increment Value that data is incremented following each write. If increment does not fit into the data field size, then leading bits are truncated to make it fit. If truncation occurs, then a message is printed stating the increment which was actually used. Options B Byte H Half-word W Word Description The BV command compares the specified range of memory against a data pattern. If an increment is specified, then data is incremented by this value following each comparison, otherwise data remains a constant value. A decrementing pattern may be accomplished by entering a negative increment. The data you entered is right-justified in either a byte, halfword, or word field (as specified by the option selected). The default field length is W (word). If the range is specified using a COUNT, then the COUNT is assumed to be in terms of the data size. http://www.motorola.com/computer/literature 3-23 Debugger Commands If the upper address of the range is not on the correct boundary for an integer multiple of the data to be verified, data is verified to the last boundary before the upper address. No address outside of the specified range is read from in any case. The Effective address messages displayed by the command show exactly the extent of the area read from. 3 Examples Example 1: For this example, assume memory from $20000 to $2002F is as indicated. In this example the default data element size is word, and the block verify was successful (i.e., nothing printed). PPC1-Bug>MD 20000:18;H 00020000 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 00020010 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 00020020 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 PPC1-Bug> NqNqNqNqNqNqNqNq NqNqNqNqNqNqNqNq NqNqNqNqNqNqNqNq PPC1-Bug>BV 20000 2001F 4E714E71 Effective address: 00020000 Effective address: 0002001F PPC1-Bug> Example 2: For this example, assume memory from $20000 to $2002F is as indicated. Mismatches are printed out. PPC1-Bug>MD 20000:18;H 00020000 0000 0000 0000 0000 0000 0000 0000 0000 00020010 0000 0000 0000 0000 0000 0000 0000 0000 00020020 0000 0000 0000 0000 0000 4AFB 4AFB 4AFB PPC1-Bug> PPC1-Bug>BV 20000:30 0;B Effective address: 00020000 Effective count : &48 0002002A|4A 0002002B|FB 0002002C|4A 0002002E|4A 0002002F|FB PPC1-Bug> ................ ................ ..........J{J{J{ 0002002D|FB Example 3: For this example, assume memory from $20000 to $2002F is as indicated. Size is half-word, mismatches are printed out. PPC1-Bug>MD 20000:18;H 00020000 0000 0001 0002 0003 0004 0005 0006 0007 00020010 0008 FFFF 000A 000B 000C 000D 000E 000F 00020020 0010 0011 0012 0013 0014 0015 0016 0017 PPC1-Bug> 3-24 ................ ................ ................ Computer Group Literature Center Web Site Debugger Commands PPC1-Bug>BV 20000:18 0 1;H Effective address: 00020000 Effective count : &48 00020012|FFFF PPC1-Bug> http://www.motorola.com/computer/literature 3 3-25 Debugger Commands CACHE - Cache Control Command Input 3 CACHE;[D|E] Options D Disable instruction caches E Enable instruction caches Description The CACHE command modifies the state of the L1 and L2 instruction caches. the disable option flushes both caches and then disables them. The enable option invalidates both caches and then enables them. Both commands can be safely executed from any cache state. Example PPC4-Bug>cache;d(L1 and L2 instruction caches are off) PPC4-Bug>cache;e (L1 and L2 instruction caches are on) 3-26 Computer Group Literature Center Web Site Debugger Commands CM - Concurrent Mode NOCM - No Concurrent Mode 3 Command Input CM [[PORT] [ID-STRING] [BAUD] [PHONE-NUMBER]]|[;A]|[;H] NOCM Arguments ID-STRING Device (i.e. modem) with which communications is established before the concurrent mode session is activated. If no identifier string is specified, CM will use an identifier string of “DUMB” by default. The identifier string must be one that is supported. If the identifier string is not found in the supported list, CM displays an error message. BAUD Baud rate. The baud rate must be supported by the device and must be supported by the debugger (110, 300, 600, 1200, 2400, 4800, 9600, 19200). If no baud rate is specified, CM uses the default baud rate for the device. This is also displayed along with the supported devices. If the baud rate is not supported, CM displays an error message. PHONE-NUMBER Phone number. This may be a string of any alphanumeric characters. This string is passed directly to the device driver if needed. In the case of modems, this string is added to the dial recognition string. If the phone number field is not specified, a dial-in condition is assumed (wait for call). http://www.motorola.com/computer/literature 3-27 Debugger Commands Options 3 A List all supported devices. H Displays whether concurrent mode is active or not, and if it is, what secondary port number is being used by it. Description The CM command activates a mode in which everything that appears on the system console terminal is also echoed to the port specified by the PORT argument. PORT is checked for inbound characters. These are also echoed to the system console terminal. If no port is specified, CM uses port 1 by default. PORT must already be configured. The baud rate need not be specified because the port is reconfigured prior to activation. The preconfiguration of the port is done by using the PF (Port Format) command. If PORT is not currently assigned, CM displays an error message. For any reason you may abort the concurrent mode setup by pressing the BREAK key. This may be necessary if the modem is not responding to commands from the debugger. The NOCM command terminates concurrent mode which was activated by the CM command. Depending on the device and the port specified with the CM command, the communication link is appropriately closed. Examples Example1: List all devices supported by the debugger: PPC1-Bug>CM;A Concurrent Devices Supported Device Name (ID-STRING) Default Baud DUMB 9600 UDS2662 1200 UDS2980 1200 UDS3382 1200 Example 2: Activate the concurrent mode. PPC1-Bug>CM Concurrent Mode Active 3-28 Computer Group Literature Center Web Site Debugger Commands This results in the default settings remaining intact: PORT 1 ID-STRING DUMB BAUD 9600 (default if ID-STRING is “DUMB”) PHONE-NUMBER null 3 Example 3: Activate the concurrent mode, with changes to the modem and the phone number. PPC1-Bug>CM,,UDS2662,,16024383020 Concurrent Mode Active This results in the following changes: PORT 1 ID-STRING UDS2662 BAUD 1200 (default if ID-STRING is “UDS2662”) PHONE-NUMBER 16024383020 Example 4: Activate the concurrent mode, with changes to the modem and the phone number. PPC1-Bug>CM,,UDS2662,,16024383020 Concurrent Mode Active PPC1-Bug>CM,,UDS2662,,16024383020 Concurrent Mode Already Active PPC1-Bug> An error occurs on the second entry because the concurrent mode is already active. Example 3: Activate the concurrent mode, with changes to the modem, baud rate, and phone number. PPC1-Bug>CM 2 UDS2980 1200 18007777777 Concurrent Mode Active PPC1-Bug> http://www.motorola.com/computer/literature 3-29 Debugger Commands This results in the following changes: 3 PORT 2 ID-STRING UDS2980 BAUD 1200 PHONE-NUMBER 18007777777 Example 5: Activate the concurrent mode, with error. PPC1-Bug>CM 2,,DUMB Concurrent Mode Setup Failure PPC1-Bug> Example 6: Terminate the concurrent mode. PPC1-Bug>NOCM Concurrent Mode Terminated PPC1-Bug> Example 7: Attempt to terminate the previously terminated concurrent mode. PPC1-Bug>NOCM Concurrent Mode Not Active PPC1-Bug> 3-30 Computer Group Literature Center Web Site Debugger Commands CNFG - Configure Board Information Block Command Input 3 CNFG [;[I] [M]] Options I Initialize the board information block to zero. M Modify the board information block. Description The CNFG command displays the configure the board information block, and allows you to change the contents. The board information block, which is resident within the Non-Volatile RAM (NVRAM), contains various elements detailing specific operation parameters of the PowerPC board. which have been set up by the factory. The CNFG command does not describe the elements and their use. The board information block contents are checksummed for validation purposes. This checksum is the last element of the block. Refer to the board installation and use manual for the location, and contents of the board information block, and the size and logical offset of each element. The parameters that are quoted are left-justified ASCII strings padded with space characters. The quotes are displayed to indicate the size of the string. Parameters that are not quoted are considered data strings, and data strings are right-justified. The data strings are padded with zeroes if the length is not met. The CNFG information is configured in the factory. There is no need ever to modify these values unless the NVRAM gets corrupted. Option M allows you to modify the board information block. When invoked, this command prompts for entry into each field. You may change the displayed value by typing a new value, followed by the Return key. To leave the field unaltered, press the Return key without typing a new value. http://www.motorola.com/computer/literature 3-31 Debugger Commands You may also enter a special character, either at the prompt or after typing new data, for scrolling through the fields. The special characters are: 3 V or v Go to the next field. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up to the previous field. This remains in effect until changed by entering one of the other special characters. = Re-open the same field . Terminate the CNFG command, and return control to the debugger At the end of the modification session, you are prompted whether or not to update the NVRAM. Enter Y to cause the update to occur; any other response terminates the update (disregards all changes). The update also recalculates the checksum. Note Be careful when modifying parameters. Correct board operation relies upon these parameters. In the event of corruption of the board information block, the command displays question marks for nondisplayable characters. A warning message is also displayed in the event of a checksum failure. Note 3-32 When upgrading from an earlier version of the firmware, prior to PPC1BUG 1.7, it may be necessary to match the processor and bus clock frequencies to those displayed by the firmware during sign on. This only needs to be done if the firmware complains that there is a mismatch in values. To correct it, invoke CNFG;M from the firmware command line to correct the mismatched values. Computer Group Literature Center Web Site Debugger Commands Examples Example 1: Shown below is a sample of a valid board information block: PPC1-Bug>CNFG Board (PWA) Serial Number= “MOT000061050” Board Identifier= “MVME2603-001” Artwork (PWA)= “01-W3015F01A” MPU Clock Speed= “233” Bus Clock Speed= “067” Ethernet Address= 08003E20C983 Primary SCSI Identifier= “07” System Serial Number= “163725” System Identifier= “Motorola Series E603-166P” License Identifier= “12345678” PPC1-Bug> 3 Example 2: Shown below is a board information block with corrupted data. PPC1-Bug>CNFG WARNING: Board Information Block Checksum Error Board (PWA) Serial Number = "????????????" Board Identifier = "????????????????" Artwork (PWA) Identifier = "????????????????" MPU Clock Speed = "????" Bus Clock Speed = "????" Ethernet Address = 000000000000 Primary SCSI Identifier = "??" System Serial Number = "?????????????" System Identifier = "?????????????????????????" License Identifier = "12345678 " PPC1-Bug> http://www.motorola.com/computer/literature 3-33 Debugger Commands Example 3: Modify the Board Information Block. PPC1-Bug>CNFG;M WARNING: Board Information Block Checksum Error Board (PWA) Serial Number = "????????????"? MOT000061050 Board Identifier = "????????????????"? MVME2603-001 Artwork (PWA) Identifier = "????????????????"? 01-W3015F01A MPU Clock Speed = "????"? 233 Bus Clock Speed = "????”? 067 Ethernet Address = 000000000000? 08003E20C983 Primary SCSI Identifier = "??"? 07 System Serial Number = "163725 " System Identifier = "Motorola Series E603-166P " License Identifier = "12345678 " Update Non-Volatile RAM (Y/N)? y PPC1-Bug> 3 Example 4: View the Board Information Block and the updates. PPC1-Bug>CNFG Board (PWA) Serial Number Board Identifier Artwork (PWA) Identifier MPU Clock Speed = “233” Bus Clock Speed Ethernet Address Primary SCSI Identifier System Serial Number System Identifier License Identifier PPC1-Bug> 3-34 = "MOT000061050" = "MVME2603-001 " = "01-W3015F01A " = = = = = = "067” 08003E20C983 "07" "163725 " "Motorola Series E603-166P " "12345678 " Computer Group Literature Center Web Site Debugger Commands CS - Checksum Command Input 3 CS RANGE [;B|H|W] Options B Byte H Half-word W Word Description The CS command calculates a checksum to verify the contents of a block of memory. It uses the same checksum routine that is run at system startup. The checksum algorithm works as follows: 1. The checksum variable is set to zero. 2. Each data element is added to the checksum. If a carry is generated, a one is added to the checksum variable. This process is repeated for each data element until the ending address is reached. The option field serves both as a data size identifier and scale factor if a COUNT is specified as part of the RANGE. The size option is byte, halfword, or word for the items checked. The default data size is word. The addresses used in the RANGE parameters can be provided in two forms: ❏ An absolute address (32-bit maximum). ❏ An expression using a displacement + relative offset register. http://www.motorola.com/computer/literature 3-35 Debugger Commands Examples Example 1: Default size is word. PPC1-Bug>CS 1000 2000 Effective address: 00001000 Effective address: 00001FFF Checksum: FF8D3E87 PPC1-Bug> 3 Example 2: Size is set to half-word. PPC1-Bug>CS 1000 2000;H Effective address: 00001000 Effective address: 00001FFF Checksum: 3E15 PPC1-Bug> Example 3: Size is set to byte, COUNT is in hexadecimal. PPC1-Bug>CS FF800000:400;B Effective address: FF800000 Effective count : &1024 Checksum: 1C PPC1-Bug> Example 4: Default size is word, COUNT is in hexadecimal. PPC1-Bug>CS FF800000:400 Effective address: FF800000 Effective count : &4096 Checksum: 00B50D05 PPC1-Bug> 3-36 Computer Group Literature Center Web Site Debugger Commands CSAR - PCI Configuration Space READ Access Command Input 3 CSAR busnum devnum function addr [;B|H|W] Options B Byte H Half-word W Word (default) Description The CSAR command reads the location in PCI configuration space of the device at the PCI bus number specified by: busnum = the PCI bus number to be read devnum = the device number to be read function = the device function number to be read addr = the offset into the device configuration registers. addr must be between 0 and 255 decimal. size (optional) = the size of the location to be read CSAR displays the value read. Example: To read the register at offset 8 of the PCI device on PCI bus 0, which has a device ID of 12 (decimal), and function 0 of that device, do: PPC1-Bug>csar 0 c 0 8 Read Data = 01000013 PPC1-Bug> http://www.motorola.com/computer/literature 3-37 Debugger Commands CSAW - PCI Configuration Space WRITE Access Command Input 3 CSAW busnum devnum function addr data [;B|H|W] Options B Byte H Half-word W Word (default) Description The CSAW command writes data to the location of the device in PCI configuration space at the PCI bus number specified by: busnum = the PCI bus number to be read devnum = the device number to be read function = the device function number to be read addr = the offset into the device configuration registers. addr must be between 0 and 255 decimal. data = the data that should be written size (optional) = the size of the location to be read Example: To write the hexadecimal number a into the byte register at offset 3C of the PCI device on PCI bus 0, which has a device ID of 12 (decimal), and function 0 of that device, do: PPC1-Bug>csaw 0 c 0 3C a;b PPC1-Bug> 3-38 Computer Group Literature Center Web Site Debugger Commands DC - Data Conversion Command Input 3 DC EXP | ADDR [;[B] [O] [A]] Options B Display the output in binary O Display the output in octal A Display the ASCII character equal to the value. If the value is greater than $7F, the A option displays NA. Description The DC command calculates an expression into a single numeric value. This equivalent value is displayed in its hexadecimal and decimal representation. If the numeric value could be interpreted as a signed negative number (i.e., if the most significant bit of the 32-bit internal representation of the number is set), then both the signed and unsigned interpretations are displayed. Examples Example 1: PPC1-Bug>DC 10 00000010 = $10 = &16 PPC1-Bug> Example 2: PPC1-Bug>DC &10-&20 SIGNED : FFFFFFF6 = -$A = -&10 UNSIGNED: FFFFFFF6 = $FFFFFFF6 = &4294967286 PPC1-Bug> Example 3: PPC1-Bug>DC 123+&345+@67+%1100001 00000314 = $314 = &788 PPC1-Bug> http://www.motorola.com/computer/literature 3-39 Debugger Commands Example 4: PPC1-Bug>DC (2*3*8)/4 0000000C = $C = &12 PPC1-Bug> 3 Example 5: PPC1-Bug>DC 55&F 00000005 = $5 = &5 PPC1-Bug> Example 6: PPC1-Bug>DC 55>>1 0000002A = $2A = &42 PPC1-Bug> Example 7: PPC1-Bug>DC 1+2;B DATA BIT: 33222222222211111111110000000000 NUMBER>>: 10987654321098765432109876543210 BINARY : 00000000000000000000000000000011 PPC1-Bug> Example 8: PPC1-Bug>DC 1+2;BO DATA BIT: 33222222222211111111110000000000 NUMBER>>: 10987654321098765432109876543210 BINARY : 00000000000000000000000000000011 OCTAL : 00000000003 PPC1-Bug> Example 9: PPC1-Bug>DC 1+2;BOA DATA BIT: 33222222222211111111110000000000 NUMBER>>: 10987654321098765432109876543210 BINARY : 00000000000000000000000000000011 OCTAL : 00000000003 ASCII : ETX PPC1-Bug> 3-40 Computer Group Literature Center Web Site Debugger Commands Example 10: For this example, assume R2=00030000 and the following data resides in memory: 00030000 11111111 22222222 33333333 44444444 ....""""3333DDDD 3 PPC1-Bug>DC R2 00030000 = $30000 = &196608 PPC1-Bug> http://www.motorola.com/computer/literature 3-41 Debugger Commands DMA - Block of Memory Move Note 3 This command works on boards with a VME2 bridge only. Command Input DMA RANGE ADDR VDIR AM BLK [;B|H|W] Arguments 3-42 VDIR Direction of the transfer. 0 means the transfer occurs from the local bus to the VMEbus; 1 means the transfer occurs from the VMEbus to the local bus. AM VMEbus address modifier of the transfer. Refer to the VMEbus specification for the complete list of address modifiers. The VMEbus transfer address must also support transfers with the selected address modifier. Refer to the applicable board installation and use manual. BLK Block transfer mode, which can be one of the following: 0 Block transfers disabled. 1 The DMA controller executes D32 block transfer cycles on the VMEbus. In the block transfer mode, the DMA controller may execute byte and two-byte cycles at the beginning and ending of a transfer in non-block transfer mode. 2 Block transfers disabled. 3 The DMA controller executes D64 block transfer cycles on the VMEbus. In the block transfer mode, the DMA controller may execute byte, two-byte, and four-byte cycles at the beginning and ending of a transfer in non-block transfer mode. Computer Group Literature Center Web Site Debugger Commands Options B Byte H Half-word W Word 3 Description The DMA command moves blocks of data from the local bus to the VMEbus, or from the VMEbus to the local bus. This command. utilizes the hardware capability of Direct Memory Access (DMA). Refer to the board installation and use manual for a detailed description of DMA. You can not perform a DMA from the local bus to the local bus, or from the VMEbus to the VMEbus. The DMA command copies (DMAs) the contents of the memory addresses defined by RANGE to another place in memory, beginning at ADDR. The option field is only allowed when RANGE is specified using a COUNT. In this case, the B, H, or W defines the size of the data to which the COUNT is referring. For example, a COUNT of four with an option of W means to move four words (or 16 bytes) to the new location. If an option field is specified without a COUNT in the RANGE, an error results. The default data type is word. Refer to the VMEbus specification for the complete description of block transfer mode. The VMEbus transfer address must also support block transfers if enabled, refer to the applicable board installation and use manuals. At the end of the transfer, the DMA command displays the completion status of the transfer. A completion status of $1 is a successful transfer. Any other completion status means that the transfer was not successful. This status comes directly from the hardware status from the DMA controller. Note If the block transfer modes are used to transfer data make sure that your VMEbus and VME memory actually support the block transfer modes. http://www.motorola.com/computer/literature 3-43 Debugger Commands When the command is given on a non-VMEbus board, the following message is shown: This system does not host a VMEbus. 3 Be sure to set the high bit when specifying the address for the local memory. Setting the high bit directs the address to the PCI bus. The PCI bus actually strips the high bit and passes the address onward. When specifying the VMEbus address, be sure to specify the exact VME memory address (refer to the examples below). Refer to the board installation and use manual for information on the VMEbus. Memory Location (Processor View) As Used in the DMA Command $0 $80000000 $4000 $80004000 $C1000000 $01000000 $C1002000 $01002000 Examples Example 1: Transfer data from the VMEbus to the local bus with D32 block transfer cycles. Fill memory on the VMEbus with an incrementing pattern (starts with a value of 0 and increments by 4). This makes it easier to illustrate some memory moves (DMAs) between the local bus and the VMEbus. PPC1-Bug>BF C1000000 C2000000 0 4 Effective address: C1000000 Effective address: C1FFFFFF PPC1-Bug> First a range is given for the source location of the data on the VMEbus. Note that this is an exact address on the VMEbus. (From the beginning of the VME memory ($01000000 to $01800000). 3-44 Computer Group Literature Center Web Site Debugger Commands The destination for the memory transfer is back to local memory on the board beginning at $0. Notice, that on the destination address the high bit is set. This is due to the PCI bus, the PCI bus masks the high bit and the actual data transfer maps to $0 (the beginning of local memory). The VDIR argument is specified as $1 here because the transfer in this case should occur from the VMEbus to the local bus. The AM parameter is specified as $D to indicate (Extended Supervisory Data Access) for a simple data transfer. In this case, the block transfer was set to $1 which means that the DMA controller executes D32 block transfer cycles on the VMEbus. PPC1-Bug>DMA 01000000 01800000 80000000 1 d 1 Effective address: 01000000 Effective address: 017FFFFF Effective address: 80000000 DMA Completion Status =00000001 PPC1-Bug> By displaying the local memory which was the destination for the transfer we can see that the data from the VMEbus was transferred to local memory. PPC1-Bug>MDS 0 00000000 00000000 00000004 00000010 00000010 00000014 00000020 00000020 00000024 00000030 00000030 00000034 00000040 00000040 00000044 00000050 00000050 00000054 00000060 00000060 00000064 00000070 00000070 00000074 00000080 00000080 00000084 00000090 00000090 00000094 000000A0 000000A0 000000A4 000000B0 000000B0 000000B4 000000C0 000000C0 000000C4 000000D0 000000D0 000000D4 000000E0 000000E0 000000E4 000000F0 000000F0 000000F4 00000100 00000100 00000104 00000110 00000110 00000114 00000120 00000120 00000124 00000130 00000130 00000134 00000140 00000140 00000144 http://www.motorola.com/computer/literature 00000008 00000018 00000028 00000038 00000048 00000058 00000068 00000078 00000088 00000098 000000A8 000000B8 000000C8 000000D8 000000E8 000000F8 00000108 00000118 00000128 00000138 00000148 0000000C 0000001C 0000002C 0000003C 0000004C 0000005C 0000006C 0000007C 0000008C 0000009C 000000AC 000000BC 000000CC 000000DC 000000EC 000000FC 0000010C 0000011C 0000012C 0000013C 0000014C ................ ................ ... ...$...(..., ...0...4...8...< ...@...D...H...L ...P...T...X...\ ...‘...d...h...l ...p...t...x...| ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ... ...$...(..., ...0...4...8...< ...@...D...H...L 3-45 3 Debugger Commands 00000150 00000160 00000170 00000180 00000190 000001A0 000001B0 000001C0 000001D0 000001E0 000001F0 PPC1-Bug> 3 00000150 00000160 00000170 00000180 00000190 000001A0 000001B0 000001C0 000001D0 000001E0 000001F0 00000154 00000164 00000174 00000184 00000194 000001A4 000001B4 000001C4 000001D4 000001E4 000001F4 00000158 00000168 00000178 00000188 00000198 000001A8 000001B8 000001C8 000001D8 000001E8 000001F8 0000015C 0000016C 0000017C 0000018C 0000019C 000001AC 000001BC 000001CC 000001DC 000001EC 000001FC ...P...T...X...\ ...‘...d...h...l ...p...t...x...| ................ ................ ................ ................ ................ ................ ................ ................ Example 2: Transfer data from the local bus to the VMEbus using D32 block transfer cycles. PPC1-Bug>DMA 80000000 80800000 01000000 0 d 1 Effective address: 80000000 Effective address: 807FFFFF Effective address: 01000000 DMA Completion Status =00000001 PPC1-Bug> We can use the block verify command to show that the incrementing pattern was copied to the destination VMEbus memory. PPC1-Bug>BV C1000000 C1800000 0 4 Effective address: C1000000 Effective address: C17FFFFF PPC1-Bug> Example 3: Transfer data from the local bus to the VMEbus. First, show the data at the destination so we can see it change. PPC1-Bug>MD 100000:40 00100000 7C3043AF 7CFFFBBF 7C3143A7 00100010 00000001 00FFFC0F 00000003 00100020 00048003 00FFFFFF 00000008 00100030 0000000F 00FFFFFF 0000000D 00100040 00000000 00FFF10F 0000000E 00100050 00000000 00FFF2EF 00000003 00100060 0000000E 00FFFFFF 0000000A 00100070 0000068E 00FFFFBF 00000001 00100080 00000002 00FFF39F 00000002 00100090 00000001 00FFF91F 00000003 001000A0 0000800F A0FFFFFF 0000020F 001000B0 0000000D 00FFFFEF 0000200E 3-46 48FFFFDF 00FFFFFF 00FFFEEF 00FFFEEF 00FFFD5F 00FFFFBF 00FFFEAF 00FFFEFF 00FFF39F 00FFFDDF 00FFF6EF 00FFF7FF |0C.|...|1C.H... ................ ................ ................ ..............._ ................ ................ ................ ................ ................ ................ .......... ..... Computer Group Literature Center Web Site Debugger Commands 001000C0 00000004 00FFF88F 00000005 00FFFF2F 001000D0 00000009 00FFF84F 00000005 00FFFDDF 001000E0 0008050F 00FFFFFF 0000000F 00FFFFFF 001000F0 0000000D 00FFFF2F 00000008 00FFF7EF PPC1-Bug>DMA 80100000:40 01000000 0 d 0;W Effective address: 80100000 Effective count : &256 Effective address: 01000000 DMA Completion Status =00000001 PPC1-Bug> .............../ .......O........ ................ ......./........ 3 In the above example, 256 bytes of data was moved from the local bus to the VMEbus. At the end of the transfer, the DMA command displays the completion status of the transfer. View the transferred data: PPC1-Bug>MD C1000000:40 C1000000 7C3043AF 7CFFFBBF 7C3143A7 C1000010 00000001 00FFFC0F 00000003 C1000020 00048003 00FFFFFF 00000008 C1000030 0000000F 00FFFFFF 0000000D C1000040 00000000 00FFF10F 0000000E C1000050 00000000 00FFF2EF 00000003 C1000060 0000000E 00FFFFFF 0000000A C1000070 0000068E 00FFFFBF 00000001 C1000080 00000002 00FFF39F 00000002 C1000090 00000001 00FFF91F 00000003 C10000A0 0000800F A0FFFFFF 0000020F C10000B0 0000000D 00FFFFEF 0000200E C10000C0 00000004 00FFF88F 00000005 C10000D0 00000009 00FFF84F 00000005 C10000E0 0008050F 00FFFFFF 0000000F C10000F0 0000000D 00FFFF2F 00000008 PPC1-Bug> 48FFFFDF 00FFFFFF 00FFFEEF 00FFFEEF 00FFFD5F 00FFFFBF 00FFFEAF 00FFFEFF 00FFF39F 00FFFDDF 00FFF6EF 00FFF7FF 00FFFF2F 00FFFDDF 00FFFFFF 00FFF7EF |0C.|...|1C.H... ................ ................ ................ ..............._ ................ ................ ................ ................ ................ ................ .......... ..... .............../ .......O........ ................ ......./........ Example 4: Transfer data from the VMEbus to the local bus. Display the 64 bytes of data on the VMEbus which are to be transferred. PPC1-Bug>MD C1000000:10 C1000000 5A5A5A5A 5A5A5A5A 5A5A5A5A C1000010 5A5A5A5A 5A5A5A5A 5A5A5A5A C1000020 5A5A5A5A 5A5A5A5A 5A5A5A5A C1000030 5A5A5A5A 5A5A5A5A 5A5A5A5A PPC1-Bug> http://www.motorola.com/computer/literature 5A5A5A5A 5A5A5A5A 5A5A5A5A 5A5A5A5A ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ 3-47 Debugger Commands Transfer the 64 bytes from the beginning of VMEbus memory to location $2000 in local memory. A display of the local memory shows the newly transferred data. 3 PPC1-Bug>DMA 01000000:10 80002000 1 D 0 Effective address: 01000000 Effective count : &64 Effective address: 80002000 DMA Completion Status =00000001 PPC1-Bug>MD 00002000:10 00002000 5A5A5A5A 5A5A5A5A 5A5A5A5A 5A5A5A5A 00002010 5A5A5A5A 5A5A5A5A 5A5A5A5A 5A5A5A5A 00002020 5A5A5A5A 5A5A5A5A 5A5A5A5A 5A5A5A5A 00002030 5A5A5A5A 5A5A5A5A 5A5A5A5A 5A5A5A5A ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZ Example 5: Attempt to DMA to non-existent VMEbus memory. The command displays the DMA controller status register and the DMA controller counter registers. PPC1-Bug>DMA 80000000:15 05000000 0 D 0;B Effective address: 80000000 Effective count : &21 Effective address: 05000000 DMA Completion Status =00000002 DMA Byte Counter =00000000 DMA Local Bus Address Counter =80000015 DMA VMEbus Address Counter =05000004 PPC1-Bug> 3-48 Computer Group Literature Center Web Site Debugger Commands DS - One-Line Disassembler Command Input 3 DS ADDR [:COUNT | ADDR] Description The DS command enables the one-line disassembler. This command is synonymous with the Memory Display (MD) command when used with the DI option (MD ADDR;DI). Refer to MD, MDS - Memory Display on page 3-125 for details. Refer to Chapter 4 for information on using the oneline assembler. http://www.motorola.com/computer/literature 3-49 Debugger Commands DU - Dump S-Records Command Input 3 DU [PORT] RANGE [TEXT] [ADDR] [OFFSET] [;B|H|W] Description The DU command outputs data from memory in the form of Motorola Srecords to a port you specified. If port is not specified, the S-records are sent to the host port, and the missing port number must be delimited by two commas. A size option is allowed only if a COUNT was entered as part of the RANGE, and defines the units of the COUNT. The default data type is byte. The optional TEXT argument is for text that will be incorporated into the header (S0) record of the block of records that will be dumped. The optional ADDR argument is to allow you to enter an entry address for code contained in the block of records. This address is incorporated into the address field of the block termination record. If no entry address is entered, then the address field of the termination record will consist of zeros. The termination record will be an S7, S8, or S9 record, depending on the address entered. Appendix D has additional information on Srecords. You may also specify an optional offset in the OFFSET argument. The offset value is added to the addresses of the memory locations being dumped, to come up with the address which is written to the address field of the S-records. This allows you to create an S-record file which will load back into memory at a different location than the location from which it was dumped. The default offset is zero. Note 3-50 If an offset is to be specified but no entry address is to be specified, then two commas (indicating a missing field) must precede the offset to keep it from being interpreted as an entry address. Computer Group Literature Center Web Site Debugger Commands Examples Example 1: Dump memory from $20000 to $2002F to port 1. PPC1-Bug>DU ,,20000 2002F Effective address: 00020000 Effective address: 0002002F PPC1-Bug> 3 Example 2: Dump 10 bytes of memory beginning at $30000 to the terminal screen (port 0). PPC1-Bug>DU 0 30000:&10 Effective address: 00030000 Effective count : &10 S0030000FC S20E03000026025445535466084E4F7B S9030000FC PPC1-Bug> Example 3: Dump memory from $20000 to $2002F to host (port 1). Specify a file named TEST in the header record and specify an entry point of $2000A. PPC1-Bug>DU ,,20000 2002F ’TEST’ 2000A Effective address: 00020000 Effective address: 0002002F PPC1-Bug> http://www.motorola.com/computer/literature 3-51 Debugger Commands ECHO - Echo String Command Input 3 ECHO [PORT] {hexadecimal number} {’string’} Description The ECHO command displays strings to a configured port. ASCII strings can be entered by enclosing them in single quotes (’). To include a quote as part of a string, enter two consecutive quotes. The hexadecimal number allows printing , , and other control symbols. A hexadecimal number must have two digits before it is displayed. Note that one or more hexadecimal numbers and ASCII strings may be entered in the same command. If the port number is not specified (substituted by commas), ECHO uses the current console port. Examples Example 1: Display the ASCII string to the current console port. PPC1-Bug>ECHO ,,’quick brown fox jumps over the lazy dog’ 0A quick brown fox jumps over the lazy dog PPC1-Bug> Example 2: Send the ASCII string and a BELL character to port #1. PPC1-Bug>ECHO 1 ’this is a test’ 07 PPC1-Bug> Example 3: In this example an error message results because the selected port is not configured. PPC1-Bug>ECHO 2 ’this is a test’ Logical unit $02 unassigned PPC1-Bug> 3-52 Computer Group Literature Center Web Site Debugger Commands Example 4: This example handles a string with quotes. PPC1-Bug>ECHO ,, ’This is "PPCBUG"’ This is “PPCBUG” PPC1-Bug> http://www.motorola.com/computer/literature 3 3-53 Debugger Commands ENV - Set Environment Command Input 3 ENV [;[D]] Description The ENV command allows you to view and configure all PPCBug operational parameters that are kept in Non-Volatile RAM (NVRAM). The operational parameters are saved in NVRAM and used whenever power is lost. (The NVRAM is also known as the Battery Backed Up RAM.) Any time PPCBug uses a parameter from NVRAM, the NVRAM contents are first tested by checksum to insure the integrity of the NVRAM contents. In the instance of NVRAM checksum failure, certain default values are assumed. The debugger operational parameters (which are kept in NVRAM) are not initialized automatically on power-up/warm reset. It is up to you to invoke the ENV command. Once the ENV command is invoked and executed without error, debugger default and/or user parameters are loaded into NVRAM along with checksum data. If any of the operational parameters have been modified, these new parameters will not be in effect until a reset or power-up condition. If the ENV command is invoked with the D option, ROM defaults will be loaded into NVRAM. If the ENV command is invoked without the D option, you are prompted to configure all operational parameters. You may change the displayed value by typing a new value, followed by the Return key. To leave the field unaltered, press the Return key without typing a new value. Refer to the board installation and use manual for the location and contents of the board information block, and the size and logical offset of each element. Note 3-54 Not all ENV parameters are shown in this manual. Computer Group Literature Center Web Site Debugger Commands You may also enter a special character, either at the prompt or after typing new data, for scrolling through the fields. The special characters are: V or v Go to the next field. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up to the previous field. This remains in effect until changed by entering one of the other special characters. = Re-open the same field . Terminate the ENV command, and return control to the debugger Programming The VMEbus Slave Image Map Decoders. The VMEbus slave image map decoders allow a VMEbus master to access the resources on the local primary PCI bus, and control the type of access to those resources. These decoders are located in the Universe VMEbus interface chip. The following general procedure can be used with the ENV command to configure the VMEbus slave image map decoders. This is not the only procedure that can be used to program the map decoders. More complete information on this subject can be found in the User’s Manual for the Universe chip, the VMEbus specification, the PCI bus specification, and the Programmer’s Guide for the specific board being used. 1. Determine the desired VMEbus base address. This is the starting, or lowest, address that any resource on the local PCI bus can be accessed on the VMEbus. This address must not allow an overlap of the Universe’s control and status registers or any other VMEbus resource’s address space. The first VMEbus slave decoder (for VME slave image 0) has a 4K-byte resolution but VMEbus slave images 1, 2, and 3, have a 64K-byte resolution. 2. Determine the desired VMEbus bound address. This is the ending, or highest, address that any resource on the local PCI bus can be accessed on the VMEbus. The address on the VMEbus must lie within the window defined by the base and bound addresses to gain a response. 3. Determine any necessary VMEbus translation offset. The offset value is added to the VMEbus address to create the PCI bus address. http://www.motorola.com/computer/literature 3-55 3 Debugger Commands 4. Determine the necessary VMEbus slave image control. The value used for slave image control is made up of several bit fields which specify how reads and writes will be processed by the Universe device. The desired value can be determined by progressively ORing together the selected bit fields described below. 3 To select the type of PCI address space that will respond in the defined VMEbus window, use the following: 0x00000000 for PCI Memory space, zero no bits are set. 0x00000001 for PCI I/O space. 0x00000002 for PCI Configuration space. To lock PCI transactions resulting from VMEbus Read-ModifyWrites, OR the following value with that chosen above: 0x00000040 To enable 64-bit PCI transactions, OR the following value with those chosen above: 0x00000080 To select the VMEbus address space accesses to decode, OR the value defined here with those chosen above: 0x00000000 for A16 space, zero no bits are set. 0x00010000 for A24 space. 0x00020000 for A32 space. To select the mode of VMEbus accesses to decode, OR the value defined here with those chosen above: 0x00100000 for non-privileged. 0x00200000 for supervisor. 0x00300000 for both non-privileged and supervisor, two bits set. To select the type of VMEbus accesses to decode, OR the value defined here with those chosen above: 0x00400000 for data. 0x00800000 for program. 0x00C00000 for both data and program, two bits are set. To enable prefetch reads for incoming VMEbus block read cycles, OR the following value with those chosen above: 0x20000000 To enable posted writes of incoming data on the VMEbus, OR the following value with those chosen above: 0x40000000 3-56 Computer Group Literature Center Web Site Debugger Commands To enable the selected VME Slave Image Map Decoder, OR the following value with those chosen above: 0x80000000 As an example, a control value of: 0xE0F20000 decodes A32, non-privileged and supervisor, data and program VMEbus space, with prefetch reads, and posted writes enabled. It is the user’s responsibility to ensure that the selected control bits are not destructive, and that the resources present on the VMEbus and PCI bus support the access and transaction controls chosen. ENV Command Parameters The parameters that can be configured with ENV are listed and described in your board-specific installation and use manual. Systems with Wide SCSI Drives Running AIX If AIX (or some other OS) is booted on a system with wide SCSI drives, and then the system is reset, PPCBug will not be able to access the wide SCSI drives. This problem may be corrected by running ENV and enabling PPCBug to reset the SCSI bus on startup as follows: Local SCSI Bus Reset on Debugger Startup [Y/N] = N? y This ENV change should be made to all PowerPlus architecture systems running AIX. Note This problem is fixed in PPCBug release 3.2 and later. LED/Serial Startup Diagnostic Codes These codes can be displayed at key points in the initialization of the hardware devices. Should the debugger fail to come up to a prompt, the last code displayed will indicate how far the initialization sequence had progressed before stalling. The codes are enabled by an ENV parameter: Serial Startup Code Master Enable [Y/N]=N? A line feed can be inserted after each code is displayed to prevent it from being overwritten by the next code. This is also enabled by an ENV parameter: http://www.motorola.com/computer/literature 3-57 3 Debugger Commands Serial Startup Code LF Enable [Y/N]=N? The list of LED/serial codes is included in the section on MPU, Hardware, and Firmware Initialization in Chapter 1. 3 Memory Usage Control The amount of RAM that PPCBug uses may be contained with an NVRAM parameter. This parameter is set by the ENV line: Maximum Memory Usage (Mb, 0=AUTO) = 1? If the parameter is set to a non-zero value, it is interpreted as the maximum number of megabytes that PPCBug is allowed to control. At start-up, one megabyte at the top of physical memory is set aside. If more than this is required, allocation is expanded toward smaller addresses unless the specified maximum value is achieved. If this occurs, the current memory request will be denied followed, most likely, by failure of the current activity. If the parameter is set to zero, expansion is unlimited. In no case, however, is expansion allowed to exceed one-half of the available memory regardless of how high the parameter is set. Two things should be considered in setting this parameter: 1. Memory, once acquired, is never returned. The total memory used sets the system’s maximum use level. This number may be obtained using the Memory Manager Query command (MMGR). 2. Expansion is incremental and on demand. Only what is actually required will be used. Thus, the total used is the system’s current maximum usage level gauge. This number may be obtained, after the system has exercised, using the Memory Manager Query command (MMGR). 3-58 Computer Group Literature Center Web Site Debugger Commands FORK - Fork Idle MPU at Address Note This command is for multi-processor boards only. 3 Command Input FORK MPU# ADDR Description The FORK command allows you to fork an idle processor to target code that is pointed to by the ADDR argument. The MPU# argument depends on your configuration and idle processors present. It is the target code’s responsibility to load the processor’s registers. Once a processor is forked, the only means back to the idle state would be by execution of the system call .IDLEMPU. Refer to the System Calls chapter in this manual for the description of the system call. To inquire of the BUG about idle processors, refer to the RUN command. Example Fork processor #1 to address $10000. PPC1-Bug>fork 1 10000 PPC1-Bug> http://www.motorola.com/computer/literature 3-59 Debugger Commands FORKWR - Fork Idle MPU with Registers Note 3 This command is for multi-processor boards only. Command Input FORKWR MPU# Description The FORKWR command allows you to fork an idle processor to target code. The associated register set is loaded before execution. The MPU# argument depends on your configuration and idle processors present. The idle processor’s registers can be examined/modified by the commands IRD, IRM, and IRS. Once a processor is forked, the only means back to the idle state would be by execution of the system call .IDLEMPU. Refer to the System Calls chapter in this manual for the description of the system call. To inquire of the BUG about idle processors, refer to the RUN command. Example Fork processor #1. PPC1-Bug>forkwr 1 PPC1-Bug> 3-60 Computer Group Literature Center Web Site Debugger Commands GD - Go Direct (Ignore Breakpoints) Command Input 3 GD [ADDR] Description The GD command starts target code execution. If an address is specified, it is placed in the target IP. Execution starts at the target IP address. Unlike GO, breakpoints are not inserted. Once execution of the target code has begun, control may be returned to the debugger by one of the following conditions: ❏ The abort or reset switch on the debugger host was pressed. ❏ An unexpected exception occurred. Example The following program resides at $20000. PPC1-Bug>DS 20000:10 00020000 3C600004 ADDIS 00020004 60631000 ORI 00020008 7C641B78 OR 0002000C 3CA00005 ADDIS 00020010 60A51000 ORI 00020014 3CC00000 ADDIS 00020018 90C40000 STW 0002001C 38840004 ADDI 00020020 7F042840 CMPL 00020024 409AFFF4 BC 00020028 38C60001 ADDI 0002002C 38E7FFFF ADDI 00020030 7C641B78 OR 00020034 2B070000 CMPLI 00020038 409AFFE0 BC 0002003C 00000000 WORD PPC1-Bug> R3,R0,$4 R3,R3,$1000 R4,R3,R3 R5,R0,$5 R5,R5,$1000 R6,R0,$0 R6,$0(R4) ($00041000) R4,R4,$4 CRF6,0,R4,R5 4,26,$00020018 R6,R6,$1 R7,R7,$FFFFFFFF R4,R3,R3 CRF6,0,R7,$0 4,26,$00020018 $00000000 Set breakpoint at $20028. http://www.motorola.com/computer/literature 3-61 Debugger Commands PPC1-Bug>BR 20028 BREAKPOINTS 00020028 PPC1-Bug> 3 Initialize R7 and start target the program. PPC1-Bug>RM R7 R7 =00000000 ? FFFFFFFF. PPC1-Bug> PPC1-Bug>GD 20000 Effective address: 00020000 To exit target code, press the abort switch. Note that the breakpoint was not taken. Exception: System Reset (Soft) SRR0 =00020020 SRR1 =00003030 Vector-Offset =00100 IP =00020020 MSR =00003030 CR =00000080 FPSCR R0 =00000000 R1 =00020000 R2 =10000001 R3 R4 =000410F4 R5 =00051000 R6 =00009A46 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00000000 SPR9 00020020 7F042840 CMPL CRF6,0,R4,R5 PPC1-Bug> 3-62 =00000000 =00041000 =FFFF65B9 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Computer Group Literature Center Web Site Debugger Commands GEVBOOT - Global Environment Variable Boot Command Input 3 GEVBOOT Variable-Name Description The GEVBOOT command permits the user to boot the system using a Global Environment Variable, Variable-Name, which is a “fw-boot-path”. Background: Residual Data and Boot List Recent releases of IBM AIX requires that the PReP style of residual data be provided by the system firmware. Previous releases of IBM's AIX did not require that residual data be implemented. Residual data, basically, informs the operating system of the system attributes (i.e., what devices are present, how are they configured, are they bootable?, etc.). To some degree, it is an abstraction of the hardware that the system firmware provides. IBM has further defined what residual data should look like now. This latest version of IBM AIX also requires that the system firmware must support a boot list. This boot list contains a list of bootable devices that the firmware utilizes to boot the system. This boot list is housed within a Global Environment Variable (GEV). The GEVs are kept in the PReP partition of NVRAM, more specifically, the global environment variable area. Through this GEV, the OS/user can configure the system for its boot device selection policy. This latest version of IBM AIX also requires that the system firmware support the PReP style of network booting. The PReP style of network boot treats the network boot image the same as a mass storage (e.g., hard disk, floppy) boot image. The network boot feature facilitates AIX network install manager (NIM) feature. http://www.motorola.com/computer/literature 3-63 Debugger Commands Requirements Some high-level requirements that this release meets are: 3 ❏ Residual Data as specified above. ❏ Boot List Support via "fw-boot-path", "fw-boot-device", and "bootfile" global environment variables ❏ Network Boot, PReP style ❏ OEM Banner support ❏ Initialization of the PIRQx (PCI Interrupts) route control registers. ❏ System uniqueness (i.e., board serial number) The "boot list" and "OEM banner support" requirements require that the firmware be capable of reading and writing global environment variables. These variables are housed within the global environment area of NVRAM (i.e., the PReP partition). Each mass storage device, and network interface supported from the firmware must identify itself. This identification is per the firmware device naming convention, as outlined in the IBM document. The device naming convention follows the Open Firmware device naming convention. The GE variables, "fw-boot-path" and "fw-boot-device", consist of device names. Global Environment Variables (GEVs) The product supports the following GEVs: 3-64 ❏ MOT-OEM-BANNER This variable is used by the firmware to display the OEM banner (if initialized). The contents of this GEV are displayed prior to the display of the firmware copyright message. ❏ MOT-OEM-ID This variable is used by the firmware to apply any special switches, product variations, other alterations as needed. Computer Group Literature Center Web Site Debugger Commands ❏ fw-boot-path This variable contains a list (four maximum) of boot devices which can be booted from. The OS maintains this variable. This is a readonly variable from the firmware’s perspective. (The firmware does not impose any limit upon the length of this list.) However, this variable may be modified by utilizing the GEVEDIT command. ❏ fw-boot-device This variable contains the boot device path from the current boot device (i.e., the device just booted from, mass storage or network). This variable is updated on each successful boot (i.e., IPL loaded). ❏ ClientIPAddr This variable is updated on each successful network boot. It contains the client’s internet protocol address. ❏ ServerIPAddr This variable is updated on each successful network boot. It contains the server’s internet protocol address. ❏ GatewayIPAddr This variable is updated on each successful network boot.It contains the gateway internet protocol address to the server. ❏ NetMask This variable is updated on each successful network boot. It contains the internet protocol address mask. The mask is applied to both the server’s and client’s IP address to determine if the gateway must be used. ❏ boot-file This variable is updated on each successful network boot. It contains the name of the boot file. http://www.motorola.com/computer/literature 3-65 3 Debugger Commands Styles of Booting The older Motorola mode of mass storage device booting was also preserved for backward compatibility. However, priority is given to the new style of booting (i.e., NVRAM boot list). 3 The older product supports booting from the network. However, it does not support it as per the PReP specification. The PReP specification specifies the boot image from a mass storage device to be the same when booting from a network interface. The older support treats the network boot image as a raw binary, no format understood. The new support understands the PReP boot image. The PReP boot image does have a defined format. The network boot image may be loaded any where in memory, as per the PReP specification. Support has been added to the product to enable the PReP style of networking booting. The former style is also preserved for backward compatibility. However, priority is given to the new style of network booting. This capability is in the form of a new ENV parameter. Both styles of network booting are supported. The new style of networking booting (i.e., PReP) is controlled by an ENV configuration parameter. The default state of the ENV configuration parameter is set to enable the PReP style of network booting. Disabling this parameter will effectively default the network boot process to the past mode of network booting (i.e., no file format understood). This support is identified by the following ENV parameter: Network PReP-Boot Mode Enable [Y/N], defaults to ’Y’ PPC1Bug revision 1.8 added a new global environment variable (GEV) "fw-boot-path" boot to the global firmware boot process. The boot priority, for both mass storage device boot and network interface boot, is given first to the "fw-boot-path" GEV. To support this, a new boot process has been added. This boot process is labeled "NVRAM Boot List" boot.This new boot process is identified by the ENV command parameters of: NVRAM Boot List (GEV.fw-boot-path) Boot Enable [Y/N], defaults to ’Y’ NVRAM Boot List (GEV.fw-boot-path) Boot at power-up only [Y/N], defaults to ’N’ NVRAM Boot List (GEV.fw-boot-path) Boot Abort Delay, defaults to 5 3-66 Computer Group Literature Center Web Site Debugger Commands The default state of the ENV configuration parameter is set to ’Y’ for yes/enabled. This gives boot priority to the devices listed within the "fwboot-path" GEV. Setting this ENV configuration parameter to ’N’ for no/disabled, effectively changes the behavior of boot policy to the same behavior as prior products. If the "fw-boot-path" GEV is not initialized, this also effectively has the same behavior as prior products. This new boot takes priority over all other boots (i.e., Auto Boot, Network Boot). This boot may also be executed manually from the firmware command line via the GEVBOOT command. The following global environment variables are updated upon each successful network boot: fw-boot-device, ClientIPAddr, ServerIPAddr, GatewayIPAddr, NetMask, and boot-file. The "fw-boot-device" GEV is updated upon each boot instance. This is done regardless of the specified boot policy. Both the mass storage device boot module, and the network interface boot module are modified to set the GEV at every successful boot instance. The "fw-boot-path" GEV is a list (a maximum of four) of "fw-boot-device" GEVs. Boot priority is always given to the first device in the list. Example Show storage devices via ioi PPC1-Bug>ioi;d I/O Inquiry Status: CLUN DLUN CNTRL-TYPE DADDR DTYPE RM Inquiry-Data 1 0 PC8477 0 $00 Y Device-Name =/pci@80000000/pci8086,484@b,0/PNP0700@3f0/floppy@0 http://www.motorola.com/computer/literature 3-67 3 Debugger Commands fw-boot-path needs to be defined as a device that was shown to be available via ioi PPC1-Bug>gevshow fw-boot-device=/pci@80000000/pci1011,9@e,0:0,0 ClientIPAddr=144.191.24.121 ServerIPAddr=144.191.24.252 GatewayIPAddr=144.191.12.252 NetMask=255.255.255.0 boot-file=/usr/tmp/jdcham.ram fw-boot-path=/pci@80000000/pci8086,484@b,0/PNP0700@3f0/floppy@0 Total Number of GE Variables =7, Bytes Utilized =313, Bytes Free =1999 3 gevboot automatically uses fw-boot-device -- in this example it fails because there is no floppy in the drive with a bootable image PPC1-Bug>gevboot NVRAM Boot List about to Begin... Press to Bypass, to Continue Scanning System for Attached Boot Devices /pci@80000000/pci8086,484@b,0/PNP0700@3f0/floppy@0 /pci@80000000/pci1011,9@e,0:0,0 Attempting BOOT from Devices Specified by the GE Variable “fw-boot-path” /pci@80000000/pci8086,484@b,0/PNP0700@3f0/floppy@0 PPC1-Bug> 3-68 Computer Group Literature Center Web Site Debugger Commands GEVDEL - Global Environment Variable Delete Command Input 3 GEVDEL Variable-Name Description The GEVDEL command permits the user to selectively delete a Global Environment Variable, Variable-Name. Example PPC1-Bug>gevdel testvar testvar=12345 Update Global Environment Area of NVRAM (Y/N)? y PPC1-Bug> Show that the variable is deleted PPC1-Bug>gevshow fw-boot-device=/pci@80000000/pci1011,9@e,0:0,0 ClientIPAddr=144.191.24.121 ServerIPAddr=144.191.24.252 GatewayIPAddr=144.191.12.252 NetMask=255.255.255.0 boot-file=/usr/tmp/jdcham.ram Total Number of GE Variables =6, Bytes Utilized =184, Bytes Free =2128 PPC1-Bug> http://www.motorola.com/computer/literature 3-69 Debugger Commands GEVDUMP - Global Environment Variable(s) Dump Command Input 3 GEVDUMP Description The GEVDUMP command permits the user to dump to the console, in a hexadecimal/ASCII fashion, the contents of NVRAM (i.e., the PReP partition). These contents include the NVRAM Header + Data. Example PPC1-Bug>gevdump 01F8B000 01F8B010 01F8B020 01F8B030 01F8B040 01F8B050 01F8B060 01F8B070 01F8B080 01F8B090 01F8B0A0 01F8B0B0 01F8B0C0 01F8B0D0 01F8B0E0 01F8B0F0 3-70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 E8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 59 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 48 C3 00 00 00 00 00 00 00 00 00 00 00 F8 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 77 01 00 00 00 00 00 00 00 00 00 00 00 09 04 0A 2D 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D ......Y......... ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ....!’H.fw-boot- Computer Group Literature Center Web Site Debugger Commands 01F8B100 01F8B110 01F8B120 01F8B130 01F8B140 01F8B150 01F8B160 01F8B170 01F8B180 01F8B190 01F8B1A0 01F8B1B0 01F8B1C0 01F8B1D0 01F8B1E0 01F8B1F0 64 30 2C 64 32 31 61 2E 61 30 2F 00 00 00 00 00 65 30 30 64 31 34 74 31 73 00 74 00 00 00 00 00 76 30 3A 72 00 34 65 39 6B 62 6D 00 00 00 00 00 69 30 30 3D 53 2E 77 31 3D 6F 70 00 00 00 00 00 63 2F 2C 31 65 31 61 2E 32 6F 2F 00 00 00 00 00 65 70 30 34 72 39 79 31 35 74 6A 00 00 00 00 00 3D 63 00 34 76 31 49 32 35 2D 64 00 00 00 00 00 2F 69 43 2E 65 2E 50 2E 2E 66 63 00 00 00 00 00 70 31 6C 31 72 32 41 32 32 69 68 00 00 00 00 00 63 30 69 39 49 34 64 35 35 6C 61 00 00 00 00 00 69 31 65 31 50 2E 64 32 35 65 6D 00 00 00 00 00 40 31 6E 2E 41 32 72 00 2E 3D 2E 00 00 00 00 00 38 2C 74 32 64 35 3D 4E 32 2F 72 00 00 00 00 00 30 39 49 34 64 32 31 65 35 75 61 00 00 00 00 00 30 40 50 2E 72 00 34 74 35 73 6D 00 00 00 00 00 30 65 41 31 3D 47 34 4D 2E 72 00 00 00 00 00 00 device=/pci@8000 0000/pci1011,9@e ,0:0,0.ClientIPA ddr=144.191.24.1 21.ServerIPAddr= 144.191.24.252.G atewayIPAddr=144 .191.12.252.NetM ask=255.255.255. 0.boot-file=/usr /tmp/jdcham.ram. ................ ................ ................ ................ ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ : More stuff in between : 01F8BF00 01F8BF10 01F8BF20 01F8BF30 01F8BF40 01F8BF50 01F8BF60 01F8BF70 01F8BF80 01F8BF90 01F8BFA0 01F8BFB0 01F8BFC0 01F8BFD0 01F8BFE0 01F8BFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PPC1-Bug> http://www.motorola.com/computer/literature 3-71 3 Debugger Commands GEVEDIT - Global Environment Variable Edit Command Input 3 GEVEDIT Variable-Name Description The GEVEDIT command permits the user to selectively edit a Global Environment Variable, Variable-Name. This writing of new, or modification of existing, global environment variables, is available from the command line (i.e., on demand), or at any time within the product (i.e., a function call). Example PPC1-Bug>gevedit testvar testvar=12345 Update Global Environment Area of NVRAM (Y/N)? y PPC1-Bug> Show the new variable PPC1-Bug>gevshow fw-boot-device=/pci@80000000/pci1011,9@e,0:0,0 ClientIPAddr=144.191.24.121 ServerIPAddr=144.191.24.252 GatewayIPAddr=144.191.12.252 NetMask=255.255.255.0 boot-file=/usr/tmp/jdcham.ram testvar=12345 Total Number of GE Variables =7, Bytes Utilized =196, Bytes Free =2116 PPC1-Bug> 3-72 Computer Group Literature Center Web Site Debugger Commands GEVINIT - Global Environment Variable Initialization Command Input 3 GEVINIT Description The GEVINIT command permits the user to initialize the NVRAM Header (i.e., the PReP partition) information. Initialization of the NVRAM PReP partition is available from the command line (i.e., on demand), or at any time when the system’s firmware initializes itself (i.e., buginit()). The auto initializing of the NVRAM (PReP partition) header, is controlled by an ENV configuration parameter. The default state of this parameter is set to enabled. The following is the ENV parameter syntax: Auto-Initialize of NVRAM Header Enable [Y/N], defaults to ’Y’ If you answer Y, it will initialize the header; if you answer N, it won’t. Examples GEVINIT example with (yes) for update PPC1-Bug>gevinit Update Global Environment Area of NVRAM (Y/N)? y PPC1-Bug> GEVINIT example with (no) for update PPC1-Bug>gevinit Update Global Environment Area of NVRAM (Y/N)? n PPC1-Bug> http://www.motorola.com/computer/literature 3-73 Debugger Commands GEVSHOW - Global Environment Variable(s) Display Command Input 3 GEVSHOW [string] Description The GEVSHOW command permits the user to selectively display the contents of a currently configured global environment variable (by typing string, where string is the name of a variable), or to display all currently configured global environment variables. Reading of global environment variables (GEV read) is available from the command line (i.e., on demand), or at any time within the product (i.e., a function call). Example PPC1-Bug>gevshow fw-boot-device=/pci@80000000/pci1011,9@e,0:0,0 ClientIPAddr=144.191.24.121 ServerIPAddr=144.191.24.252 GatewayIPAddr=144.191.12.252 NetMask=255.255.255.0 boot-file=/usr/tmp/jdcham.ram Total Number of GE Variables =6, Bytes Utilized =184, Bytes Free =2128 PPC1-Bug> 3-74 Computer Group Literature Center Web Site Debugger Commands GN - Go to Next Instruction Command Input 3 GN Command Input The GN command sets a temporary breakpoint at the address of the next instruction (the instruction that follows the current instruction), and starts target code execution. After setting the temporary breakpoint, the sequence of events is similar to that of the GO command. GN is especially helpful when debugging modular code because it allows you to trace through a subroutine call as if it were a single instruction. Example The following section of code resides at address $20000. PPC1-Bug>DS 20000:6 00020000 3C600004 ADDIS 00020004 60631000 ORI 00020008 3C800000 ADDIS 0002000C 608400FE ORI 00020010 4800FFF1 BL 00020014 80620000 LWZ PPC1-Bug> R3,R0,$4 R3,R3,$1000 R4,R0,$0 R4,R4,$FE $00030000 R3,$0(R2) ($FFF0178C) The following simple routine resides at address $30000. PPC1-Bug>DS 30000 00030000 3CA00000 ADDIS 00030004 2B040000 CMPLI 00030008 419A0014 BC 0003000C 98A30000 STB 00030010 3884FFFF ADDI 00030014 38630001 ADDI 00030018 4BFFFFEC B 0003001C 4E800020 BCLR PPC1-Bug> http://www.motorola.com/computer/literature R5,R0,$0 CRF6,0,R4,$0 12,26,$0003001C R5,$0(R3) ($00000000) R4,R4,$FFFFFFFF R3,R3,$1 $00030004 20,0 3-75 Debugger Commands Execute up to the BL instruction. PPC1-Bug>RM IP IP =00020020 ? 20000. PPC1-Bug> 3 PPC1-Bug>GT 20010 Effective address: 00020010 Effective address: 00020000 At Breakpoint IP =00020010 MSR =00003030 CR =00000020 FPSCR R0 =00000000 R1 =00020000 R2 =FFF0178C R3 R4 =000000FE R5 =00000000 R6 =00000000 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00020014 SPR9 00020010 4800FFF1 BL $00030000 PPC1-Bug> =00000000 =00041000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Use the GN command to trace through the subroutine call and display the results. PPC1-Bug>GN Effective address: 00020014 Effective address: 00020010 At Breakpoint IP =00020014 MSR =00003030 CR =00000020 FPSCR R0 =00000000 R1 =00020000 R2 =FFF0178C R3 R4 =00000000 R5 =00000000 R6 =00000000 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00020014 SPR9 00020014 80620000 LWZ R3,$0(R2) ($FFF0178C) PPC1-Bug> 3-76 =00000000 =000410FE =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Computer Group Literature Center Web Site Debugger Commands G, GO - Go Execute User Program Command Input 3 G [ADDR], GO [ADDR] Description The G and GO command initiates target code execution. All previously set breakpoints are enabled. If an address is specified, it is placed in the target IP. Execution starts at the target IP address. The sequence of events is as follows: 1. If an address is specified, it is loaded in the target IP. 2. If a breakpoint is set at the target IP address, the instruction at the target IP is traced (executed in trace mode). 3. All breakpoints are inserted in the target code. 4. Target code execution resumes at the target IP address. At this point control may be returned to the debugger by one of the following conditions: ❏ A breakpoint with a count of 0 was found. ❏ The abort or reset switch on the debugger host was pressed. ❏ An unexpected exception occurred. When you invoke G or GO, control may or may not return to the debugger, depending on the outcome of the user program. Example The following program resides at $30000. http://www.motorola.com/computer/literature 3-77 Debugger Commands PPC1-Bug>DS 30000 00030000 3CA00000 ADDIS 00030004 2B040000 CMPLI 00030008 419A0014 BC 0003000C 98A30000 STB 00030010 3884FFFF ADDI 00030014 38630001 ADDI 00030018 4BFFFFEC B 0003001C 4E800020 BCLR PPC1-Bug> 3 R5,R0,$0 CRF6,0,R4,$0 12,26,$0003001C R5,$0(R3) ($000410FE) R4,R4,$FFFFFFFF R3,R3,$1 $00030004 20,0 Initialize R3/R4, set some breakpoints, and start the target program. PPC1-Bug>RM R3 R3 =000410FE? 68000 R4 =00000000? 34. PPC1-Bug> PPC1-Bug>BR 30018 3001C BREAKPOINTS 00030018 0003001C PPC1-Bug> PPC1-Bug>GO 30000 Effective address: 00030000 At Breakpoint IP =00030018 MSR =00003030 CR =00000040 FPSCR R0 =00000000 R1 =00020000 R2 =FFF0178C R3 R4 =00000033 R5 =00000000 R6 =00000000 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00020014 SPR9 00030018 4BFFFFEC B $00030004 PPC1-Bug> =00000000 =00068001 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Remove breakpoint at this location (* represents the current instruction pointer). PPC1-Bug>NOBR * BREAKPOINTS 0003001C PPC1-Bug> 3-78 Computer Group Literature Center Web Site Debugger Commands Continue target program execution. PPC1-Bug>G Effective address: 00030018 At Breakpoint IP =0003001C MSR =00003030 CR R0 =00000000 R1 =00020000 R2 R4 =00000000 R5 =00000000 R6 R8 =00000000 R9 =00000000 R10 R12 =00000000 R13 =00000000 R14 R16 =00000000 R17 =00000000 R18 R20 =00000000 R21 =00000000 R22 R24 =00000000 R25 =00000000 R26 R28 =00000000 R29 =00000000 R30 SPR0 =00000000 SPR1 =00000000 SPR8 0003001C 4E800020 BCLR 20,0 PPC1-Bug> =00000020 FPSCR =FFF0178C R3 =00000000 R7 =00000000 R11 =00000000 R15 =00000000 R19 =00000000 R23 =00000000 R27 =00000000 R31 =00020014 SPR9 =00000000 =00068034 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Remove breakpoints and restart the target code. PPC1-Bug>NOBR BREAKPOINTS PPC1-Bug> PPC1-Bug>GO 30000 Effective address: 00030000 The outcome is dependent on the loaded application. http://www.motorola.com/computer/literature 3-79 3 Debugger Commands GT - Go to Temporary Breakpoint Command Input 3 GT ADDR Command Input The GT command sets a temporary breakpoint and starts target code execution. A count may be specified with the temporary breakpoint. Control is given at the target IP address. All previously set breakpoints are enabled. The temporary breakpoint is removed when any breakpoint with a count of 0 is encountered. After setting the temporary breakpoint, the sequence of events is similar to that of the GO command. At this point control may be returned to the debugger by one of the following conditions: ❏ A breakpoint with a count of 0 was found. ❏ The abort or reset switch on the debugger host was pressed. ❏ An unexpected exception occurred. Example The following program resides at $20000 and $30000. PPC1-Bug>DS 20000:7 00020000 3C600004 ADDIS 00020004 60631000 ORI 00020008 3C800000 ADDIS 0002000C 608400FE ORI 00020010 4800FFF1 BL 00020014 80620000 LWZ 00020018 4BFFFFE8 B PPC1-Bug> 3-80 R3,R0,$4 R3,R3,$1000 R4,R0,$0 R4,R4,$FE $00030000 R3,$0(R2) ($FFF0178C) $00020000 Computer Group Literature Center Web Site Debugger Commands PPC1-Bug>DS 30000:8 00030000 3CA00000 ADDIS 00030004 2B040000 CMPLI 00030008 419A0014 BC 0003000C 98A30000 STB 00030010 3884FFFF ADDI 00030014 38630001 ADDI 00030018 4BFFFFEC B 0003001C 4E800020 BCLR PPC1-Bug> R5,R0,$0 CRF6,0,R4,$0 12,26,$0003001C R5,$0(R3) ($00041004) R4,R4,$FFFFFFFF R3,R3,$1 $00030004 20,0 3 Set a breakpoint. PPC1-Bug>BR 20014 BREAKPOINTS 00020014 PPC1-Bug> Set IP to start of program, set temporary breakpoint, and start target code. PPC1-Bug>RM IP IP =00020010 ? 20000. PPC1-Bug> PPC1-Bug>GT 20010 Effective address: 00020010 Effective address: 00020000 At Breakpoint IP =00020010 MSR =00003030 CR =00000040 FPSCR R0 =00000000 R1 =00020000 R2 =FFF0178C R3 R4 =000000FE R5 =00000000 R6 =00000000 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00020014 SPR9 00020010 4800FFF1 BL $00030000 PPC1-Bug> http://www.motorola.com/computer/literature =00000000 =00041000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 3-81 Debugger Commands Set another temporary breakpoint at $20000 and continue the target program execution. PPC1-Bug>GT 20000 Effective address: 00020000 Effective address: 00020010 At Breakpoint IP =00020014 MSR =00003030 CR =00000020 FPSCR R0 =00000000 R1 =00020000 R2 =FFF0178C R3 R4 =00000000 R5 =00000000 R6 =00000000 R7 R8 =00000000 R9 =00000000 R10 =00000000 R11 R12 =00000000 R13 =00000000 R14 =00000000 R15 R16 =00000000 R17 =00000000 R18 =00000000 R19 R20 =00000000 R21 =00000000 R22 =00000000 R23 R24 =00000000 R25 =00000000 R26 =00000000 R27 R28 =00000000 R29 =00000000 R30 =00000000 R31 SPR0 =00000000 SPR1 =00000000 SPR8 =00020014 SPR9 00020014 80620000 LWZ R3,$0(R2) ($FFF0178C) PPC1-Bug> 3 =00000000 =000410FE =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Note that a breakpoint from the breakpoint table was encountered before the temporary breakpoint. 3-82 Computer Group Literature Center Web Site Debugger Commands HE - Help Command Input 3 HE [COMMAND] Description The HE command displays information about the debugger commands. HE displays the description and the syntax of the command specified in the COMMAND argument. Without the COMMAND argument, HE displays a list of the debugger commands and their descriptions. Examples Example 1: PPC1-Bug>HE MD Memory Display: MD[S] [: | ][;[B|H|W|S|D][DI]] PPC1-Bug> Example 2: PPC1-Bug>HE AS Assembler BC Block of Memory Compare BF Block of Memory Fill BI Block of Memory Initialize BM Block of Memory Move BR Breakpoint Insert BS Block of Memory Search BV Block of Memory Verify CM Concurrent Mode CNFG Configure Board Information Block CS Checksum a Block of Data CSAR PCI Configuration Space READ Access CSAW PCI Configuration Space WRITE Access DC Data Conversion and Expression Evaluation DMA Move Block of Memory DS Disassembler DU Dump S-Records ECHO Echo String http://www.motorola.com/computer/literature 3-83 Debugger Commands ENV Set Environment to Bug/Operating System FORK Fork Idle MPU at Address FORKWR Fork Idle MPU with Registers G "Alias" for "GO" Command GD Go Direct (Ignore Breakpoints) GEVBOOT Global Environment Variable Boot GEVDEL Global Environment Variable Delete GEVDUMP Global Environment Variable(s) Dump Press "RETURN" to continue GEVEDIT Global Environment Variable Edit GEVINIT Global Environment Variable Initialization GEVSHOW Global Environment Variable(s) Display GN Go to Next Instruction GO Go Execute User Program GT Go to Temporary Breakpoint HE Help on Command(s) IDLE Idle Master MPU IOC I/O Control for Disk IOI I/O Inquiry IOP I/O Physical to Disk IOT I/O "Teach" for Configuring Disk Controller IRD Idle MPU Register Display IRM Idle MPU Register Modify IRS Idle MPU Register Set LO Load S-Records from Host M "Alias" for "MM" Command MA Macro Define/Display MAE Macro Edit MAL Enable Macro Expansion Listing MAR Macro Load MAW Macro Save MD Memory Display MDS Memory Display MENU System Menu MM Memory Modify Press "RETURN" to continue MMD Memory Map Diagnostic MS Memory Set MW Memory Write NAB Network Automatic Bootstrap Operating System NAP Nap MPU NBH Network Bootstrap Operating System and Halt NBO Network Bootstrap Operating System NIOC Network I/O Control NIOP Network I/O Physical NIOT I/O "Teach" for Configuring Network Controller 3 3-84 Computer Group Literature Center Web Site Debugger Commands NOBR Breakpoint Delete NOCM No Concurrent Mode NOMA Macro Delete NOMAL Disable Macro Expansion Listing NOPA Printer Detach NOPF Port Detach NORB No ROM Boot NOSYM Detach Symbol Table NPING Network Ping OF Offset Registers Display/Modify PA Printer Attach PBOOT Bootstrap Operating System PF Port Format Press "RETURN" to continue PFLASH Program FLASH Memory PS Put RTC Into Power Save Mode for Storage RB ROM Bootstrap Operating System RD Register Display REMOTE Connect the Remote Modem to CSO RESET Cold/Warm Reset RL Read Loop RM Register Modify RS Register Set RUN MPU Execution/Status SD Switch Directories SET Set Time and Date SROM SROM Examine/Modify SYM Attach Symbol Table SYMS Display Symbol Table T Trace TA Terminal Attach TIME Display Time and Date TM Transparent Mode TT Trace to Temporary Breakpoint VE Verify S-Records Against Memory VER Revision/Version Display WL Write Loop PPC1-Bug> http://www.motorola.com/computer/literature 3 3-85 Debugger Commands IBM - Indirect Block Move Command Input 3 IBM [ ]; [R|W] Description The parameter specifies the buffer address in linear memory space that will either be the source or the destination of the block copy. The optional parameter specifies the indirect memory space start address and the block length. The entire indirect memory space will be copied if this parameter is not specified. The parameter specifies one of several indirect memory spaces. The D (Drawbridge SROM), E (Ethernet SROM), I (I2C SROM), and P (PCI configuration space) selections will probe for compatible devices and prompt the user to confirm the device instance as each instance is located. The N (NVRAM) selection only supports one NVRAM device and will not prompt the user to confirm the device instance. The optional [R|W] parameter specifies the copy direction. R (read) copies a block of data from indirect memory space to linear memory space and W (write) prompts the user for confirmation and then copies a block of data from linear memory space to indirect memory space. The R direction will be used if this parameter is not specified. Refer to example on next page. 3-86 Computer Group Literature Center Web Site Debugger Commands Example PPC4-Bug>ibm 200000;i Device Address =$A0 (N/Y)? y Source = I2C SROM (A0:0) 0000 - 00FF Destination = RAM 00200000 - 002000FF Size = 100 (&256) bytes PPC4-Bug>md 200000:40 00200000 4D4F544F 524F4C41 0100010A 4D564D45 00200010 32343331 2D31020C 30312D57 33333934 00200020 46303142 03073333 38333138 350410C0 00200030 00808000 BA000000 00000000 00000005 00200040 0414DC93 80060405 F5E10009 03373530 00200050 0A04FF41 04C90B0C 000122C4 10040220 00200060 20005005 0B0CFFFF FFFF0802 02080801 00200070 78020E0F FFFFFFFF 20020220 00000001 00200080 0201040D 0401FCA0 550F0400 020000FF 00200090 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000A0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000B0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000C0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000D0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000E0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 002000F0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF PPC4-Bug> http://www.motorola.com/computer/literature 3 MOTOROLA....MVME 2431-1..01-W3394 F01B..3383185 ............... ............750 ...A...”....... .P............. x..... .. ..... ......U........ ............... ............... ............... ............... ............... ............... ............... 3-87 Debugger Commands IDLE - Idle Master MPU Note 3 This command is for multi-processor boards only. Command Input IDLE Description The IDLE command allows you to idle the current processor. Care should be taken not to idle it when all other processors are idle. The only way to correct this problem is by an MPU reset. To inquire of the BUG about idle processors, refer to the RUN command. Example Idle current processor. PPC1-Bug>idle PPC1-Bug> 3-88 Computer Group Literature Center Web Site Debugger Commands IOC - I/O Control for Disk Command Input 3 IOC Description The IOC command sends command packets directly to a disk controller. The packet to be sent must already reside in memory and must follow the packet protocol of the particular disk controller. This packet protocol is outlined in the documentation for the SCSI controller (refer to Appendix A, Related Documentation). This command may be used as a debugging tool to issue commands to the disk controller to locate problems with either drives, media, or the controller itself. When invoked, this command prompts for the controller and drive required. The default controller LUN (CLUN) and device LUN (DLUN) when IOC is invoked are those most recently specified for IOP, IOT, or a previous invocation of IOC. The command also prompts for an address where the controller command is located. You may change the displayed value by typing a new value, followed by the Return key. To leave the field unaltered, press the Return key without typing a new value. http://www.motorola.com/computer/literature 3-89 Debugger Commands You may also enter a special character, either at the prompt or after typing new data, for scrolling through the fields. The special characters are: 3 V or v Go to the next field. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up to the previous field. This remains in effect until changed by entering one of the other special characters. = Re-open the same field . Terminate the IOC command, and return control to the debugger The power-up default for the packet address is the area which is also used by the PBOOT and IOP commands for building packets. IOC displays the command packet, and if you so instruct it, sends the packet to the disk controller, following the proper protocol required by the particular controller. A device probe with entry into the device descriptor table is done whenever a specified device is accessed via IOC. The device probe mechanism utilizes the SCSI commands Inquiry and Mode Sense. If the specified controller is non-SCSI, the probe simply returns a status of device present and unknown. The device probe makes an entry into the device descriptor table with the pertinent data. After an entry has been made, the next time a probe is done it simply returns with device present status (pointer to the device descriptor). 3-90 Computer Group Literature Center Web Site Debugger Commands Example Send the packet at $10000 to a controller device configured as CLUN #0. Specify an operation to the hard disk which is at DLUN #1. PPC1-Bug>IOC Controller LUN =00? Device LUN =00? 1 Packet address =000012BC? 10000 00700074 0000 0000 8004 000E 0000 0000 00700084 0000 0006 1200 0000 2400 0000 00700094 0000 0000 0000 0000 0000 0000 007000A4 0000 0000 0000 0000 0000 0000 007000B4 0000 0000 0000 0000 0000 0024 007000C4 0000 0000 0000 0000 0000 0000 007000D4 0000 0000 0000 0000 0000 0000 007000E4 0000 0000 0000 0000 0000 0000 Send Packet=Y (Y/N)? y PPC1-Bug> http://www.motorola.com/computer/literature 0000 0000 0000 0000 0040 0018 0000 0000 0000 0000 0000 0000 0000 AFC8 0000 0000 ................ ........$....... ................ ................ ...........$.@.. ................ ................ ................ 3-91 3 Debugger Commands IOI - I/O Inquiry Command Input 3 IOI [;[C|D|L|N]] Options C Clear the Device Descriptor Table. D List Devices while probing L List the Device Descriptor Table. N List the Devices currently configured Description The IOI command inquires for all of the possible attached devices. If no option is specified, this command probes the system for all possible CLUN/DLUN combinations. Both the CLUN and DLUN parameters have the range of 0 to 255 (decimal). If the probed device supports an inquiry operation (SCSI devices), the command will display the inquiry data along with the CLUN, DLUN, controller type, device address, device type, and the removable media attribute. If a device does not support inquiry data, the message will be displayed. The probe ordering starts with a CLUN of zero and a DLUN of zero. Once the probe is done, the DLUN is incremented by one and the probe is executed again, the incrementing of the DLUN and the probing continues until the DLUN reaches 256. At this point the CLUN is incremented by one and the DLUN is set to zero, the probing of DLUNs from zero to 255 is performed. The probing continues until the CLUN reaches 256. When the ENV option “Serial Startup Code Master Enable” is set to ‘Y’, the CLUN/DLUN numbers are displayed on the console as the probe occurs. The CLUN/DLUN numbers in this case are shown on the screen as: [mmnn] 3-92 Computer Group Literature Center Web Site Debugger Commands where: mm = the CLUN number and while: nn = the DLUN number 3 The CLUN/DLUN numbers are always sent to the 7-segment LEDs regardless of the ENV setting. With the variable number of devices that can now be attached to a given system, the memory requirements to house the pertinent device descriptors cannot be met. The debugger reserves space for 16 device descriptors. The device descriptor table (16 entries) can be viewed or cleared by this command with the L and C options, respectively. Each mass storage boot device and network interface boot device is identified by a device name. Each device type that the product supports is contained/listed within device probe tables. These tables are modified to contain the associative device name. At probe time, the probed device’s name is copied into the dynamic device configuration tables housed within NVRAM. This will only be done, of course, if the device is present. The user may view the system’s device names by performing the following operations. For mass storage devices while probing, the D option allows users to display the device names of the attached devices. These device names are per the IBM firmware and the IBM AIX naming conventions. To view the device names of mass storage devices which are currently configured (or have been accessed via a boot (PBOOT), or via an I/O operation (IOP)), use the N option. Examples Example 1: Probe for all possible devices. As a device is found (probe was successful) it is displayed to the console with the associative inquiry data. PPC1-Bug>IOI I/O Inquiry Status: CLUN DLUN CNTRL-TYPE 0 0 NCR53C825 0 30 NCR53C825 1 0 PC8477 PPC1-Bug> DADDR 0 3 0 http://www.motorola.com/computer/literature DTYPE $00 $05 $00 RM N Y Y Inquiry-Data SEAGATE ST31200N 8630 TOSHIBA CD-ROM XM-3401TA 1094 3-93 Debugger Commands Note that if the board has a secondary SCSI, and both primary and secondary SCSI controllers are connected with the same SCSI cable, all SCSI peripherals will be listed twice by IOI because they can be accessed by either primary or secondary SCSI controller: 3 PPC1-Bug>IOI I/O Inquiry Status: CLUN DLUN CNTRL-TYPE 0 10 NCR53C825 0 30 NCR53C825 1 0 PC8477 12 10 NCR53C825 12 30 NCR53C825 PPC1-Bug> DADDR 1 3 0 1 3 DTYPE $00 $05 $00 $00 $05 RM N Y Y N Y Inquiry-Data SEAGATE ST11200N ST31230 TOSHIBA CD-ROM XM-5301TA SEAGATE ST11200N ST31230 TOSHIBA CD-ROM XM-5301TA 0660 0925 0660 0925 Example 2: List (view) the current device descriptors as found in the device descriptor table. PPC1-Bug>IOI;L I/O Inquiry CLUN DLUN 0 30 2 30 PPC1-Bug> Device Descriptor Table Status: CNTRL-TYPE CNTRL-Address RM VME??? $FFF47000 N VME327 $FFFFA600 Y Device-Type $00/Direct-Access $01/Sequential-Access Example 3: Clear the device descriptor table. PPC1-Bug>IOI;C PPC1-Bug> This option is useful in the event the table becomes full and a device that has not been accessed is accessed. 3-94 Computer Group Literature Center Web Site Debugger Commands IOP - I/O Physical (Direct Disk Access) Command Input 3 IOP Description The IOP command allows you to read, write, or format any of the supported disk or tape devices. When invoked, this command goes into an interactive mode, prompting you for all the parameters necessary to carry out the command. You may change the displayed value by typing a new value, followed by the Return key. To leave the field unchanged, press the Return key without typing a new value. You may also enter a special character, either at the prompt or after typing new data, for scrolling through the fields. The special characters are: V or v Open the next field. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up and open the previous field = Re-open the same field . Terminate the IOP command, and return control to the debugger The disk SYSCALL functions (trap routines) are used by IOP to access the specified disk or tape (refer to Chapter 5, System Calls). A device probe with entry into the device descriptor table is done whenever a specified device is accessed via IOP. The device probe mechanism utilizes the SCSI Inquiry and Mode Sense commands (SCSI devices) or ATA Identify Data and Initialize Device Parameters commands (ATA devices). ATAPI devices are queried only for their inquiry data. If the specified controller is non-SCSI or nonATA/ATAPI, the probe simply returns the message device present and unknown. The device probe makes an entry into the device http://www.motorola.com/computer/literature 3-95 Debugger Commands descriptor table with the pertinent data. After an entry has been made, the next time a probe is done it simply returns with the message device present (pointer to the device descriptor). 3 Initially (after a cold reset), all the parameters used by IOP are set to certain default values. However, any new values entered are saved and are displayed the next time that the IOP command is invoked. The following prompts appear (some prompts are device-dependent): Controller LUN =00? The Logical Unit Number (LUN) of the controller to access Device LUN =00? The LUN of the device to access Read/Write/Format =R? The command function: R Read blocks of data from the selected device into memory W Writes blocks of data from memory to the selected device F Formats the selected device; If you start the IOP format procedure, it must be allowed to complete (PPC1Bug> prompt returns) or else the disk drive may be totally disabled. Caution This format procedure may take as long as half an hour. For disk devices, either a track or the whole disk can be selected by a subsequent field. This option only applies to SCSI Direct Access devices (type $00). When the format operation is selected, the Flag Byte prompt is displayed. A flag byte of $08 specifies to ignore the grown defect list when formatting. A flag byte of $00 specifies not to ignore the grown defect list when formatting. ! Memory Address =00003000? The starting address for the memory block to be accessed. For disk read operations, data is written starting at this location. For disk write operations, data is read starting at this location. 3-96 Computer Group Literature Center Web Site Debugger Commands Starting Block =00000000? The starting disk block number to access. For disk read operations, data is read starting at this block. For disk write operations, data is written starting at this block. For disk track format operations, the track that contains this block is formatted. Number of Blocks =0002? The number of data blocks to be transferred on a read or write operation. Address Modifier Note =00? Changing this Address Modifier parameter works for the MVME160x series modules only. Track/Disk =T (T/D)? T Format a disk track D Format the entire disk File Number =0000? The starting file number to access (for streaming tape devices) http://www.motorola.com/computer/literature 3-97 3 Debugger Commands Flag Byte =00? The flag byte is used to specify variations of the same command, and to receive special status information. Bits 0 through 3 are used as command bits; bits 4 through 7 are used as status bits. The following bits are defined for streaming tape read and write operations. 3 Bit 7 Filemark flag. If 1, a filemark was detected at the end of the last operation. Bit 3 Disk formatting. It is ignored on tape operations. Bit 2 Reset Controller Flag. If 1, a controller reset will take place if possible before the requested operation takes place. Bit 1 Ignore File Number (IFN) flag. If 0, the file number field is used to position the tape before any reads or writes are done. If 1, the file number field is ignored, and reads or writes start at the present tape position. Bit 0 End of File flag. If 0, reads or writes are done until the specified block count is exhausted. If 1, reads are done until the count is exhausted or until a filemark is found. If 1, writes are terminated with a filemark. Retension/Erase R E =R (R/E)? Retension tape when a format operation is scheduled Erase and retension tape when a format operation is scheduled After all the required parameters are entered, the disk access is initiated. If an error occurs, an error status word is displayed. Refer to Appendix F for an explanation of any error status codes that are returned. 3-98 Computer Group Literature Center Web Site Debugger Commands Examples Example 1: Read 25 blocks starting at block 370 from device 2 of controller 0 into memory beginning at address $50000. 3 PPC1-Bug>IOP Controller LUN =00? Device LUN =00? 2 Read/Write/Format=R? Memory Address =00003000? 50000 Starting Block =00000000? &370 Number of Blocks =0002? &25 Address Modifier =00? PPC1-Bug> Example 2: Write 14 blocks starting at memory location $7000 to file 6 of device 0, controller 4. Append a filemark at the end of the file. PPC1-Bug>IOP Controller LUN =00? 4 Device LUN =02? 0 Read/Write/Format=R? W Memory Address =00050000? 7000 File Number =00000172? 6 Number of Blocks =0019? E Flag Byte =00? %01 Address Modifier =00? PPC1-Bug> Example 3: Format the specified device with the option not to ignore the grown defect list. PPC1-Bug>IOP Controller LUN Device LUN Read/Write/Format Starting Block Track/Disk (T/D) Flag Byte Address Modifier PPC1-Bug> =00? =00? =R? F =00000000? =D? =00? =00? http://www.motorola.com/computer/literature 3-99 Debugger Commands Example 4: Format the specified device with the option to ignore the grown defect list. PPC1-Bug>IOP Controller LUN Device LUN Read/Write/Format Starting Block Track/Disk (T/D) Flag Byte Address Modifier PPC1-Bug> 3 3-100 =00? =00? =R? F =00000000? =D? =00? 8 =00? Computer Group Literature Center Web Site Debugger Commands IOT - I/O Configure Disk Controller Command Input 3 IOT [;[A|F|H|T]] Options A List all the disk controllers which are supported by PPCBug. SCSI controllers are identified with an asterisk (*). Each PCI controller is only listed once. F Force a device descriptor into the Device Descriptor Table. This option makes it easier to debug a particular device, in the event the device probe for the specified device fails. H List all the disk controllers which are available to the system. SCSI controllers are identified by an asterisk (*). T Probe the system for I/O controllers. This option basically invokes the IOI command with no options. Description The IOT command allows you to set-up (“teach”) a new disk configuration in the PPCBug for use by the system call disk functions. IOT lets you modify the controller and device descriptor tables used by the system call functions for disk access. Note that because the PPCBug commands that access the disk use the system call disk functions, changes in the descriptor tables affect all those commands. These include the IOP and PBOOT commands, and also any user program that uses the system call disk functions. Refer to Table E-2 for information on formatting floppy disk drives. Before attempting to access the disks with the IOP command, you should verify the parameters and, if necessary, modify them for the specific media and drives used in the system. (Refer to Appendix E for details.) Note that during a boot, the configuration sector is normally read from the disk, and the device descriptor table for the LUN used is modified accordingly. If you wish to read/write using IOP from a disk that has been booted, IOT will not be required, unless the system is reset. http://www.motorola.com/computer/literature 3-101 Debugger Commands A device probe with entry into the device descriptor table is done whenever a specified device is accessed via IOT. The device probe mechanism utilizes the SCSI commands Inquiry and Mode Sense. If the specified controller is non-SCSI, the probe simply returns the status device present and unknown. The device probe makes an entry into the device descriptor table with the pertinent data. After an entry has been made, the next time a probe is done it simply returns with the status device present (pointer to the device descriptor). 3 Note that reconfiguration is only necessary when you wish to read or write a disk which is different than the default set by the IOP command. Reconfiguration is normally done automatically by the PBOOT command when booting from a disk which is different from the default. When invoked without options, the IOT command enters an interactive subcommand mode where the descriptor table values currently in effect are displayed one-at-a-time. You may change the displayed value by typing a new value, followed by the Return key. To leave the field unaltered, press the Return key without typing a new value. You may also enter a special character, either at the prompt or after typing new data, for scrolling through the fields. The special characters are: V or v Open the next field. This is the default, and remains in effect until changed by entering one of the other special characters. ^ Back up and open the previous field = Re-open the same field . Terminate the IOT command, and return control to the debugger All numerical values are interpreted as hexadecimal numbers. You may enter decimal values by preceding the number with an &. The following information prompts appear with the default field values (some of the prompts are device-dependent): Controller LUN =00? The Controller LUN 3-102 Computer Group Literature Center Web Site Debugger Commands Device LUN =00? The Device LUN If the Controller LUN and Device LUN selected do not correspond to a valid controller and device, then IOT outputs the message Invalid LUN and you are prompted for the two LUNs again. Device Type [00-1F] =00? $00 Direct-access (e.g., magnetic disk) $01 Sequential-access (e.g., magnetic tape) $02 Printer $03 Processor $04 Write-once (e.g., some optical disks) $05 CD-ROM $06 Scanner $07 Optical Memory (e.g., some optical disks) $08 Medium Changer (e.g., jukeboxes) $09 Communications $0A, $0B Graphic Arts Pre-Press $0C-$1E Reserved $0F Unknown or no device type Only the $00, $01, $05, and $07 are supported by the I/O controller drivers. Attribute Parameters The parameters and attributes that are associated with a particular device are determined by a parameter and an attribute mask that is a part of the device definition. The device that has been selected may have any combination of the following parameters and attributes: Sector Size: 0- 128 1- 256 2- 512 3-1024 4-2048 5-4096 =01 (0-5)? The number of data bytes per sector. http://www.motorola.com/computer/literature 3-103 3 Debugger Commands Block Size: 0- 128 1- 256 2- 512 3-1024 4-2048 5-4096 =01 (0-5)? 3 The units in which a transfer count is specified when doing a disk/tape block transfer. The block size can be smaller, equal to, or greater than the physical sector size, as long as (Block Size) * (Number of Blocks) / (Physical Sector Size) is an integer. Sectors/Track =0020? The number of data sectors per track, and is a function of the device being accessed and the sector size specified. Starting Head =10? The starting head number for the device. It is normally zero for Winchester and floppy drives. It is nonzero for dual volume SMD drives. Number of Heads =05? The number of heads on the drive. Number of Cylinders =0337? The number of cylinders on the device. For floppy disks, the number of cylinders depends on the media size and the track density. Precomp. Cylinder =0000? The cylinder number at which precompensation should occur for this drive. This parameter is normally specified by the drive manufacturer. Reduced Write Current Cylinder =0000? The cylinder number at which the write current should be reduced when writing to the drive. This parameter is normally specified by the drive manufacturer. 3-104 Computer Group Literature Center Web Site Debugger Commands Interleave Factor =00? The manner in which the sectors are formatted on a track. Normally, consecutive sectors in a track are numbered sequentially in increments of 1 (interleave factor of 1). The interleave factor controls the physical separation of logically sequential sectors. This physical separation gives the host time to prepare to read the next logical sector without requiring the loss of an entire disk revolution. Spiral Offset =00? The number of sectors that the first sector of each track is offset from the index pulse. This is used to reduce latency when crossing track boundaries. ECC Data Burst Length =0000? The number of bits to correct for an ECC error when supported by the disk controller Step Rate Code =00? The rate at which the read/write heads can be moved when seeking a track on the disk. The encoding is as follows: Step Rate Code (Hex) Winchester Hard Disks 3-1/2 and 5-1/4 Inch Floppy 8-Inch Floppy 00 0 msec 12 msec 6 msec 01 6 msec 6 msec 3 msec 02 10 msec 12 msec 6 msec 03 15 msec 20 msec 10 msec 04 20 msec 30 msec 15 msec http://www.motorola.com/computer/literature 3-105 3 Debugger Commands Single/Double DATA Density =D (S/D)? 3 S Single (FM) data density D Double (MFM) data density Single/Double TRACK Density =D (S/D)? The density (tracks per inch) S 48 TPI = Single Track Density D 96 TPI = Double Track Density Single/Equal_in_all Track zero density =S (S/E)? The data density of track 0, either a single density or equal to the density of the remaining tracks. For Equal_in_all, the Single/Double data density flag indicates the density of track 0. Slow/Fast Data Rate =S (S/F)? The data rate for floppy disk devices 3-106 S 250 kHz data rate F 500 kHz data rate Computer Group Literature Center Web Site Debugger Commands Gap 1 =07? The number of words of zeros that are written before the header field in each sector during format. Gap 2 =08? The number of words of zeros that are written between the header and data fields during format and write commands Gap 3 =00? The number of words of zeros that are written after the data fields during format commands Gap 4 =00? The number of words of zeros that are written after the last sector of a track and before the index pulse Spare Sectors Count =00? The number of sectors per track allocated as spare sectors. These sectors are only used as replacements for bad sectors on the disk. Examples Example 1: Examine the default parameters of a 5-1/4 inch floppy disk. PPC1-Bug>IOT Controller LUN =00? Device LUN =00? 2 Device Type [00-1F] =00? Removable Media = Y (Y/N)? Sector Size: 0- 128 1- 256 2- 512 3-1024 4-2048 5-4096 =01 (0-5)? Block Size: 0- 128 1- 256 2- 512 3-1024 4-2048 5-4096 =01 (0-5)? http://www.motorola.com/computer/literature 3-107 3 Debugger Commands Sectors/track =0010? Number of heads =02? Number of cylinders =0050? Precomp. Cylinder =0028? Step Rate Code =00? Single/Double TRACK density=D (S/D)? Single/Double DATA density =D (S/D)? Single/Equal_in_all Track zero density =S (S/E)? Slow/Fast Data Rate =S (S/F)? PPC1-Bug> 3 Example 2: PPC1-Bug>iot;a I/O Controllers Supported: CLUN CNTRL-TYPE CNTRL-Address 1 PC8477 $800003F0 2 PC87303IDE $80000 1F0 X NCR53C810 Any PCI X NCR53C825 Any PCI X NCR53C875 Any PCI X SL82C105 Any PCI X PBC-EIDEF1 Any PCI PPC1-Bug> 3-108 N-Devices 1 2 * * * 4 4 Computer Group Literature Center Web Site Debugger Commands IRD, IRM, IRS - Idle MPU Register Display/Modify/Set Note These commands are for multi-processor boards only. 3 Command Inputs IRD MPU# ARGS IRM MPU# ARGS IRS MPU# ARGS Descriptions The IRD command allows you to display the idle processor’s registers. The idle processor is specified by the argument MPU#. This argument depends on your configuration. The ARGS argument is equivalent to the argument string as required by the command RD. Refer to the RD command for argument syntax. The IRM command allows you to examine/modify the idle processor’s registers. The idle processor is specified by the argument MPU#. This argument depends on your configuration. The ARGS argument is equivalent to the argument string as required by the command RM. Refer to the RM command for argument syntax. The IRS command allows you to display/set a particular register of the idle processor’s register set. The idle processor is specified by the argument MPU#. This argument depends on your configuration. The ARGS argument is equivalent to the argument string as required by the command RS. Refer to the RS command for argument syntax. Refer to the individual commands (RD, RM, and RS) for examples. http://www.motorola.com/computer/literature 3-109 Debugger Commands LO - Load S-Records from Host Command Input 3 LO [PORT] [ADDR] [;[X] [C] [T]] [=text] Arguments PORT Port to be used for the downloading. The default is port 1. ADDR Offset address which is to be added to the address contained in the address field of each record. This causes the records to be stored to memory at different locations than would normally occur. The contents of the automatic offset register are not added to the Srecord addresses. Options More than one option may be used. 3-110 X Echo the S-records to your terminal as they are read in at the host port. C Ignore checksum. A checksum for the data contained within an Srecord is calculated as the S-record is read in at the port. Normally, this calculated checksum is compared to the checksum contained within the S-record and if the compare fails, an error message is sent to the screen on completion of the download. If this option is selected, then the comparison is not made. T System Call code. This option causes LO to set the target register R04 to ‘LO$01’ ($4C4F2001). The ASCII string LO indicates the LO command. The code $01 indicates system call support with stack parameter/result passing and system call disk support. This code can be used by the downloaded program to select the appropriate calling convention when invoking debugger functions (necessary because some Motorola debuggers use conventions different from PPCBug, and they set a different code in R05). Computer Group Literature Center Web Site Debugger Commands =text The command that is sent to the host before the debugger begins to look for S-records at the host port. The command is sent to the host device to initiate the download. Do not enclose text in quote marks. Do not separate the = and text with a space. If the host is operating full duplex, the string is also echoed back to the host port by the host and appears on your terminal screen. Description The LO command downloads Motorola S-record files from a host system to the debugger host. The LO command accepts serial data from the host and loads it into memory. Note You can download S-records at any baud rate supported by both the debugger and the host system. If the X option is specified, make sure that the baud rate of the host system is less than or equal to the baud rate of the console. If there are any problems loading the records, reduce the baud rate of the host. In order to accommodate host systems that echo all received characters, the above-mentioned text string is sent to the host one character at a time and characters received from the host are read one-at-a-time. After the entire command has been sent to the host, LO keeps looking for a line feed (LF) character from the host, signifying the end of the echoed command. No data records are processed until this is received. If the host system does not echo characters, LO still keeps looking for a character before data records are processed. For this reason, it is required in situations where the host system does not echo characters, that the first record transferred by the host system be a header record. The header record is not used but the after the header record serves to break LO out of the loop so that data records are processed. The S-record format (refer to Appendix D, S-Record Format) allows for an entry point to be specified in the address field of the termination record of an S-record block. The contents of the address field of the termination record (plus the offset address, if any) are put into the target IP. Thus, after a download, you need only enter GO instead of GO ADDR to execute the code that was downloaded. http://www.motorola.com/computer/literature 3-111 3 Debugger Commands If a non-hexadecimal character is encountered within the data field of a data record, then the part of the record which had been received up to that time is printed to the screen and the PPCBug error handler is invoked to point to the faulty character. 3 If the embedded checksum of a record does not agree with the checksum calculated by PPCBug and if the checksum comparison has not been disabled via the C option, then an error condition exists. A message is output stating the address of the record (as obtained from the address field of the record), the calculated checksum, and the checksum read with the record. A copy of the record is also output. This is a fatal error and causes the command to abort. When a load is in progress, each data byte is written to memory and then the contents of this memory location are compared to the data to determine if the data stored properly. If for some reason the compare fails, then a message is output stating the address where the data was to be stored, the data written, and the data read back during the compare. This is also a fatal error and causes the command to abort. Because processing of the S-records is done character-by-character, any data that was deemed good will have already been stored to memory if the command aborts due to an error. Example For this example, assume that a host system was used to create the following program: .file “test.s” # # retrieve contents of the RTC registers # .toc T.FD: .tc FD.4330000080000000[tc] ,1127219200,-2147483648 .toc T..test: .tc ..test[tc], test[ds] T..LDATA: .tc ..LDATA[tc], .LDATA T..LRDATA: .tc ..LRDATA[tc], .LRDATA # 3-112 Computer Group Literature Center Web Site Debugger Commands .align .globl .csect .long .globl .csect 2 test[ds] test[ds] .test[pr], TOC[tc0], 0 .test[pr] .test[pr] 3 .test: mfspr r4,4 stw r4,0(r3) mfspr r4,5 stw r4,4(r3) bclr 0x14,0x0 FE_MOT_RESVD.test: .csect [rw] .align 2 .LDATA: .csect [rw] .align 2 .LRDATA: # # # # # load RTC upper register write to caller’s buffer load RTC lower register write to caller’s buffer return to the caller Also assume program has been compiled and linked to start at address 65040000, and the program was converted into an S-record file named test.mx as follows: S325650400007C8402A6908300007C8502A6908300044E80002000000000650400006504002412 S30D65040020000000000000000069 S7056504000091 Load this file into memory for execution at address $40000 as follows: PPC1-Bug>TM Escape character: $01=^A. Go into transparent mode to establish host link, input the necessary character sequences to gain access to the S-Record file test.mx. . . . Exit transparent mode by inputting the escape character sequence, default is Ctrl-a. At this point control will return to the debugger prompt. . PPC1-Bug> http://www.motorola.com/computer/literature 3-113 Debugger Commands PPC1-Bug>LO ,,-65000000 ;X=cat test.mx cat test.mx S325650400007C8402A6908300007C8502A6908300044E800020000000006504000065040 02412 S30D65040020000000000000000069 S7056504000091 PPC1-Bug> 3 The S-records are echoed to the terminal because of the X option. The offset address of -65000000 was added to the addresses of the records in TEST.MX and caused the program to be loaded to memory starting at $40000. The text cat test.mx is an operating system command line that caused the file to be copied by the operating system to the port which is connected with the debugger host’s host port. PPC1-Bug>DS 40000,40014 00040000 7C8402A6 MFSPR 00040004 90830000 STW 00040008 7C8502A6 MFSPR 0004000C 90830004 STW 00040010 4E800020 BCLR PPC1-Bug> R4,4 R4,$0(R3) ($00041000) R4,5 R4,$4(R3) ($00041004) 20,0 The target IP now contains the entry point of the code in memory ($40000). PPC1-Bug>RD IP =00040000 MSR =00003030 CR R0 =00000000 R1 =00020000 R2 R4 =00000000 R5 =00000000 R6 R8 =00000000 R9 =00000000 R10 R12 =00000000 R13 =00000000 R14 R16 =00000000 R17 =00000000 R18 R20 =00000000 R21 =00000000 R22 R24 =00000000 R25 =00000000 R26 R28 =00000000 R29 =00000000 R30 SPR0 =00000000 SPR1 =00000000 SPR8 00040000 7C8402A6 MFSPR R4,4 PPC1-Bug> 3-114 =00000020 FPSCR =FFF0178C R3 =00000000 R7 =00000000 R11 =00000000 R15 =00000000 R19 =00000000 R23 =00000000 R27 =00000000 R31 =00020014 SPR9 =00000000 =00041000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 =00000000 Computer Group Literature Center Web Site Debugger Commands MA - Macro Define/Display NOMA - Macro Delete 3 Command Input MA [NAME|;L] NOMA [NAME] Description The MA command allows you to define a macro consisting of any number of debugger commands with optional parameter specifications. NOMA command is used to delete either a single macro or all macros. The NAME argument is a macro name, which may be any combination of one to eight alphanumeric characters. Enter MA without a macro name to view a list of all currently defined macros and their definitions. When MA is invoked with the name of a currently defined macro, the macro definition is displayed. Line numbers, which are assigned in increments of 10, are shown to facilitate editing with the MAE command. If MA is invoked with a valid name that does not currently have a definition, then the debugger enters the macro definition mode. In response to each macro definition prompt M=, type a debugger command followed by the return key. To exit the macro definition mode, press the Return key (null line) at the prompt. Commands are not checked for syntax until the macro is invoked. A macro must contain primitive debugger commands (i.e., no definition). If the macro contains errors, you may either edit it with the MAE command or delete with the NOMA command and redefine it. Macro definitions are stored in a string pool of fixed size. If the string pool becomes full while in the definition mode, the offending string is discarded, a message STRING POOL FULL, LAST LINE DISCARDED is printed and the user is returned to the debugger command prompt. This also happens if the string entered would cause the string pool http://www.motorola.com/computer/literature 3-115 Debugger Commands to overflow. The string pool has a capacity of 511 characters. The only way to add or expand macros when the string pool is full is either to delete or edit macro(s). 3 Debugger commands contained in macros may reference arguments supplied at invocation time. Arguments are denoted in macro definitions by embedding a back slash (\) followed by a numeral. Up to ten arguments are permitted, numbered 0 through 9. A definition containing a back slash followed by a zero would cause the first argument to that macro to be inserted in place of the string “\0”. Similarly, the second argument would be used in place of the string “\1”. For instance, you may create a macro named ARGUE, with three arguments, \0, \1, and \2. Entering ARGUE 3000 1 ;B at the debugger prompt invokes the macro, with the text strings 3000, 1, and ;B replacing the \0, \1, and \2 respectively, within the body of the macro. The L option toggles the loop continuous macro mode. If the current macro mode is loop continuous, once a macro is invoked, it will automatically be re-invoked for continuous operation. To delete a macro, invoke NOMA followed by the name of the macro. Invoking NOMA without specifying a valid macro name deletes all macros. If NOMA is invoked with a valid macro name that does not have a definition, an error message is printed. Examples Example 1: Define the macro ABC. PPC1-Bug>MA ABC M=MD 3000 M=GO \0 M= PPC1-Bug> Example 2: Define the macro DIS. PPC1-Bug>MA DIS M=MD \0:17;DI M= PPC1-Bug> 3-116 Computer Group Literature Center Web Site Debugger Commands Example 3: List all currently defined macros. PPC1-Bug>MA MACRO ABC 010 MD 3000 020 GO \0 MACRO DIS 010 MD \0:17;DI PPC1-Bug> 3 Example 4: List the definition of the macro ABC. PPC1-Bug>MA ABC MACRO ABC 010 MD 3000 020 GO \0 PPC1-Bug> Example 5: Delete the macro DIS. PPC1-Bug>NOMA DIS PPC1-Bug> Example 6: List all currently defined macros. PPC1-Bug>MA MACRO ABC 010 MD 3000 020 GO \0 PPC1-Bug> Example 8: Delete all defined macros. PPC1-Bug>NOMA PPC1-Bug> Example 9: List all currently defined macros. PPC1-Bug>MA NO MACROS DEFINED PPC1-Bug> http://www.motorola.com/computer/literature 3-117 Debugger Commands MAE - Macro Edit Command Input 3 MAE NAME LINE # [STRING] Arguments NAME Macro name, which may be any combination of one to eight alphanumeric characters LINE # Line number (1-999) to be replaced or where a new line is to be inserted STRING Line to be inserted or replaced Description The MAE command allows you to edit a macro. MAE is line oriented and allows inserting, deleting, and replacing individual lines. Replace a line by specifying its line number and the replacement text. Insert a line between two existing lines by specifying a LINE # that is between line numbers of the two existing lines. For instance, assign LINE # 15 to a new line that you want to insert between lines 010 and 020. The text of the new line is the STRING. Delete a line by specifying a line number and not adding any replacement text. The MAE command displays the macro, as edited, with the lines renumbered in increments of 10. Attempting to delete a nonexistent line results in an error message being displayed. MAE does not permit deletion of a line if the macro consists only of that line; you must remove it using the NOMA command. MAE operates only on previously defined macros (use MA to define new macros). Line numbers serve one purpose: specifying the location within a macro definition to perform the editing function. After the editing is complete, the macro definition is displayed with a new set of line numbers. 3-118 Computer Group Literature Center Web Site Debugger Commands Examples Example 1: Add a line to macro ABC. 3 List definition of macro ABC. PPC1-Bug>MA ABC MACRO ABC 010 MD 3000 020 GO \0 PPC1-Bug> Then add a line to macro ABC. PPC1-Bug>MAE ABC 15 RD MACRO ABC 010 MD 3000 020 RD 030 GO \0 PPC1-Bug> Example 2: Replace line 010 from macro ABC. PPC1-Bug>MAE ABC 10 MD 10+Z0 MACRO ABC 010 MD 10+Z0 020 RD 030 GO \0 PPC1-Bug> Example 3: Remove the specified line from the macro ABC. PPC1-Bug>MAE ABC 30 MACRO ABC 010 MD 10+Z0 020 RD PPC1-Bug> http://www.motorola.com/computer/literature 3-119 Debugger Commands MAL - Enable Macro Listing NOMAL - Disable Macro Listing 3 Command Input MAL NOMAL Description The MAL command allows you to view expanded macro lines as they are executed. This is especially useful when errors result, as the line that caused the error appears on the display. The NOMAL command is used to suppress the listing of the macro lines during execution. The use of MAL and NOMAL is a convenience for you and in no way interacts with the function of the macros. 3-120 Computer Group Literature Center Web Site Debugger Commands MAR - Load Macros Command Input 3 MAR [controllerLUN] [[deviceLUN] [block#]] Arguments controllerLUN Logical Unit Number (LUN) of the controller to which the following device is attached. This initially defaults to LUN 0. deviceLUN LUN of the device to save/load macros to/from. This initially defaults to LUN 0. block# Number of the block on the above device that is the first block of the macro list. This initially defaults to block 2. Description The MAR command loads macros that have previously been saved by MAW. Care should be taken to avoid attempting to load macros from a location on the disk or tape other than that written to by the MAW command. While MAR checks for invalid macro names and other anomalies, the results of such a mistake are unpredictable. Note MAR discards all currently defined macros before loading from disk or tape. Default are set each time either MAR or MAW is invoked. When either command has been used, the default controller, device, and block numbers are set to those used. If macros were loaded from controller 0, device 2, block 8 with command MAR, the defaults for a later invocation of MAW would be the same. Errors encountered during I/O are reported along with the 16-bit status word returned by the I/O routines. Example For the example, assume that controller 0, device 2 is accessible. Load macros from block 3. http://www.motorola.com/computer/literature 3-121 Debugger Commands PPC1-Bug> MAR 0,2,3 PPC1-Bug> List macros. 3 PPC1-Bug> MA MACRO ABC 010 MD 3000 020 GO \0 PPC1-Bug> Define macro ASM. PPC1-Bug> MA ASM M=MM \0;DI M= (CR) PPC1-Bug> List all macros. PPC1-Bug> MA MACRO ABC 010 MD 3000 020 GO \0 MACRO ASM 010 M=MM \0;DI PPC1-Bug> 3-122 Computer Group Literature Center Web Site Debugger Commands MAW - Save Macros Command Input 3 MAW [controllerLUN] [[deviceLUN] [block#]] Arguments controllerLUN Logical Unit Number (LUN) of the controller to which the following device is attached. This initially defaults to LUN 0. deviceLUN LUN of the device to save/load macros to/from. This initially defaults to LUN 0. block# Number of the block on the above device that is the first block of the macro list. This initially defaults to block 2. Description The MAW command saves the currently defined macros to disk or tape. The selected block number, controller LUN, and device LUN are displayed, followed by a prompt to confirm the save (OK to proceed (y/n)?). The list is saved as a series of strings and may take up to three blocks. If no macros are currently defined, no write is done. A NO MACRO DEFINED message is displayed. Default are set each time either MAR or MAW is invoked. When either command has been used, the default controller, device, and block numbers are set to those used. If macros were loaded from controller 0, device 2, block 8 with command MAR, the defaults for a later invocation of MAW would be the same. Errors encountered during I/O are reported along with the 16-bit status word returned by the I/O routines. Example For the example, assume that controller 0, device 2 is accessible. Load macros from block 3. http://www.motorola.com/computer/literature 3-123 Debugger Commands PPC1-Bug> MAR 0,2,3 PPC1-Bug> List macros. 3 PPC1-Bug> MA MACRO ABC 010 MD 3000 020 GO \0 PPC1-Bug> Define macro ASM. PPC1-Bug> MA ASM M=MM \0;DI M= (CR) PPC1-Bug> List all macros. PPC1-Bug> MA MACRO ABC 010 MD 3000 020 GO \0 MACRO ASM 010 M=MM \0;DI PPC1-Bug> Save macros to block 8, previous device. PPC1-Bug> MAW ,,8 Saving to: VME320, Controller 0, Drive 2, Block/File Number 8 Number of Logical Blocks = 2 OK to proceed (y/N)? Y PPC1-Bug> 3-124 Computer Group Literature Center Web Site Debugger Commands MD, MDS - Memory Display Command Input 3 MD ADDR[:COUNT | ADDR] [; [B|H|W|S|D|DI] ] MDS ADDR[:COUNT | ADDR] [; [B|H|W|S|D|DI] ] Options Integer Data Types B Byte H Half-word W Word Floating Point Data Types S Single Precision D Double Precision DI Enable the one-line disassembler. All other options are invalid if DI is selected. Description The MD and MDS commands display the contents of multiple memory locations all at once. The default data type is word. Also, for the integer data types, the data is always displayed in hexadecimal along with its ASCII representation. The optional COUNT argument specifies the number of data items to be displayed (or the number of disassembled instructions to display if the disassembly option is selected). The default is 8 for MD. MDS displays 128 items (a sector) as the default. To re-execute the command, press the Return key at the prompt immediately after the command has executed. The command displays an equal number of data items or lines beginning at the next address. http://www.motorola.com/computer/literature 3-125 Debugger Commands Examples Example 1: PPC1-Bug>MD 22000;H 00022000 2800 1942 2900 1942 PPC1-Bug> 00022010 FC20 0050 ED07 9F61 PPC1-Bug> 3 2800 1842 2900 2846 (..B)..B(..B).(F FF00 000A E860 F060 | .Pm..a....h’p’ Example 2: For this example, assume the microprocessor register state is R5=00023627. PPC1-Bug>MD R5:&19;B 00023627 4F 82 00 C5 9B 10 33 7A DF 01 6C 3D 4B 50 0F 0F O..E..3z_.l=KP.. 00023637 31 AB 80 1+. PPC1-Bug> Example 3: PPC1-Bug>MD 30000;DI