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
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 UpdatedDescription of Change
Overall ChangeMost instances of PPC1Bug or PPC1 were changed to
PPCxBug or PPCx to accommodate multiple versions of
Bug, which have been released.
Chapter 1Since 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 Requirementson 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 3Several 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 GThe content was completely revised from the previous
version of this manual.
Appendix HStatus codes were added for the 21143 and 82559ER
controllers.
Overview of Contents
Chapter 1, General Information, provides an overview of PPCBug,
memory requirements, an explanation of the start-up process, a "highlevel" list of what PPCBug checks, a list of the LED/Serial startup
diagnostic codes, a brief explanation on how to run the Debugger and
Diagnostics firmware interactively, an explanation of the auto boot
xx
process, an explanation of the ROMboot process, an explanation of the
network auto boot process, an explanation on restarting the system, a
description of the types of board failures, an 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 PPCxBug> or PPCx-Diag> environment.
Appendix C, PPCBug Messages, contains a series of tables listing all
PPCBug messages and their meaning.
Appendix D, S-Record Format, describes the purpose and use of the 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):
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 lftests.
❏ 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 memory
❏ Breakpoint and tracing capabilities
❏ Assembler and disassembler useful for patching programs
Various PPCBug routines that handle I/O, data conversion, and string
functions are available to user programs through the System Call handler.
1-1
1
General Information
Because PPCBug is command-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-2Computer 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/AreaOffset
5880 bytes user area0000 - 16f7
2048 bytes debugger area16f8 - 1ef7
256 bytes configuration area1ef8 - 1ff7
8 bytes real time clock registers1ff8 - 1fff
Memory Requirements
1
Example 2: NVRAM = 32768 bytes total size
Size/AreaOffset
30456 bytes user area0000 - 76f7
2048 bytes debugger area76f8 - 7ef7
256 bytes configuration area7ef8 - 7ff7
8 bytes real time clock registers7ff8 - 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/literature1-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 ionon 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
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-4Computer 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/literature1-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 MPC604type chips only).
24. Initialize the Keyboard Controller (PC87303/PC87307/PC87308)
for boards that have the device.
25. Determine the debugger’s Console/Host ports, and initialize the
appropriate UART or Graphic devices.
26. Display the debugger’s copyright message.
27. Display any hardware initialization errors that may have occurred.
28. Checksum the debugger object, and display a warning message if
the checksum failed to 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-6Computer 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/literature1-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
1100Setting up MSR (startup begins)
1102Invalidating caches
1104De termining ROM or RAM execution mode
1106Setting up machine state register
1108Setting up CPU’s address translation registers
110ASetting up CPU’s address translatio n table
110CShutting down redundant processors
110DInit I/O path out to serial port
110EInitializing super I/O chip (CPU initialization completed)
110FEnable ISA bus access
1110Initializing raw I/O device
1111Initialize early stack memory
1112Getting PHB (PCI Host Bridge) Table Pointer
1113Disable all caches
1114Initializing PCI bridge
1116Initializing the powerup flag indicator
1118Calculating the speed of the processor bus
111AWaiting for hardware to initialize memory
111CSetting up the DRAM init parameters
111EInitializing DRAM in bridge/memory controller
1120Setting up debugger memory page area
1122Calculating and setting DRAM speed
1124Calculating and setting ROM speed
1126Enabling instruction cache
1128Setting up debugger memory page tables
112ASetting up debugger kernel pointers and sav in g regi st ers
112BSetu p the exception control description
112CSetting up buginit section pointers and runtime variables
1130Retrieving the pro cessor board type
1132Initializing the Z8536
1134Initializing local board status
1136Retrieving the base board type
1138Ch ecking the level of the ABORT push-button
113AInitializing the interrupt/tim er controller
113CRetrieving MPU id entifier
113EEnabling super-scalar modes
1140Adding processor-specific work-arounds
1142Ge tting the bus clock speed
1144Initializing the keyboard controller
1145Probe for PCI functions
1146Initializing th e PCI interrupt route control registers
114AInitializing RAVEN PCI space
114CInitializing RAVEN time base registers
114DInitialize RAVEN interrupt controller
114EInitializing FALCON ROM
1150Initializing VME bridge
1152Initializing ISA bridge
1154Sending speaker beep
1160Checking abort switch state
1162Initializing exception handling
1164Initializing board identifier structure
1166Initializing point break table
1168Initializing macro subsystem
116AInitializing configuratio n data area
116CInitializing board information data area
116EInitializing I/O (character) subsystem
1170Initializing register file
1172Getting bridge pointer
1174Setting up local memory pointers
1176Setting up local memory size variables
1178Displaying sign-on messages
117Adisplaying board initialization errors
117CVerifying the ROM checksum
117EDisplaying memory size and misc errors
1188Initializing disk I/O subsystem
118AInitializing direction flags
118CInitializing NVRAM (PReP) environment
118EInitializing residual data pointer
1190Initializing input/output pointers
1192Initializing diagnostic subsystem
1194Setting up special init section pointers and runtime variables
1196Initializing abort switch
1198Setting up board suffix and return environment
11A0Retrieving the processor board type
11A2Displaying memory warning and MPU configuration
11A4Clearing MPU idle semaphores
11A6Waiting for MPU logins
11A8Displaying MPU status in format ion
11AASetting up DRAM and bridge pointers
11ACInitializing DR AM ECC/parity
11AEDisplaying DRAM information
11B0Setting up misc. L2 cache variables
11B2Setting up L2 cache size variables
11B4Initializing and flushing L2 cache data parity
11B6Displaying L2 cache parity state
11B8Reading NVRAM contents
11D4Transferring control to monitor (initialization complete)
11D8Error - dropping to RawBug
11E0Initializing residual data structure
11E2Adding vital product data
11E4A dding processor information
11E6Adding memory information
11E8A dding PCI device information
11EAAdding ISA device information
11ECResidual data completed
12nnProbing 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.
NoteSome 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-12Computer 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
NoteThe 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/literature1-13
1
General Information
ROMboot
NoteThe PowerPlus architecture boards do not execute a configured
boot routine.
ROMboot is a mechanism for booting an operating system from a userdefined routine stored in ROM. ROMboot executes at power-up (or
optionally at reset) if it is configured and enabled in parameters set with
the ENV command. It may also be executed with the RB (ROMboot)
command.
Refer to Chapter 3, for information on setting the ENV command
parameters for enabling ROMboot.
For ROMboot to work, a ROMboot 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-14Computer Group Literature Center Web Site
ROMboot
The format of the beginning of the routine is:
OffsetLengthContentsDescription
$004 bytesBOOTASCII string indicating possible
routine; the checksum must be
valid
$044 bytesEntry AddressWord offset from “BOOT”
$084 bytesRoutine LengthWord; includes length from
“BOOT” to and including a twobyte checksum
$0CLength
of name
Routine nameASCII 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/literature1-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-16Computer 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).
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-18Computer 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/literature1-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-20Computer Group Literature Center Web Site
Board Failure
The following conditions result in a board failure. These conditions also
give a WARNING message, if possible:
❏ 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/literature1-21
1
General Information
NotesAssert 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-22Computer 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/literature1-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-24Computer 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/literature1-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:
.DSKRDDisk read - system call to read blocks from a disk into
memory
.DSKWRDisk write - system call to write blocks from memory onto
a disk
.DSKCFIGDisk configure - system call to change the configuration of
the specified device
.DSKFMTDisk format - system call to send a format command to the
specified device
.DSKCTRLDisk 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 (controllerindependent) 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-26Computer 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/literature1-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.
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-30Computer 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.
NotePCI 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/literature1-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
GGCSR method only
MMPCR method only
B
Nnone - 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-32Computer 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
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/literature1-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-34Computer 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$34CGCSR1GCSR2
MBOX2$350GCSR3GCSR4
MBOX3$354GCSR5Not Used
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-36Computer 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/literature1-37
1
General Information
1-38Computer 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 name
❏ Any 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.
EXPExpression (refer to EXP below)
ADDRAddress (refer to ADDR on page 2-4)
COUNTCount; this is a numeric expression and has the same syntax
as EXP (refer to EXP below)
RANGEA range of memory addresses specified with a pair of
arguments, either ADDR ADDR or ADDR : COUNT
TEXTAn ASCII string of up to 255 characters, delimited at each
end by the single quote mark (’)
PORTPort 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-2Computer 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.
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:
ExpressionResult (Hex)
FF0011FF0011
45+99DE
&45+&9990
@35+@67+@105C
http://www.motorola.com/computer/literature2-3
Using the Debugger
2
ExpressionResult (Hex)
%10011110+%1001A7
88<<4880
AA&F0A0
<< 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-4Computer 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.
NoteRelative addresses are limited to 1MB (5 digits ), regardless of the
range of the closest offset register.
2
http://www.motorola.com/computer/literature2-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 00Te 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 01Te 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 vGo 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-6Computer 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:
DELDelete: 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-hPerforms the same function as DEL.
CTRL-xCancel 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-dRedisplay the entire command line entered on the following line
CTRL-aRepeat 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-sWait: halt console output (XON)
CTRL-qResume 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/literature2-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-8Computer 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, SRecords) 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 ResetUsed for the abort switch soft reset feature
00700 - ProgramUsed for instruction breakpoints
00C00 - System CallUsed for the System Call Handler
02000 - Run ModeUsed for instruction tracing
http://www.motorola.com/computer/literature2-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-R31General Purpose Registers
FR0-FR31Floating Point Unit Data Registers
SR0-SR15Segment Registers
SPRnSpecial Purpose Registers (n is 1, 8, 9, 18, 19, 22, 25, 26, 27
268, 269, 275, 282, 287, 528 - 543, 976 - 981, 1008, 1010)
IPInstruction Pointer (copy of SPR26)
MSRMachine State Register (copy of SPR27)
2-10Computer Group Literature Center Web Site
Context Switchi ng
CRCondition Register
FPSCRFloating Point Status/Control Register
PPC604-based boards:
R0-R31General Purpose Registers
FR0-FR31Floating Point Unit Data Registers
SR0-SR15Segment Registers
SPRnSpecial Purpose Registers (n is 1, 8, 9, 18, 19, 22, 25, 26, 27
268, 269, 275, 282, 287, 528 - 543, 1008, 1010, 1013, 1023)
IPInstruction Pointer (copy of SPR26)
MSRMachine State Register (copy of SPR27)
CRCondition Register
FPSCRFloating 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-R31General Purpose Registers
2
FR0-FR31Floating Point Unit Data Registers
SPRnSpecial Purpose Registers (n is 1, 8, 9, 275, 1010)
IPInstr ucti on Po in t er, copied to SPR26
MSRMachine State Register, copied to SPR27
CRCondition Register
FPSCRFloating Point Status/Control Register
PPC604-based boards:
0-R31General Purpose Registers
FR0-FR31Floating Point
SPRnSpecial Purpose Registers
Unit Data Registers
(n is 1, 8, 9, 275, 1010, 1013,
1023)
http://www.motorola.com/computer/literature2-11
Using the Debugger
2
IPInstruction Pointer, copied to SPR26
MSRMachine State Register, copied to SPR27
CRCondition Register
FPSCRFloating 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
Byte12
Half-Word1234
Word12345678
Floating Point Data Types
Single Precision Real1_FF_7FFFFF
Double Precision Real1_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-12Computer 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:
A double precision number takes 8 bytes in memory.
NoteThe single and double precision formats ha ve an im plied intege r
bit (always 1 ).
http://www.motorola.com/computer/literature2-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-14Computer 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
CommandDescription
ASOne Line Assembler
BCBlock of Memory Compare
BFBlock of Memory Fill
BIBlock of Memory Initialize
BMBlock of Memory Move
BRBreakpoint Insert
NOBRBreakpoint Delete
BSBlock of Memory Search
BVBlock of Memory Verify
CACHEModify Cache State
CMConcurrent Mode
NOCMNo Concurrent Mode
CNFGConfigure Board Information Block
CSChecksum
CSARPCI Configuration Space READ Access (NOTE 2)
CSAWPCI Configuration Space WRITE Access (NOTE 2)
DCData Conversion
DMAMove Block of Memory
DSO ne Line Disassembler
DUDump S-Records
ECHOEcho String
ENVSet Environment
3
3-1
Debugger Commands
Table 3-1. Debugger Commands (Continued)
CommandDescription
FORKFork Idle MPU at Address (NOTE 2)
3
FORKWRFork Idle MPU with Registers (NOTE 2)
GDGo Direct (Ignore Breakpoints)
GEVBOOTGlobal Environment Variable Boot (NOTE 1)
GEVDELGloba l Environment Variable Delete (N OTE 1)
GEVDUMPGlobal Environment Variable(s) Dump (NOTE 1)
GEVEDITGlobal Environment Variable Edit (NOTE 1)
GEVINITGlobal Environment Variable Initialization (NOTE 1)
GEVSHOWGlobal Environment Variable(s ) Display (NOTE 1)
GNGo to Next Instruction
G, GOGo Execute User Program
GTGo to Temporary Breakpoint
HEHelp
IBMIndirect Block Move
IDLEIdle Master MPU (NOTE 2)
IOCI/O Control for Disk
IOII/O Inquiry
IOPI/O Physical (Direct Disk Access)
IOTI/O Teach for Configuring Disk Controller
IRDIdle MPU Register Display (NOTE 2)
IRMIdle MPU Register Modify (NOTE 2)
IRSIdle MPU Register Set (NOTE 2)
LOLoad S-Records from Host
MAMacro Define/Display
NOMAMacro Delete
MAEMacro Edit
MALEnable Macro Listing
NOMALDisable Macro Listing
MARLoad Macros
MAWSave Macros
MD, MDSMemory Display
MENUSystem Menu
M, MMMemory Modify
MMDMemory Map Diagnostic
MMGRMemory Manager
MSMemory Set
MWMemory Write
NABAutomatic Network Boot
NAPNap MPU (NOTE 2)
NBHNetwork Boot Operating System, Halt
NBONetwork Boot Operating System
3-2Computer Group Literature Center Web Site
Table 3-1. Debugger Commands (Continued)
CommandDescription
NIOCNetwork I/O Co nt rol
NIOPNetwor k I / O Ph y sical
NIOTNetwork I/O Teach (Configuration)
NPINGNetwork Ping
OFOffset Registers Display/Modify
PAPrinter Attach
NOPAPrinter Detach
PBOOTBootstrap Operating System
PFPort Format
NOPFPort Detach
PFLASHProgram FLASH Memory
PSPut RTC into Power Save Mode
RBROMboot Enable
NORBROMboot Disable
RDRegister Display
REMOTERemote
RESETCold/Warm Reset
RLRead Loop
RMRegister Modify
RSRegister Set
RUNMPU Execution/Status (NOTE 2)
SDSwitch Directories
SETSet Time and Date
SROMSROM Examin e/M odify (NOTE 2)
SYMSymbol T a bl e Attach
NOSYMSymbol Table D etach
SYMSSymbol Tabl e D is play / Se a rc h
TTrace
TATerminal Attach
TIMEDisplay Time and Date
TMTransparent Mode
TTTrace to Temporary Breakpoint
VEVerify S-Records Against Memory
VERRevision/Version Display
WLWrite Loop
Debugger Commands
3
http://www.motorola.com/computer/literature3-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-4Computer 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 (MMADDR ;DI). Refer to M, MM - Memory Modifyon
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/literature3-5
Debugger Commands
BC - Block of Memory Compare
Command Input
3
BC RANGE ADDR [;B|H|W]
Options
BByte
HHalf-word
WWord
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.
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).
incrementValue 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
BByte
HHalf-word
WWord
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-8Computer 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.
The BI initializes pa rity for a block of memory. The BI command is nondestructive; 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.
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 2121THIS IS A TEST!!
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.
TEXTAn ASCII text string that is matched against a range of memory
dataData p a ttern that is matched against a range of memory
maskA 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
BByte
HHalf-word
WWord
NNon-aligned. The search is conducted on a byte-by-byte basis,
rather than by half-words or words, regardless of the size of data.
VVerify. 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-18Computer 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/literature3-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.
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.
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).
incrementValue 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
BByte
HHalf-word
WWord
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, halfword, 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/literature3-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).