Motorola PPCBug User Manual

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.
®
Motorola
and the Motorola symbol are registered trademarks of Motorola, Inc.
PowerPC™ is a trademark of IBM, and is used by Motorola with permission.
TM
AIX
is a trademark of IBM Corp.
All other products ment io ned i n this document are trademarks or registered trade ma rk s 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 precaut ions listed be low represent warnings of ce rtain danger s of which Mot orola is awar e. 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 su pplied wi th a three-c onductor A C power ca ble, the po wer cable m ust be plug ged into an a pproved 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 adjust ment. Service pe rsonnel should n ot replace compon ents with power c able connected. Under certain conditions, dangerous voltages may exist even with the power cable removed. To avoid injuries, such personnel should always disconnect power and d is charge circuits before touc hi ng 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 handl e the CRT and avoid rough handling o r jarring of t he equipment . Handling o f 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.
W arn ings , such as th e exa mple be low, preced e pote ntia lly da nger ous pro cedure s thro ugh out th is manual . In struc tion s contained in the warnings m ust be follow ed. You should also employ all ot her safety precautions w hich you dee m necessary for the operation of the equi pm ent in your operating en vi ronment.
To prevent serious injury or death from dangerous voltages, use extreme caution when handling, testing, and adjusting this equipment and its
Warning
components.
Notice
While reasonable efforts have been made to assure the accuracy of this document, Motorola, Inc. a ssumes n o lia bility r esulti ng from any omissio ns in this docu ment, or from the use of the information ob tained therein. Motorola reserv es the right to r evise this document and to ma ke c hanges from time to time in the content he reof 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 n ot be publishe d commercially in print or ele ctronic form, e dited, transla ted, or otherwise altered without the permission of Motorola, Inc.
It is possible th at t hi s publication may contain r ef erence to or information about Motorola products (machines and pr ograms), progra mming, or services that are not av ailable 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 t he Rig hts i n Tech nical Data clause at DFARS 252.227-7013 (Nov.
1995) and of the Rights in Noncommerc ial Computer Software and Docume ntation c lause 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 Tabl e 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 T ables

Table 1-1. LED/Serial Startup Diagnostic Codes ......................................................1-8
T ab le 1-2. MPCR Method Remote Start Register Model........................................1-33
T ab le 1-3. GCSR Method Remote Start Register Model.........................................1-35
Table 1-4. LM/SIG Register Bit Assignments.........................................................1-36
T ab le 3-1. Debugger Command s........................................ .......................................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
T ab le 5-4. IOSATM Fields (CFGA) ............................................................... .........5-22
T ab le 5-5. IOSPRM Fields (CFGA) .............................................. ...... ..... ...............5-23
T ab le 5-6. IOSEPRM Fields (CFGA)...................................... ...... ..........................5-23
Table 5-7. IOSATW Fields (CFGA) ........................................................................5-24
T ab le 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 Ma nual provides infor mation on the PPCBug firmware, the start-up and boot routines, the debugger commands, the one-li ne assembler/disas sembler, and the debugger system calls.
Information in thi s manua l ap plies 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 Tabl e of Contents, List of Figures,
and List of Tables fo r Cha pte rs 1 t hr ough 3, Chapters 1 through 3 and th e Index.
Part 2 (PPCBUGA2/UM5) contains the Table of Contents and List of Tables for Chapters 4 and 5 and Appendi ces A th rough H, a nd Chapte rs 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 in corporates 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 Su pport (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 "high­level" 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 ex planation of the MPU c lock speed calculation, a des cription of the disk I/O s upport, a description of t he 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 languag e.
Chapter 5, System Calls, describes the PPCBug System Call handler, which allows system call s 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 PPCx­Bug> 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 S- Record 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 descr ibes the various disk status codes supported by PPCBug.
xxi
Appendix G, Establishing Network Connections with PPCBug, describes a procedure that can be used to establis h a netw ork conn ect ion 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 doc umentation. We want to know what y ou 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 corres pondence , plea se li st your name, po si tion, a nd compan y. Be sure to include the title and par t 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 j ust as it appe ars. Bold is al so 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 dis plays and examples, and to intr odu ce new terms.
courier
is used for system output (for example, screen displays, reports), examples, and system prompts.
<Enter>, <Return> or <CR>
<CR> represents the carriage return or Enter key.
CTRL
represents the Control key. Execute control characters by pr essing the Ctrl key and the letter simultaneously, for example, Ctrl-d.
|
separates two or more items from which to choose (one only)
[ ]
encloses an optiona l item th at may not occ ur 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
a hexadecimal character.
0x Zero-x % percent a binary number. & ampersand a decimal number.
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

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 ava ilabl e for lo adi ng and exec uting us er 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 th e diag nost ics and the diagn ost ics ut ili ties and se lf­tests.
MPU, firmware, and hardware initialization routines, which are
described in this manual.
1
The PPCBug firmware is implemented on most Motorola PowerPC-based products:
A PMCspan board ad ded to an y mai n boar d als o in terf ac es wi th PP CBug. They are collectively referred to in this manual as the PowerPC board or
board. The debugger includes:
Commands for display and modification of memoryBreakpoint and tracing capabilitiesAssembler 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-driv en, it performs it s various operatio ns 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 dif ferences due to microprocessor archi te ct ures. These differences ar e pr i ma rily r ef le ct ed i n 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 porta bility and maintainabili ty. Where nece ssary, the a ssembly language has been used in sep arately compiled program module s 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 firmwa re entry. The result is checked with a pre-calculated checksum contained in the last 16-bit word of the Flash image.
Although a command to allow the erasing and repr ogramming
!
Caution
1-2 Computer Group Literature Center Web Site
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.

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
Memory Requirements
1
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
General Information

Start-up

At either power-up or system reset, PPCBug perfo rms the MPU, hardware, and firmware initialization process (refer to MPU, Hardware, and
Firmware Initializat ion on page 1-5). This process inc ludes a check sum of
the FLASH memory contents. The following types of messages are displayed on the firmware console
during the in itialization pr ocess:
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 : ROM Bank B
Mezzanine Configuration: Single-MPU Current 60X-Bus Master : MPU0 Idle MPU(s) : 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 se conds, during which y ou may terminate st art-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
If you do not terminate system start-up , the s ystem begi ns the boot ro utine that has been set up in the ENV command, ei ther 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.
Start-up
1
4. Clear all block address translation registers of the MPU.
5. For “du al 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
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 MPC604­type 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 verif y.
29. Display the amount of local read/write memory found.
30. Verify the configuration data that is resident in NVRAM, and display a war ning message if the verificatio n 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. Execut e the configured bo ot routine, eithe r ROMboot, Autoboot, or Network Autoboot. (PowerPlus architecture boards do not execute a configured boot routine.)
1
40. Execut e the user in terface ( 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 o f the hardware devices. Should the debugger fai l to come up to a prompt, the last c ode dis playe d will indi cate how far the in itia lizat ion 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
General Information
The operating syste m boot sequenc e begins at 0x11E0 with t he 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 ar e displayed after 0x11EC.
A line feed can be inserte d after each ser ial cod e is disp lay ed to prev ent it from being overwritten by th e next cod e. 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-segme nt 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 E nable” is set to ‘Y’. The list of LED/serial codes follows.
Table 1-1. LED/Serial Startup Diagnostic Codes
Code (Hex) Location in Startup
1100 Setting up MSR (startup begins) 1102 Invalidating caches 1104 De termining 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 translatio n 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
1-8 Computer Group Literature Center Web Site
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 sav in g regi st ers 112B Setu p the exception control description 112C Setting up buginit section pointers and runtime variables
1130 Retrieving the pro cessor board type
1132 Initializing the Z8536
1134 Initializing local board status
1136 Retrieving the base board type
1138 Ch ecking the level of the ABORT push-button 113A Initializing the interrupt/tim er controller 113C Retrieving MPU id entifier
113E Enabling super-scalar modes
1140 Adding processor-specific work-arounds
1142 Ge tting the bus clock speed
1144 Initializing the keyboard controller
1145 Probe for PCI functions
1146 Initializing th e PCI interrupt route control registers
1148 Starting PCI hierarchy configuration process
Start-up
1
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
General Information
Table 1-1. LED/Serial Startup Diagnostic Codes (Continued)
Code (Hex) 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 configuratio n 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
1-10 Computer Group Literature Center Web Site
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 in format ion
11AA Setting up DRAM and bridge pointers
11AC Initializing DR AM 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
Start-up
1
11D0 Initializing processor timebase/decrementer registers 11D2 Enabling interrupts
http://www.motorola.com/computer/literature 1-11
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 A dding processor information 11E6 Adding memory information 11E8 A dding 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 di agnostics or debugger commands by using the HE (Help) command.
Note Some diagnostics depend on restart defaults that are set up only
in a particular restart mode. Refer to th e PPCBug Diagnostics Manual, PPCDIAA/UM, for the correct mode.
1-12 Computer Group Literature Center Web Site
Refer to the PPCBug Diagnostics Manua l for comple te descriptio ns of the diagnostic routines available and instructions on how to invoke them.

Auto Boot

Note The PowerPlus architecture boards do not execute a configured
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:
Auto Boot
1
boot routine.
Autoboot in progress... To abort hit <BREAK>
Following this me ssage there is a de lay to allow you t o 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 initia lize 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
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 user­defined 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 rout ine must be stored in the FLASH memory to support it. If ROMboot code is insta lled, a user-wri tten routine is given contr ol (i f th e r outin e me ets t he f ormat r equir ement s). On e u se 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 two­byte 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.
1
The length parame ter (offset $8) reflects where the ch ecksum is, and
the checks um is correct.
ROMboot searches predefined areas of the memory map for possible routines and checks for t he “BOOT” indi ca tor. 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 gai n control at p ower-up or reset. To verify that this is the case, th e bytes star ting from “BOOT” thr ough 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
General Information
1. Searc h direct address fo r “BOOT”. The dire ct address points to an
installed ROMboot routine . It is a variabl e that may be set using t he ENV command.
2. Search complete ROM map.
3. Search local RAM, at all 8KB boundaries starting at the beginning of local RAM.
4. Searc h 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:
Outputs a <CR> <LF> sequence to the default output port.Displays the date and time from the current cursor position.Outputs two more <CR> <LF> sequen ces to the default output port. Returns con t rol to PPCBug.
1-16 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. Displ ay entire ROMboot routine (check sum bytes are at $00010038 and $00010039).
PPC1-Bug>MD 10000 :10 <Return>
00010000 424F4F54 00000010 0000003A 54455354 BOOT.......:TEST
00010010 39400026 44000002 39400052 44000002 9@.&D...9@.RD... 00010020 39400026 44000002 39400026 44000002 9@.&D...9@.&D...
00010030 39400063 44000002 0000FFFF FFFFFFFF 9@.cD...........
4. Disassemble executable instructions.
PPC1-Bug>MD 10010:5;DI <Return> 00010010 39400026 SYSCALL .PCRLF 00010018 39400052 SYSCALL .RTC_DSP 00010020 39400026 SYSCALL .PCRLF 00010028 39400026 SYSCALL .PCRLF 00010028 39400063 SYSCALL .RETURN
1
5. Perform checksum on locations $10000 through $10037 (refer to the CS command information in Chapter 3, ).
PPC1-Bug>CS 10000:38/2;H <Return> Effective address: 00010000 Effective count : &56 Checksum: ACFA
6. Insert checksum into bytes $10038, $10039.
PPC1-Bug>M 10038;H <Return> 00010038 0000? ACFA. <Return>
7. Display the entire ROMboot routine with checksums.
PPC1-Bug>MD 10000 :10 <Return>
00010000 424F4F54 00000010 0000003A 54455354 BOOT.......:TEST
00010010 39400026 44000002 39400026 44000002 9@.&D...9@.RD... 00010020 39400026 44000002 39400026 44000002 9@.&D...9@.&D...
00010030 39400063 44000002 ACFAFFFF FFFFFFFF 9@.cD...........
http://www.motorola.com/computer/literature 1-17
1
General Information
8. Verify the functionality of the user ROMboot routine with the RB
command.
PPC1-Bug>RB; V <Return> ROMboot about to Begin... Press <ESC> to Bypass, <SPC> 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 so ftware routi ne that provid es 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 <BREAK>
Following this mess age th ere is ap prox imatel y a fi ve-se cond del ay befor e 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
Network Autoboot is controll ed by parameters contained in the NIOT and ENV commands. These parameters allow the selection of specific boot devices, systems, and f iles and allow programmin g 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 co ld reset, a total sy stem initial ization ta kes place, a s if the PowerPC board had just been powered up. All static variables are restored to their def ault states. The breakpoin t table and offset regist ers are cleared. The target registers are invalidated. Input and output character queues are cleare d. Onboard devices ar e reset, and the f irst two seria l ports are reconfigured to their default state.
Restarting the System
1
During warm reset, the PPCBug variab les and tables are preserve d, 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 pressin g and rele asing t he ABORT switc h. Whenev er 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 Poin ter, status registe r, and format and vector information.) For
http://www.motorola.com/computer/literature 1-19
1
General Information
this reason, abort is most appropriate when terminating a u ser 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.

Reset/Abort

Break

Pressing and releasing the 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 brea kpoint table re mains intact. Control is returned t o the debugger.
You may wish to perform “double-button reset” by pressing the RESET
ABORT switches at the same time. Release RESET first, wait seven
and seconds, and then re lease 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 wit h the same ENV parameters as if you had used the command ENV;D.
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 i ntact. Break also takes a snapshot of the machine s tate if the function was entered using SYSCALL. This machine state is then accessible to you for diagnostic purposes.
ABORT switch generates a local board
ABORT. This resets al l onboard d evices, as well
Many times it may be desir able to termin ate a de bugger co mmand p rior to its completion; for exampl e, the display of a large block of me mory. Break allows you to t erminate the comman d.
1-20 Computer Group Literature Center Web Site

Board Failure

The following conditions result in a board failure. These conditions also give a WARNING message, if possible:
Restarting the System
1
Board initialization error/ failureDebugger object checksum errorConfiguration data (NVRAM ENV parame ters) failure (i.e.,
checksum)
Configuration data (NVRAM CNFG parameters) failure (i.e. ,
checksum)
Calculated MPU clock speed doe s not match the associ ative CNFG
parameter
Calculated BUS clock speed doe s not matc h the associat ive CNFG
parameter
Selftest erro r/failure
If the board is equ ipped with a board f ail LED, the LED will be illuminated when a board failure occurs.
SYSFAI L* Assertion and Negation (VMEbus Boards)
On VMEbus boards, the board fail is th e same as the SYSFAIL indic ator. 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 con diti ons have occ urred . However, SYSFAIL* stays asserted if any of the board failure conditions have occurred. In this way, the state o f the debugge r is i ndicated to the u ser or VMEbus masters . In a multi-computer co nfi guration , ot her VMEbus mas ters could view the pertinent contr ol and status registe rs to determine which CPU i s a sserting 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
General Information
Notes Assert indicates a signal is active or true. Negate indicates a
signal is inactive or false. These terms are used independ ently 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 wh en the it is low (S YSFAIL* 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 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.
CNFG

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 st ructures for disk paramet ers (refer to Chapter
5, System Calls for information on sys tem calls).
Parameters such as the address where the module is mapped and the type and number of devices att ached to the co ntroller module ar e kept in tabl es by PPCBug. Default values for these para meters are assigned a t 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

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 logi cal block size is se t t o 2 56 bytes for every bloc k 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 contro ller to initiate the transfer. If th e conver sion f rom bloc ks to se ct ors yi elds a fract io nal sec tor count, an error is returned and no data is transferred.

Device Probe

Disk I/O Support
1
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 statu s of device pr esent and unknown. The dev ice probe make s an entry int o 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
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 t he next disk command uses the same con troller 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. Wi th the IOI command, you can view the table and clear i t if necessary.
IOP (Physical I/O to Disk)
If you start the IOP format procedure, it must be allowed to complete
!
Caution
(PPCxBug> prompt returns) or el se the disk drive may be t otally disabled. This format procedure may take as long as half an hour.
The IOP command allows you to rea d or write bloc ks of data, or to format the specified dev ice in a cert ain way. IOP creates a co mmand packet f rom 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 parame ters 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 s end command packets as def ined by the particular cont roller di rectly. IOC can also be used t o look at the resul tant device packet after using the IOP command.
1-24 Computer Group Literature Center Web Site
PBOOT (Bootstrap Operating System)
The PBOOT command reads an operati ng system or control program from the specified device into memory, and then transfers control to it.
With the H option, PBOOT reads an operating s ystem or contr ol program from a specified device into memory, and then returns control to the debugger.
Disk I/O Support
1
http://www.motorola.com/computer/literature 1-25
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 comma nd-l evel disk operations provide a convenient way of usi ng thes e syst em call s wit hout wri ting and exe cutin g a program.)
The following syste m calls are provi ded to a llow user programs to do di sk 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 othe r 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 (controller­independent) packet format as an argument, and translate it into a controller-specifi c packet, which is t hen sent to the spe cified device. Refe r 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 t he particular contr oll er module for the form at of its packe ts. Refer to the IOC command section i n
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 Ap pendix E, Disk and Tape Control lers). 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.
1
http://www.motorola.com/computer/literature 1-27
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 ha s the diskle ss remote node r eading the boo t file
across the network into its memory.
Figure 1-1 on page 1-29 depi cts the vari ous mod ules (ca pabil ities) 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 surroun ds and manages the Ethernet contro ller 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 int erconnected s ystems of packet-switched computer communication networks. The Internet Protocol provides fo r t ra nsmi tt in g bl ocks 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
Boot Control Module
(Two phases)
Network I/O Support
1
Bootstrap Protocol
(BOOTP)
RFC 951
Address Resolution
Protocol (ARP)
RFC 826
Reverse Address Resolution Protocol (RARP) - RFC 903
Ethernet Driver Physical Layer
Manager
Internet Protocol (IP)
Figure 1-1. Network Boot Modules
Trivial File Transfer
Protocol (TFTP)
RFC 783
User Datagram Protocol (UDP)
RFC 768
RFC 791
1273 9401
http://www.motorola.com/computer/literature 1-29
1
General Information

RARP and ARP Modules

The Reverse Address Resolution Protocol (RARP) basicall y consists of a n
identity-less node that broadcasts a “whoami ” packet onto the Ethern et 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., Et hernet addr esses). Th e RARP protoco l module s upports 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 Prot oco l (TFTP) is a si mple prot oco l to transfer files. It is implemented on top of the In ternet User Datagram Protocol (UDP or Datagram) so it may be used to move file s betw een machi nes on different networks i mplementing UDP. The only thing it can do is read a nd write files from/to a remote server.

Network Boot Control Module

The control capability of the Network Boot Control M odule is needed to tie together all the necessary modules (capabilities) and to sequence the booting process. The bootin g sequenc e consists of two phases. The fir st 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 equi pped wit h the
DEC2155x PCI-to-PCI Bridge device.
A dual-ported resource is a hardware feature that makes local memory locations or re giste rs av ailab le to re mote proce ssors as well a s to t he lo cal processor.
1
This ‘remote start’ capability is provided to allow the user to take advantage of boards with dual-ported resources to implement and “bootstrap” a multipr ocess or sy stem where member proc essor 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
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 pa rame ter is
“Remote Start Method Switch”. The valid choices for this parameter are:
ENV
Parameter
Value
G GCSR method only
M MPCR method only
B N none - remote start is disabled
Remote Start Method Setting
both GCSR and MPCR methods active

Multiprocessor Control Register (MPCR) Method

The MPCR method of remote start is ba sed on the use of dual -ported local memory resources.
A remote processor boar d (t he host ) can in it iate PPCBug fun ction s on t he 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 loca l memory, defined as the Multipr ocessor 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 <the local RAM size (in bytes)>-$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 t wo words u sed to cont rol communica tion between processors. It is organized as follows:
Table 1-2. MPCR Method Remote Start Register Model
1
Register
Name
MPCR 0
MPAR 4 Address
Byte
Offset
313029282726252423222120191817161514131211109876543210
Command
/Status
Reserved
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
0 ($00)
‘E’ ($45)
‘R’ ($52)
Hex
Value
Indicated Status
Wait. PPCBug initialization is not yet complete.
The program pointed to by the MPAR address is executing.
Ready . The tar get board ( PPCBug) is ready for a remote start command to be written to this register.
http://www.motorola.com/computer/literature 1-33
1
General Information
The MPCR command codes that may be set by the host processor are:
ASCII
Value
‘G’ ($47)
‘B’ ($42)
‘P’ ($50)
Hex
Value
Host Command Description
Commence program execution using Go Direct logic (refer to the GD command). The address of execution is specified in the MPAR address register.
Install breakpoints usin g the GO logic (refer to the GO command).
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.
The MPAR register co ntents specify a n address para meter to be as sociated 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 ind icate t hat init ializa tion i s complet e. Then the prompt is sent.
If no terminal is connected to the port, the MPCR is still polled to see whether an external proc essor 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 trans ferred (like the GO command).
1-34 Computer Group Literature Center Web Site
In either sequence, an E is placed in the MPCR to indicate that execution is underway just befor e cont rol is passe d to RAM. (A ny remote pr ocesso r 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 promp t, 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 star t, over the VMEbus, on boards equipped with the Universe PCI to VMEbus bridge.
When PPCBug is executing on the target processor boa rd, a host proc essor
board may initiate progr am execution by the ta rget board’s MPU using the GCSR method of remote start.
This method of remote start is implemented through the dual-ported register inte rface provided by t he Universe MBOX regis ters. This inte rface 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 i s accessed from.
Multiprocessor Support (Remote Start)
1
The GCSR method remote start r egister model is organi zed as shown in the following table:
Table 1-3. GCSR Method Remote Start Register Model
Universe
Register
Name
MBOX0 $348
MBOX1 $34C GCSR1 GCSR2 MBOX2 $350 GCSR3 GCSR4 MBOX3 $354 GCSR5 Not Used
http://www.motorola.com/computer/literature 1-35
Byte
Offset
313029282726252423222120191817161514131211109876543210
LM/SIG Register
Reserved GCSR0
1
General Information
The LM/SIG register is assigned the following bit definitions:
Table 1-4. LM/SIG Register Bit Assignments
Bit3130292827262524
Name
Reserved Reserved Reserved Reserved Reserved Reserved Reserved SIG0
The VME host board can initiate program exec ut ion 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 regis ter s 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 bre akpoints, and be gin execution a t the specified address.
Note: The above steps assume that th e Universe CSR has be en 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 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.
Data and Address Sizes
1
http://www.motorola.com/computer/literature 1-37
1
General Information
1-38 Computer Group Literature Center Web Site

2Using the Debugger

Entering Commands

The debugger is command-driven and performs its various operations in response to commands that you enter at the keyboard. When the PPCx- Bug> prompt appears on the screen, the debugger is ready to accept commands.
What you enter is st ored i n an inter nal bu ffer. Exec ution b egi ns only afte r you press the Retur n key, allowing you t o correct entry er rors, 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 encoun t ered during execution of the us er program. For more about thi s, refer to the GD, GO, and GT command descriptions in Chapter 3, Debugger Commands.
2
Alternately, the us er program could r eturn to the d ebugger 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 nameAny required arguments, delineated with either a space or comma
(precede the first argument with a space)
Any required opti ons. Precede an option or a string of options wit h
a semi-col on (;). 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 d elimiter 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:
+plus
- minus * multiply by / divide by & logical AND << shift left >> shift right
2-2 Computer Group Literature Center Web Site
Entering Commands
Numeric values may be expr essed in either hexade cimal, 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 strin g literal must begin and end with t he single quote mark (’). The numeric va lue is interpreted as the concatenation of the ASCII values of the charac ters. This value is right-j ustified, a s any other numeric value would be.
String Literal
’A’ 41 ’A BC’ 414243 ’TEST’ 54455354
Numeric Value (Hexadecimal)
2
Evaluation of an e xpressio n is al ways from le ft to r ight unl ess par entheses are used to group pa rt of the exp re ssion. 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
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 simi lar to the sy ntax accepte d 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 regis te r number ( Rn) form, the debugger uses the address contained in MPU Register Rn, where n is 0 th rough 31 (i.e., 0, 1, . . . 31) .
2-4 Computer Group Literature Center Web Site
Entering Commands
If the address ran ge specified as ADDR ADDR, with a size option of either H (half-word) or W (w ord), data at the second (ending) a ddress 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-regis ters ( Z0-Z7) ca ll ed offse t regi sters are used to si mplify the debugging of relocatable and position-independent modules. The listing files in these ty pes of programs usually star t 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 displ ay of add resses i n a rel ative addr ess+offs et 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 re gister. Spec ifying the base and top addresse s for an offset register se ts its range . In the event that an address falls in two or more of fs et 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.
2
http://www.motorola.com/computer/literature 2-5
Using the Debugger
2
PORT
The PORT argument is the logical number of the port to be used to input or output. Valid port number s which may be used f or these comman ds are as follows :
0 or 00 Te rminal port 0 (c onsole port) is us ed f or in terac tive u ser
input and output (the def ault), or may al so be used fo r the graphics adapter devic e. This port is labeled COM1 or SER1 or DEBUG on the PowerPC board or transition module.
1 or 01 Te rminal port 1 (host port) is the defaul t for download ing,
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 descripti ons. Precede a n option or a st ring of options with a semi-colon (;) . If no option is entere d, the command’s defa ult 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 co ntrol characters to scroll through the listed items:
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
2-6 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 c onfigured (hardcopy mode), a <CR><LF> 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):
2
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
Using the Debugger
2
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 u sing the Assembler/Disas sembler, and store the program to the host u sing 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.
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 conv enient way of do ing char ac ter i nput/o utpu t and many other useful opera tions so that you do not have t o 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 co ntain temporary vari ables and exception vect ors. 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 t o its vari ous resources . The debugg er 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

The debugger requires approximately 768KB (maybe less) of read/write memory. It allocates this amount of memory from the to p 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 de bugger for program stack, I/ O buffers, variables, and register files. If a user program is loaded (booted, S­Records) int o memory, and if this program is ut ilizing 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 de bugger’s read/write memory space . The target IP is s et 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.
2
The amount of read/w rite memory spa ce that is alloc ated for the debu gger, and by the debugger, may increase in future releases. To properly compensate for the increased read/write memory requirements, user programs may use th e target r egister R1 as indic ator f or the top (plus 1) o f 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
2
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.

MPU Registers

Certain MPU registers must be preserved for their specific uses.
MPU Register SPR275
MPU register SPR275 i s reser ved for usage b y the de bugger. I f SPR275 i s to be used by the user progr am, it must be rest ored prior to using debugger resources (system calls) and or returning control to the debugger.
MPU Registers SPR272-SPR274
These MPU registers are u sed by the deb ugger 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 t he return fr om user state to the debugger state.
When the context switch transitions from the user state to the debugger state, the following MPU reg is ter s are captured:
PPC603-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, 976 - 981, 1008, 1010) IP Instruction Pointer (copy of SPR26) MSR Machine State Register (copy of SPR27)
2-10 Computer Group Literature Center Web Site
Context Switchi ng
CR Condition Register FPSCR Floating Point Status/Control Register
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 reg is te rs are restored:
PPC603-based boards:
R0-R31 General Purpose Registers
2
FR0-FR31 Floating Point Unit Data Registers SPRn Special Purpose Registers (n is 1, 8, 9, 275, 1010) IP Instr ucti on Po in t er, 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 SPRn Special Purpose Registers
Unit Data 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 hono rs the user’s MMU configuration. If t he user’s program wishes to utiliz e the programmatic in terface (i.e., syste m calls) of the debugger, it must maintai n the address tran slation 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_FFFFFFFFFFFF F Scientific Notation
(decimal)
-3.12345678901234501_E+123
When entering data in single or double precision format, observe the following ru les:
The sign field is the first field and is a binary field.
2-12 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 separ ated f rom adja cent f ields by an unde rscor e.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.
2

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 ha ve an im plied intege r
bit (always 1 ).
http://www.motorola.com/computer/literature 2-13
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 p acked decimal number and t hen 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

Introduction

This chapter contain s descriptions of each debugge r 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 Description
AS One Line Assembler BC Block of Memory Compare BF Block of Memory Fill BI Block of Memory Initialize BM Block of Memory Move BR Breakpoint Insert NOBR Breakpoint Delete BS Block of Memory Search BV Block of Memory Verify CACHE Modify Cache State CM Concurrent Mode NOCM No Concurrent Mode CNFG Configure Board Information Block CS Checksum CSAR PCI Configuration Space READ Access (NOTE 2) CSAW PCI Configuration Space WRITE Access (NOTE 2) DC Data Conversion DMA Move Block of Memory DS O ne Line Disassembler DU Dump S-Records ECHO Echo String ENV Set Environment
3
3-1
Debugger Commands
Table 3-1. Debugger Commands (Continued)
Command Description
FORK Fork Idle MPU at Address (NOTE 2)
3
FORKWR Fork Idle MPU with Registers (NOTE 2) GD Go Direct (Ignore Breakpoints) GEVBOOT Global Environment Variable Boot (NOTE 1) GEVDEL Globa l Environment Variable Delete (N OTE 1) GEVDUMP Global Environment Variable(s) Dump (NOTE 1) GEVEDIT Global Environment Variable Edit (NOTE 1) GEVINIT Global Environment Variable Initialization (NOTE 1) GEVSHOW Global Environment Variable(s ) Display (NOTE 1) GN Go to Next Instruction G, GO Go Execute User Program GT Go to Temporary Breakpoint HE Help IBM Indirect Block Move IDLE Idle Master MPU (NOTE 2) IOC I/O Control for Disk IOI I/O Inquiry IOP I/O Physical (Direct Disk Access) IOT I/O Teach for Configuring Disk Controller IRD Idle MPU Register Display (NOTE 2) IRM Idle MPU Register Modify (NOTE 2) IRS Idle MPU Register Set (NOTE 2) LO Load S-Records from Host MA Macro Define/Display NOMA Macro Delete MAE Macro Edit MAL Enable Macro Listing NOMAL Disable Macro Listing MAR Load Macros MAW Save Macros MD, MDS Memory Display MENU System Menu M, MM Memory Modify MMD Memory Map Diagnostic MMGR Memory Manager MS Memory Set MW Memory Write NAB Automatic Network Boot NAP Nap MPU (NOTE 2) NBH Network Boot Operating System, Halt NBO Network Boot Operating System
3-2 Computer Group Literature Center Web Site
Table 3-1. Debugger Commands (Continued)
Command Description
NIOC Network I/O Co nt rol NIOP Networ k I / O Ph y sical NIOT Network I/O Teach (Configuration) NPING Network Ping OF Offset Registers Display/Modify PA Printer Attach NOPA Printer Detach PBOOT Bootstrap Operating System PF Port Format NOPF Port Detach PFLASH Program FLASH Memory PS Put RTC into Power Save Mode RB ROMboot Enable NORB ROMboot Disable RD Register Display REMOTE Remote RESET Cold/Warm Reset RL Read Loop RM Register Modify RS Register Set RUN MPU Execution/Status (NOTE 2) SD Switch Directories SET Set Time and Date SROM SROM Examin e/M odify (NOTE 2) SYM Symbol T a bl e Attach NOSYM Symbol Table D etach SYMS Symbol Tabl e D is play / Se a rc h 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
Debugger Commands
3
http://www.motorola.com/computer/literature 3-3
Debugger Commands
Notes
3
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-4 Computer Group Literature Center Web Site

AS - One-Line Assembler

Command Input
Debugger Commands
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.
3
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 dat a type is word.
No confirmation is printed if the memor y being compared mat ch es. 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, ass ume 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 2 1000 <Return> 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 21 000;B <Return> Effective address: 00020000 Effective count : &32 Effective address: 00021000 PPC1-Bug>
Example 3: Create a mismatch (using the MM command), an d prints out the mismatches.
PPC1-Bug>MM 2100F;B <Return> 0002100F 21? 0. <Return> PPC1-Bug>
PPC1-Bug>BC 20000:20 21 000;B <Return> Effective address: 00020000 Effective count : &32 Effective address: 00021000 0002000F|21 0002100F|00 PPC1-Bug>
3
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 tru ncation 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 incr ement i s spec if ied, t hen data is incremented by this value following each write, ot herwise data remains a constant value.
A decrementing pattern may be accomplished by entering a negative increment. The data you enter is right -justif ied in either a byt e, 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 exact ly whe re data was stored.
Examples Example 1: For this exa mp le , a ssume that memory fr om $ 2000 0 t hrough
$2002F is clear. Because no option is specified, the l ength of the d ata field defa ults to word.
3
PPC1-Bug> Effective address: 00020000 Effective address: 0002001F PPC1-Bug>
PPC1-Bug> 00020000 0000 4E71 0000 4E71 0000 4E71 0000 4E71 ..Nq..Nq..Nq..Nq 00020010 0000 4E71 0000 4E71 0000 4E71 0000 4E71 ..Nq..Nq..Nq..Nq
00020020 0000 0000 0000 0000 0000 0000 0000 0000 ................
BF 20000,2001F 4E71 <Return>
MD 20000:18;H <Return>
Example 2: For this example , a ssu me t hat memory from $20000 thr ough
$2002F is clear. The specified dat a does not fi t into t he spe cifie d da ta fi eld s ize, t he data i s
truncated, and the Data = message is output.
PPC1-Bug> Effective address: 00020000 Effective count : &16 Data = $71 PPC1-Bug>
PPC1-Bug> 00020000 7171 7171 7171 7171 7171 7171 7171 7171 qqqqqqqqqqqqqqqq
00020010 0000 0000 0000 0000 0000 0000 0000 0000 ................
00020020 0000 0000 0000 0000 0000 0000 0000 0000 ................
PPC1-Bug>
BF 20000:10 4E71;B <Return>
MD 20000:18;H <Return>
Example 3: For this example , a ssu me t hat memory from $20000 thr ough
$2002F is clear. The word pattern does not fit evenly in the given range. Only one word is
written and the Effective address messages r eflect the fact that data is not written all the way up to the specified address.
http://www.motorola.com/computer/literature 3-9
Debugger Commands
PPC1-Bug> Effective address: 00020000 Effective address: 00020003 PPC1-Bug>
3
PPC1-Bug>
00020000 1234 5678 0000 0000 0000 0000 0000 0000 .4Vx............
00020010 0000 0000 0000 0000 0000 0000 0000 0000 ................
00020020 0000 0000 0000 0000 0000 0000 0000 0000 ................
BF 20000,20006 12345678; W < R e turn>
MD 20000:18;H <Return>
Example 4: For this example, assume memory from $20000 through
$2002F is clear.
PPC1-Bug> Effective address: 00020000 Effective count : &48 PPC1-Bug>
PPC1-Bug>
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>
BF 20000:18 0 1;H <Return>
MD 20000:18;H <Return>
3-10 Computer Group Literature Center Web Site

BI - Block of Memory Initialize

Command Input
Debugger Commands
BI RANGE [;B|H|W] Options
B Byte H Half-word W Word
Description
The BI initializes pa rity for a block of memory. The BI command is non­destructive; i f the parity is correct for a memory locat ion, then the contents of that memory location are not altered.
The limits of the bl ock of memory to be i nitiali zed may be sp ecified u sing 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 p arity. 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.
3
This command may take several seconds to initialize a large block of memory.
Examples Example 1:
PPC1-Bug>BI 0:10000;B <Return> 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 <Return>
3
Effective address: 00000000 Effective address: 001FFFFF RAM FAIL AT $00100000 PPC1-Bug>
3-12 Computer Group Literature Center Web Site

BM - Block of Memory Move

Command Input
Debugger Commands
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 loca tion. If an option field is specified without a COUNT in the RANGE, an error results.
The BM command is usef ul for patc hing as semb ly code in memor y (refer to example 2).
The defaul t data size is word.
3
Examples Example 1: For this example, ass ume t hat memor y f ro m 20000 to 200 0F
is clear.
PPC1-Bug> 00021000 5448 4953 2049 5320 4120 5445 5354 2121 THIS IS A TEST!!
00021010 0000 0000 0000 0000 0000 0000 0000 0000 ................
PPC1-Bug> PPC1-Bug>
Effective address: 00021000 Effective address: 0002100F Effective address: 00020000 PPC1-Bug>
http://www.motorola.com/computer/literature 3-13
MD 21000:10;H <Return>
BM 21000 2100F 20000 <Ret urn>
Debugger Commands
PPC1-Bug> 00020000 5448 4953 2049 5320 4120 5445 5354 2121 THIS IS A TEST!!
00020010 0000 0000 0000 0000 0000 0000 0000 0000 ................
PPC1-Bug>
3
Example 2: Patch assembly code in memory
MD 20000:10;H <Return>
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 <Return> 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 instruct ion and th e ADD instruc tion, Block Move the object c ode down four bytes to make room for t he ANDC.
PPC1-Bug>BM 20008 20010 2000C <Return> Effective address: 00020008 Effective address: 0002000F Effective address: 0002000C PPC1-Bug>
PPC1-Bug>MD 20000 20014;DI <Return> 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 <Return> 00020008 7C631378 OR R3,R3,R2? ANDC R3,R3,R2 <Return> 00020008 7C631078 ANDC R3,R3,R2 0002000C 7C631378 OR R3,R3,R2? . <Return> PPC1-Bug>
3-14 Computer Group Literature Center Web Site
PPC1-Bug>MD 20000 20014;DI <Return> 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>
Debugger Commands
3
http://www.motorola.com/computer/literature 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 st ate is saved in the targ et 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. Th e breakpoints are kept in a tabl e which is displayed each ti me either BR or NOBR is used . If an addres s 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 en tries are delete d from the breakpoint table and the empty table is displayed.
Examples Example 1: Set some breakpoints.
PPC1-Bug>BR 1E000,1E200 1E700:&12 <Return> BREAKPOINTS 0001E000 0001E200 0001E700:C PPC1-Bug>
3-16 Computer Group Literature Center Web Site
Example 2: Delete specified breakpoint.
PPC1-Bug>NOBR 1E200 <Return> BREAKPOINTS 0001E000 0001E700:C PPC1-Bug>
Example 3: Delete all breakpoints.
PPC1-Bug>NOBR <Return> BREAKPOINTS PPC1-Bug>
Debugger Commands
3
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 p a ttern 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 optio n field indicat es 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 agai ns t 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:
data is right-j ustified a nd leading bi ts are trun cated or lea ding zero s
1. 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 w ith data.
Comparison is made only on those bits at bit positions corresponding to a one in mask . If mask is not spec ified, 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 bas is, rather than by h alf-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
3. If a ma tch is found, then the add ress of the fi rst byte of the match is output along with the memory contents. If a mask was in use, then the actual data at the memory l ocation is displayed, rather th an 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 mo des, informatio n 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
Debugger Commands
to display. To resume output, you should simply press any character key. To cancel the output and ex it the command, you should pre ss the BREAK key.
3
If a match is fou nd (or, in the c ase of Mo de 3, a mismatch) wi th a s eries 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 la st match does not lie enti re ly wi thin the range. You may search non-contiguous memor y with this comma nd without causing a Bus Error.
For the examples below, assume the following data is in memory.
00030000 0000 0045 7272 6F72 2053 7461 7475 733D ...Error Status= 00030010 3446 2F2F 436F 6E66 6967 5461 626C 6553 4F//ConfigTableS
00030020 7461 7274 3A00 0000 0000 0000 0000 0000 tart:...........
Examples Example 1: Mode 1: The string is not found, so a message is output.
PPC1-Bug>BS 30000 3002F ’Task Status’ <Return> Effective address: 00030000 Effective address: 0003002F
-not found­PPC1-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’ <Return> Effective address: 00030000 Effective address: 0003002F 00030003 PPC1-Bug>
Example 3: Mode 1: The string is found, but it ends outside of the r ang e, so the address of its first byte and a message are output.
PPC1-Bug>BS 30000 3001F ’ConfigTableStart’ <Return> Effective address: 00030000 Effective address: 0003001F 00030014
-last match extends over range boundary­PPC1-Bug>
3-20 Computer Group Literature Center Web Site
Debugger Commands
Example 4: Mode 1, using RANGE with COUNT and size o ption: COUNT is displayed in decimal, and address of each occurrence of the string is output.
PPC1-Bug>BS 30000:30 ’t’;B <Return> Effective address: 00030000 Effective count : &48 0003000A 0003000C 00030020 00030023 PPC1-Bug>
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 <Return> 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 <Return> Effective address: 00030000 Effective address: 0003002F
-not found­PPC1-Bug>
Example 7: Mode 2, the size is half-word and non- aligned opt ion is used, so the data pattern is found and displayed.
PPC1-Bug>BS 30000,3002F 3D34;HN <Return> Effective address: 00030000 Effective Address: 0003002F 0003000F|3D34 PPC1-Bug>
3
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 <Return> Effective address: 00030000 Effective count : &48 00030006|6F 0003000B|61 00030015|6F 00030016|6E 00030017|66 00030018|69 00030019|67 0003001B|61 0003001C|62 0003001D|6C 0003001E|65 00030021|61 PPC1-Bug>
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 <Return> Effective address: 00003000 Effective address: 0001FFFF 0000C000|E501 0001E224|A30E PPC1-Bug>
3-22 Computer Group Literature Center Web Site

BV - Block of Memory Verify

Command Input
Debugger Commands
BV RANGE data [increment] [;B|H|W] Arguments
data Data pattern to be co mpared 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 tru ncation occurs, then a message is printed stating the increment which was actually used.
Options
B Byte H Half-word W Word
Description
3
The BV command compare s the specif ied range of memory a gainst a data pattern. If an incr ement is speci fied, then data is incremente d by this valu e 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, half­word, or word field ( as spe cifie d by t he opti on selec ted). The def ault fiel d 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
3
range is read from in any case. The Effective address messages displayed by the command show exactly the extent of the area read from.
Examples Example 1: For this example, assume memory fro m $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> 00020000 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 NqNqNqNqNqNqNqNq 00020010 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 NqNqNqNqNqNqNqNq 00020020 4E71 4E71 4E71 4E71 4E71 4E71 4E71 4E71 NqNqNqNqNqNqNqNq PPC1-Bug>
PPC1-Bug> Effective address: 00020000 Effective address: 0002001F PPC1-Bug>
MD 20000:18;H <Return>
BV 20000 2001F 4E714E71 <Return>
Example 2: For this example, assume memory from $20000 to $20 02F is
as indicated. Mismatches are printed out.
PPC1-Bug>
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 ..........J{J{J{
PPC1-Bug> PPC1-Bug>
Effective address: 00020000 Effective count : &48 0002002A|4A 0002002B|FB 0002002C|4A 0002002D|FB 0002002E|4A 0002002F|FB PPC1-Bug>
MD 20000:18;H <Return>
BV 20000:30 0;B <Return>
Example 3: For this example, assume memory from $20000 to $20 02F is
as indicated. Size is half-word, mismatches are printed out.
PPC1-Bug>
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
MD 20000:18;H <Return>
Loading...