1 Introduction
PMON provides a fundamental set of commands for debugging software applications that run on MIPS architecture microprocessors.
PMON is provided in EEPROM on the Loongson-based platform. Use of PMON involves three basic steps:
1. Users first develop code on their own workstations or PCs, and cross-compile the code on these host machines.
2. Users then download their code to the target board using either an RS-232C or Ethernet link, first time maybe using JTAG.
3. PMON's debugging facilities permit users to:
- start and stop program execution at any point via hardware and software breakpoints and single-step execution support.
- read any register contents and set any register to a new value.
- read data and disassemble code from main memory.
- copy memory contents from one area to another, fill areas of memory with a particular byte or string, or search memory for a particular byte or string.
PMON provides a flexible environment for users to perform debugging. Command history, command-line editing, and downloadable symbols are only a few of PMON's features. A script feature lets users execute a specified sequence of EEPROM Monitor commands after reaching a breakpoint, or on reset. If the user enters an illegal command, on-line help provides syntactic information.
1.1 EPPROM Monitor Commands
The commands can be grouped into the following categories:
• Debugger
c (continue execution), t (trace by single step), to (trace by step over), db (delete break point(s)), b (set break point(s)), g/go (start exection), sym (define symbol), ls (list symbols), r (display/set register), l (list memory in disammeble form), bt (stack backtrace)
Note: Dexxon platform only supports g,sym and ls commands.
• GUI
gui (start gui process)
Note: Dexxon platform does not support this command.
• Boot and Load
boot (network loader), load (load file) Note: Dexxon platform only supports load command.
• MyCmds
This command category is definded by developer for specific platform, so every platform has its own MyCmds.
On LM8089 platform, the MyCmds are as follows:
Pnpr (pnpr LDN index), pnpw (pnpw LDN index value), pcs (select pci dev function), d1 (dump address byte), d2 (dump address half word), d4 (dump address word), d8 (dump address double word), m1 (modify address byte), m2 (modify address half word), m4 (modify address word), m8 (modify address double word), setvga (set vga_available), writefb (write framebuffer), setkbd (set kbd_available), initkbd (kbd_initialize), tlbset (tlbset viraddr phyaddr [-x]), cache (cache[0 1]), erase (cache [0 1]), program (cache [0 1])
On Dexxon platform, the MyCmds are as follows:
dumpsis (dump sis registers), rdiic (read dexxon board i2c slave registers), wriic (write dexxon board i2c slave registers), flashiic (flash dexxon board with sector1 data), dataiic (flash dexxon board with sector1 data), startiic (flash dexxon board with sector1 data start), rdadt (read adt registers)
• Shell
more (paginator), h (on-line help), sh (command shell), vers (print version info), eval (evaluate and print result), hi (desplay command history), date (get/set date and time), about (about PMON2000)
• Network
ifaddr (configure network interface), ping (ping remote host)
• Grub like command
initrd (load initrd/initramfs image)
• Memory
m (modify memory), d (display memory), compare (compare memory to memory), copy (copy memory to memory), fill (fill memory), search (search memory), mt (simple memory test)
• Pci
pcicfg (pci config space), pciscan (scan pci bus)
• Environment
env (display variable), set (display/set variable), unset (unset variable(s)), eset (edit variable)
• memt
nmt (memory test), wm (write memory)
• USB commands
usb (general usb commands)
• Realtek 8139
ifm (set 8139 interface mode), setmac (set mac address into 8139 eeprom), reprom (dump rtl8139 eprom content)
1.2 Features
PMON offers:
• No redistribution or royalty fees;
• Complete source code for PMON available on request;
• Drivers for standard UARTs;
• Register display and set with named fields;
• Memory display and set in hexadecimal notation;
• Memory disassembly;
• Memory copy, fill, and search;
• Exclusive high-speed download format (the FastLoad For mat);
• Download of ELF or ECOFF binary (object) files over Ether net via TFTP;
• C Shell-style command history support;
• Emacs-style command line editing;
• Downloadable symbol tables to support symbolic addresses;
• On-line help;
• 32 software breakpoints;
• Hardware breakpoint;
• User-defined command list execution on breakpoint;
• Single-step execution;
• Source-level debugging using MIPS-targeted versions of gdb;
• Local, remote, and transparent connection modes to a host;
• Entry points for user I/O service requests;
• Initialisation via NVRAM;
2 Getting To Start
2.1 PMON Sartup Process
After power on, pressed the start button on the Main Board and the cpu began to work. Under normal circumstances(when the al env-viriable is not set or not configed correctlly),PMON will finallly enter to the PMON console while a prompt(PMON>) appeared in screen, as shown in Figure 2.1.Then,you can debug or load the kernel file and launch the kernel.If the al is configed corretlly, the PMON startup process would auto load the kernel file which al specifys and launch the kernel.
Figure 2.1 PMON console(the console may be different because of different version)
2.2 Introduction to the Common-Used PMON Commands
PMON has many commands to do the kinds of functions needed by user or platform, such as loading files, launching kernel,module testing,debuging the new interface on the board or something else.If the output of the command is more than one page on screen,users can press SPACE key to turn page. if more than one line ,press ENTER key to turn line. Commands which are used commonly by users are as follow:
2.2.1. h command:
lists all PMON commands and their usage,for example:
PMON>h ⇓
Youcan type h command after the PMON promt to see the usage of the specific command,for example:
PMON>h load ⇓
2.2.2 load command
Load files(which contain program or data) into memory(including flash rom) from net,hard disk,u disk,etc, also it can be used to update PMON EEPROM on line.It supports fat and ext2 file format.Examples:
PMON>load /dev/fs/ext2@wd0/boot/vmlinux ⇓
load linux kernel file vmlinux from the /boot/ of hard disk(which name wd0) to memory, the file format is ext2.
PMON>load /dev/fs/ext2@usb0/boot/vmlinux ⇓
load linux kernel file vmlinux from the /boot/ of u disk(which name usb0) to memory, the file format is ext2.
PMON>load /dev/fat/disk@wd0/boot/vmlinux ⇓
load linux kernel file vmlinux from the /boot/ of hard disk(which name wd0) to memory, the file format is fat.
PMON>load /dev/fat/disk@usb0/boot/vmlinux ⇓
load linux kernel file vmlinux from the /boot/ of u disk(which name usb0) to memory, the file format is fat.
PMON>load -r -f bfc00000 tftp:%%//%%172.16.0.30/gzrom.bin ⇓
Update the PMON EERPOM on-online by the file gzrom.bin from the host whose IP is 172.16.0.30 and the tftp service on it opens.
PMON>load tftp:%%//%%172.16.0.30/gzram PMON>g
Download the gzram file(from host 172.16.0.30) into memory and run it, this example show how to do the new PMON debug without downloading it into EEPROM.
2.2.3 reboot command
This command is used to reboot the system, example:
PMON>reboot ⇓
2.2.4 date command
This command usd to display or set date and time, examples:
PMON>date ⇓
Wed Feb 4 18:00:18 2009
PMON>date 200902051810.11 ⇓
set the date of Thu Feb 5 18:10:11 2009.
2.2.5 ifaddr command
This command used to set the IP address,examples:
PMON>ifaddr rtl0 172.16.1.204
Set the ip 172.16.1.204, and the net card on board is RTL8139.
PMON>ifaddr rtk0 172.16.1.204
Set the ip 172.16.1.204, and the net card on board is RTL8169.
2.2.6 ping command
Bounce ethernet packets back and forth between the board and another host to make sure whether data can be exchanged between two hosts by network.
PMON>ping 172.16.0.30 ⇓
To make sure wheter data can be exchanged between this board and the host 172.16.0.30.
2.2.7 set command
This command is used to display or set the env-viriable(s),examples:
PMON>set ⇓
Display all the env-viriables .
PMON> set al /dev/fs/ext2@wd0/boot/vmlinux ⇓
set al env-viriable as /dev/fs/ext2@wd0/boot/vmlinux
PMON>set ifconfig rtl0:172.16.1.204 ⇓
set ifconifg as rtl0:172.16.1.204 which is used to autoset IP after PMON startup.
2.2.8 unset command
Delete the env-viriable which configed by set command,example:
PMON>unset al ⇓
2.2.9 ifm command
This command is used to set the mode of network, examples:
PMON>ifm ⇓ Display the network mode PMON>ifm auto ⇓ auto select the network mode PMON>ifm 10 ⇓ select 10Mbps mode PMON>ifm 100 ⇓ select 100Mbps mode
2.2.10 setmac command
This command is used to display or set the MAC(Media Access Control) address, it takes effect after reboot, example:
PMON>setmac ⇓ Display the current MAC PMON>setmac 00:d0:35:10:00:1c ⇓
set the MAC to 00:d0:35:10:00:1c
2.2.11 devls command
This command is used to list the devices which are avaible on the board,example:
PMON> devls -a ⇓ show all device types PMON> devls -n ⇓ show network types
2.3 The Environment Variables
PMON uses Environment Variables to do the system config, such as ways of startup(auto startup or not auto startup )、auto config or not auto config of the TFP server's IP. The common-used environment variables are as follows:
al config the start kernel, i.e. specifys which kernel to be launched. For example: /dev/fs/ext2@wd0/boot/vmlinux, It means that PMON will auto launch the kernel (names vmlinux) whose path is /boot/vmlinux of the wd0(first partion of the hard disk wd,and its file format is ext2). And if the file format of the partion is fat(fat16 or fat32),the al may config like: /dev/fat/disk@wd0/boot/vmlinux .
Also if you put the vmlinux in the second partion of the hard disk wd, and the file format of the partion is ext2, then al may like : /dev/fs/ext2@wd0b/boot/vmlinux, if in the third partion, then wd0b should be changed to wd0c, and all that.
karg config the parameters which will be passed to the kernel when launching the kernel, such as “console=tty root=/dev/hda1”.
novga if this environment variables is set(no matter what value it is),then the debug log will be printed to the UART, if not set, then the debug log will be printed to screen.
ifconfig this environment variable is used to auto config the TFTP server's IP, for example: rtl0:172.16.1.205
nouart this environment variable is used to disable the UART, if it is set, and its value is “yes”, then the UART will be disable, otherwise the UART will be enabled.
2.4 Update PMON
PMON code is stored in the EEPROM chip on the board, there are two ways to update PMON:
(1) Update the EEPROM by burnning-device.Users should chose the right type of chip when do the burnning.
(2) Update the EEPROM by software, using load command to do this, for example:
load -r -f bfc00000 tftp:%%//%%xx.xx.xx.xx/gzrom.bin
This shows to update the EEPROM on board by downloading the files gzrom.bin from network, also it can be downloaded from hard disk. \
3 Connecting to Ethernet
This section contains infor mation on setting up your board on an Ethernet so that you can download programs from a host machine to the target board using a high-speed Ethernet link.
3.1 Configuring the Board
PMON uses several environment variables to control its access to Ethernet. Some of these must be set to fit in with your local networ k, and you may need to ask your network manager. See the set and eset commands, for details of how to set and change environment variables. After you change any network related variables you must then reset the board before they will have any effect.
3.1.1 Minimum setup
The essential variables that will have to be set before you can perform any network communication are:
* ethaddr defines the board's Ether net address, uniquely assigned to the board when it was made. This variable is configured at the factory and will only need to be reset if the NVRAM contents have got lost. The ethernet numbers always takes the form “xx:xx:xx:xx:xx:xx”, and they are allocatd based on the board model and serial number.
Note: Users can also use setmac command under the PMON console to set ethernet address. For example: setmac 00:d0:35:10:00:1c
* ifconfig holds the board's Inter net address. This address will be allocated to you by your network manager. It should be in the standard dot-notation for m, e.g. ''a.b.c.d'', where ''a'', ''b'', etc. are decimal numbers between 1 and 254, inclusive.
Most networks will use class C addressing, which means that the first three fields of the Internet address identify the network, and leaves only the last field for allocation to individual host IDs (i.e. a maximum of 254 hosts IDs). By default PMON works out what class of network addressing to use based on the value of ifconfig, but occasionally you will come across a network setup which breaks the standard numbering rules, and you will need to force PMON to allow two or three fields for the host IDs. In this case you also have to set the netmask and broadcast variables. If these are required, then they should be specified in the standard dot-notation, as used for ifconfig above .
The following shows how to config the variables mentioned above (though the setting of netmask and broadcast is redundant):
PMON> set ethaddr 00:d0:35:10:00:1c PMON> set ifconfig rtl0:172.16.1.205 PMON> set netmask 255.255.0.0 PMON> set broadcast 172.16.1.255
Note: rtl0 indicates that the network card is Realtek8139.
3.1.2 Selecting the Default Gateway
In a large organisation, your target board and your host development system may be on different subnets. In such cases there should an internet gateway which forwards packets between the subnets. To allow communication with other subnets, set the gateway variable to the internet name or address of the relevant gateway on the board's local subnet. PMON does not keep proper routing tables, but at least it will now send to that gateway any packets whose internet address does not match its own subnet.
3.2.3 Testing the Connection
At each stage of configuring the connection use the ping command, to test your current setup. Attempt to ping machines on your local subnet (using their numeric address); ping the name server; ping the gateway, and finally the remote machine(s) from which you intend to load your software.
3.2. Configuring the TFTP Server
PMON downloads and uploads by acting as a client in the TFTP (Trivial File Transfer Protocol); see the boot, load and dump for details. TFTP requires only the simple, connection-less UDP ''transport'' protocol. You need to make sure that there is a TFTP server up and running on your chosen host system. Note that most systems already have some other mechanism (such as NFS) for sharing files; so the host system from which you download may not actually be the host where the files physically reside. You don't have to worr y about that.
3.2.1 UNIX Workstation
Setting up the TFTP server on a Unix workstation is a job for the local system manager. The use of TFTP does not require an account or password on the remote system. Due to the lack of authentication infor mation, the server will allow only publicly readable files to be accessed. Files may be written only if they already exist and are publicly writable. Note that this extends the concept of ''public'' to include all users on all hosts that can be reached through the network; this may not be appropriate on all systems, and its implications should be considered before enabling TFTP service. The server should have the user ID with the lowest possible privilege. The TFTP server, tftpd, is normally started by the inetd program. In many implementations, access to files may be restricted by invoking tftpd with a list of directories by including pathnames as server program arguments in /etc/inetd.conf. In this case access is restricted to files whose names are prefixed by the one of the given directories. Because tftpd can be a security problem, systems are often shipped with it disabled by default. You'll often find the appropriate line commented out in /etc/inetd.conf. Rely on your Unix Network Guide for full details of tftpd and inetd.conf.
3.2.2 DOS/Windows PC
DOS and Windows PCs provide a number of TCP/IP networking solutions. There are a number of commercial products: SunSoft's PC-NFS, FTP Software's PC/TCP, and many others. Alternatively there are ''shareware'' products such as Peter Tattam's TCP/IP for DOS and Windows (the author's email address is peter@psychnet.psychol.utas.edu.au).
The essential requirement for use with PMON is, of course, that the product includes a TFTP server. In most cases (under DOS, if not Windows) the TFTP server will not run as background task. You'll probably have to start it manually every time that you want to download or upload over the network. For example, using PC/TCP (and assuming the PC's Internet address is 172.16.1.201) would require a sequence of commands something like this:
DOS C:\SDE\EXAMPLES\EX4> make ex4ram %%//%%Build example program DOS C:\SDE\EXAMPLES\EX4> tftp serve %%//%%Start the TFTP server PMON> load tftp:%%//%%172.16.1.201/ex4ram %%//%%Load the program onto the board PMON> g %%//%%Start the program q (on the PC) %%//%%Terminate the TFTP server
3.3. Downloading Files via Ethernet
In summary, to download and run a program via Ethernet, perform the following steps (here shows how to download and run a linux kernel):
1. Setup your board and your host's TFTP server, as described earlier in this chapter.
2. Use the load command to load your program.
PMON> load tftp:%%//%%172.16.1.201/vmlinux
3. Run the downloaded program.
PMON> g $karg
4 Monitor Command Summary
This section summarizes all the commands supported by the PROM Monitor. Table 4.1 summarizes all EEPROM Monitor commands available on the loongson-based platform. Table 4.1 uses the following conventions:
• The caret symbol (''ˆ'' ) indicates that the control key should be held while pressing the other keys in the command. For example, ''ˆP'' means hold the control key down and press the ''P'' key.
• Optional arguments are enclosed in square brackets. The square brackets are not part of the command.
• Arguments take spaces as delimiters.
For more infor mation, see the Alphabetic Command Listing in Section 5.
Table 4.1: EEPROM Monitor Command Summary
| Command | Funcions and Options | Description and Comments |
| b[-rw][adr][-sstr]… | Set breakpoint(s) [-r] [-w] [-s str] [adr] | List breakpoints if specified with no options.Up to 32 software breakpoints and a hardware break point are supported. Hardware breakpoint for data read only. Hardware breakpoint for data write only. Executes the command string when the breakpoint is reached. Address for breakpoint. |
| boot [-bensy] [host:]file] | Network bootstrap [-b] [-e] [-n] [-s] [-y] [[host:]file] | Load an executable object file over Ethernet using TFTP Suppressbreakpoint deletion. Do not clear exception handlers. Do not load symbols. Do not clear symbol table. Only load the symbol table. The internet hostname and filename. |
| bt [-v] [cnt] | Stack backtrace [-v]. [cnt] | Displays a function call stack backtrace. Include stack frame address and size. Number of lines to display. |
| c [bptadr] | Continue execution [bptadr] | Continues from current address after updating shadow registers. A single temporar y breakpoint. |
| call adr [val|-s str]…\\ | Call a function adr [val] [-s str] | Continues like the c command but does not update shadow registers. Function starting address. Value to pass to function. String to pass to function. |
| copy from to siz\\ | Copy memory from to siz\\ | Copies from base up when copying to lower address and vice versa. Start address for source. Start address for destination. Number of bytes to copy.\\ |
| d [-b|h|w|s] adr [cnt|-rreg]\\ | Display [-b] [-h] [-w] [-d] [-s]. adr [cnt] [-rreg] | Display datasz sets default word size. moresz sets default screen length. Display bytes. Display16-bit words. Display32-bit words. Display64-bit words. Display as a null terminated string. Base address for display. [Number of lines to display. Display as register reg |
| date | Display date and time [yymmddhhmm.ss]\\ | Set new date and time. |
| db [numb|*] … | Delete breakpoint(s) [numb]. [*] | Lists all breakpoints if no option specified. Breakpoint number(s) to delete. Delete all breakpoints. |
| debug [-svV] [– args] | Enter remote debug mode [-s] [-v] [-V] [– args] | Displays in terse mode by default. Do not set client stack pointer. Report protocol errors. Set verbose mode. Pass remaining args to client. |
| eset name | Edit variable name | Displays the named var iable and allows it to be edited (see sh command for editing details). Select variable named name. |
| fill from to {val|-s str}…\\ | Fill memory from to. [val] [-s str] \\ | Fills memory block with numer ic or string value. Note that from must be lower than to. Fill from base address from. Fill to end address to. Fill with hexadecimal byte val. Fill with ASCII string str. Enclose multiple words in double quotes. |
| flush [-di]\\ | Flush caches [-d] [-i] | Flush caches Flushes both caches by default. Flush data cache only. Flushinstr uction cache only. |
| g [-s] [-b bptadr] [-e adr] [– args]\\ | Go (start execution) [-e adr] [-b bptadr] [-s] [– args] | Star ts at EPC address and sets stack pointer to beginning of stack by default. Star t at address adr. Set temporar y breakpoint at address bptadr. Do not set client stack pointer. Pass remaining args arguments to client. |
| h [*|cmd…]\\ | Help [*] [cmd] | Lists all available commands by default. List all help. Help on command cmd. |
| hi [cnt]\\ | Histor y display. [cnt] | Display last 200 commands. Display last cnt commands. |
| l [-bct] [adr [cnt]]\\ | List (disassemble) [-b] [-c] [-t] adr cnt | Disassembles from EPC address and pipes output to more command by default. Listonly branches. Listonly calls. Listtrace buffer. Start disassembly from address adr. Disassemble cnt lines. |
| load [-s][-b]… path | Load memory from host [-s] [-b] [-e] [-a] [-t] [-i] [-f flash_addr] [-o load_addr] [-n] [-y] [-v] [-w] [-k] [-r] [-d] path | Load files into memory(including flash rom) from net,hard disk,u disk,etc Don't clear old symbols. Don't clear breakpoints. Don't clear exception handlers. Don't add offset to symbols. Load at top of memory. Ignore checksum errors. Load file into flash rom begin at flash_addr. Load file into ram begin at load_addr. Don't load symbols. Only load symbols. Verbose message. Reverse endianness. Prepare for kernel symbols. Load raw file. Load st7foxf1(EC bin). path and filename |
| ls [-ln] [sym|-[va] adr]\\ | List symbols [-l] [-n] [-a] | Lists all symbols in descending address order without showing addresses by default. Show long listing with addresses or offsets. Listin numer ic order. Show next low est address in symbolic form. |
| m [-bhwdnx] adr [val|-s str].. | Modify memory [-b] [-h] [-w] [-x] [-d] [-n] <hexval> CR = ^|- . | Modify memory at specific address. Access bytes Access halt-words Access words Swap bytes Access double-words Non-interactive (no write) Set memory, forward one In interactive mode, move forward one byte with no other change. In interactive mode, read current address again. In interactive mode, move back one byte. Exit interactive mode. |
| more | Paginate to screen /str n <SPACE> <CR> ˆs|ˆq q|ˆc | (Embedded command) scroll MORESZ lines. Setting MORESZ to zero disables automatic scroll pauses. Search for string str. Repeat last search. Show next page. Show next line. Pause scrolling. Quit. |
| nmt <base> <size> <loop>\\ | Memory test <base> <size> <loop> | Simple memory test. Start address.(In hex form) Memory size.(In hex form) Times to test. |
| ping [-qfrv] [-c cnt] [-s size] host\\ | Test net connection [-q] [-f] [-r] [-v] [-c cnt] [-s size] host | Bounce ethernet packets back and forth between the board and another host. Quiet - nothing is displayed except summary. Set Don't Fragment flag in packet. Record route for count hops. Verbose − display all ICMP messages, not just echo replies Number of echo requests to send. [-s size] Use packets of size bytes (default=56). Internet host address to send packets to. |
| r [reg|* [val|field val] ]\\ | Display or set register * f* reg val reg field val \\ | Lists general-pur pose registers by default. Display all except floating-point registers. Display all floating-point registers. Set specified register reg to value val. Set specified field field in register reg to value val.\\ |
| reboot\\ | simulate reset\\ | Jump to the MIPS start location 0xBFC0.0000, which is likely to restart PMON. But it won't do a complete hardware reset. |
| search from to {val|-s str}…\\ | Search memory from to. val -s str | To search for a multiple-word string, enclose the string in double quotation marks. Start search from address from. Stop search at address to. Search for value val. Search for string str.\\ |
| set [name [value]]\\ | Display orset variable [name] [value]\\ | Lists all current variables by default. Entering a variable by itself displays the variable value. Select variable named name. Set variable to value value.\\ |
| sh | Command shell ˆC ˆS ˆQ ˆP ˆN ˆF ˆB ˆA ˆE ˆD ˆH ˆK ; !! !str !num +-/() ˆaddr @name &name $name 0xnum 0onum 0tnum | (Embedded command) process command prompt using ASCII character input and special characters listed below. INBASE sets the default numer ic base for the shell. Setting INALPHA to ''hex'' makes the Monitor process the input as a hexadecimal number if possible. The PROMPT variable defines the command prompt string, with the metacharacter ''!'' replaced by the current history number. When RPTCMD is set to ''on'', the previous command is repeated when the user enters a blank line. When RPTCMD is set to ''trace'', only trace commands are repeated. Abort execution of current command. Pause output stream. Restart output stream after pause. Recall previous command. Recallnext command. Move cursor right. Move cursor left. Move cursor far left. Move cursor far right. Delete character at cursor. Delete character before cursor. Delete whole line to right of cursor Treat input after semicolon as a new command. Repeatlast command. Recall and execute the last command that commenced withstr ing str. Recall and execute command num. Execute algebraic operator. Substitute contents of address for address addr. Substitute contents of register for named register. Substitute value of symbol for symbol name. Substitute value of environment var iable name. Treat num as hexadecimal number. Treat num as octal number. Treat num as decimal number. |
| stty [dev][opts] | Set terminal options [dev] [-a] <baud]> sane <mode> -<mode> | Displays the terminal type and baud rate by default. Use either “tty0” or “tty1” (tty0 is default). Listall settings. Set baud rate. Set ane settings. Set mode. clear mode. |
| sym name value\\ | Define symbol. name value | Defines symbol value. Note that you can display symbols with the ls command. Change value for symbol name. Change symbol to value value.\\ |
| t [-vbci] [-m adr val] [-M adr val] [-r reg val] [-R reg val] [cnt]\\ | Trace (single step) [-v] [-b] [-c]. [-i] [-m adr val] [-M adr val] [-r reg val] [-R reg val] [cnt] | Execute command addressed by EPC by default. List each step (verbose). Captureonly branches. Capture only calls (jal instructions). Stop on invalid program counter. Stop when memory at address adr is equal to value val. Stop when memory address adr is not equal to value val. Stop when register reg is equal to value val. Stop when register reg is not equal to value val. Trace cnt instr uctions. |
| to [-vbci] [-m adr val] [-M adr val] [-r reg val][-R reg val] [cnt] | Trace (step over)\\ | Identical to the t command, except individual procedures are treated as a single step.\\ |
| tr\\ | Transparent mode | Copies keyboard characters to hostport, and copies characters from hostport to screen. Variable trabort setsthe termination character. |
| unset name … | Delete variable(s) name | Makes all matching var iables disappear. Variable name to delete. Wildcards * and ? supported. |
5 Alphabetic Command Listing
This section contains an alphabetic listing of the commands supported by PMON. Each command description starts at the top of a new page. The name of the described command is in bold type in the top left hand corner of the first page. Each command description contains the following three sections:
• Command Summary − A single-sentence summary of the command function accompanies each description at the top of the first page, next to the command name.
• Format − A format description follows the single-sentence summary, with a brief description of each parameter and argument supported by the command. At the end of the format description, default values for optional var iables are described where applicable.
• Functional Description − A complete description of the command function follows the format, with examples where appropriate. Related commands are listed at the end of the functional description where applicable.
Some command descriptions contain a final section that describes a var iable specific to the command.
…………………………………………………………………………………………..
b The b command sets and displays breakpoints.
…………………………………………………………………………………………..
Format The for mat for this command is:
b [-r|w] adr…
b adr -s str
b [adr…]
where:
-r set a hardware breakpoint which will trigger on reads.
-w set a hardware breakpoint which will trigger on writes.
-s str executes the command string when the breakpoint is hit.
adr specifies an address for the breakpoint. Up to 32 software
breakpoints addresses can be set, and one hardware breakpoint
Invoking the b command with no options causes the Monitor to print a list of
the current breakpoints. If neither the -r nor -w option is specified, then a software breakpoint is set.
…………………………………………………………………………………………..
The b command sets a hardware or software breakpoint at the specified
address or addresses. Multiple addresses may be specified. Specified
addresses must be word-aligned. For software breakpoints, the specified addresses must be in RAM.
The Monitor automatically assigns a number to each breakpoint. The Monitor allocates the lowest available breakpoint number from 0 to 31 to any new breakpoint.
The Monitor reports a new breakpoint's number immediately after the breakpoint is declared (see the examples at the end of this subsection for illustration of this). The assigned numbers can be used in the db (Delete Breakpoint) command.
If neither the -r nor the -w options are specified, software breakpoints are set by default. The Monitor implements software breakpoints by replacing the instruction at the specified address with a break instr uction. Execution is then halted when the break instruction is executed.
…………………………………………………………………………………………..
When a breakpoint is reached, the command list specified in the environment variable brkcmd is executed. The default setting for brkcmd is ''l @epc 1''
The first two words, ''l @epc'', specify that a breakpoint will occur at the
address in the EPC register. The final ''1'' specifies that the Monitor will list one line when the breakpoint is reached. See the l command for details.
You can change the breakpoint command variable with the set command. For example, you can include additional monitor commands in the brkcmd variable. You should separate additional commands on the command line with a semicolon. For example, enter ing the following command lists one line after reaching a breakpoint, and then displays all the register values.
PMON> set brkcmd “l @epc 1;r *”
By default, breakpoints are cleared when the load or boot commands are executed.
Some examples illustrating the use of the b command follow.
PMON> b a002000c Set a software breakpoint at 0xA002000C.
Bpt 0 = a002000c
PMON> b Display all breakpoints.
Bpt 0 = a002000c
PMON> b -r a0020020 Set a hardware breakpoint on data read.
Bpt 32 = a0020020
PMON> b Display all breakpoints.
Bpt 0 = a002000c
Bpt 32 = a0020020
See also the db, set, load and boot commands for more information on breakpoints.
…………………………………………………………………………………………..
boot The boot command loads binary object files over Ethernet.
…………………………………………………………………………………………..
Format The format for this command is:
boot [-bensy] [host:[path]]
where:
-b suppresses deletion of all breakpoints before the download.
-e suppresses clearing of the exception handlers.
-n suppresses the loading of symbols from the file.
-s suppresses clearing of the symbol table before the download.
-y loads only the symbols from the file.
host is the internet host from which to read the file.
path is the file name to be loaded from the host.
Invoking the boot command with no parameters or arguments clears the symbol table, deletes all current breakpoints, and attempts to load the program found in the host and file specified by the bootaddr and bootfile environment variables.
…………………………………………………………………………………………..
The boot command uses the TFTP (Trivial File Transfer Protocol) to load an executable binary file from a remote host over Ethernet. It can read files in ELF format , and also the older MIPS ECOFF format. PMON extracts any symbol table information from these files, and adds it to the target symbol table.
The boot command normally clears the symbol table, exception handlers, and all breakpoints. The -s and -b options suppress the clearing of the symbol table and breakpoints, respectively. The value of the EPC register is set automatically to the entry point of the program. Therefore, to execute the downloaded program, only the g command is required.
The boot command may return a large number of different error messages, relating to network problems or file access permissions on the remote host. For a file to be loaded via TFTP it must be publicly readable, and it may have to be in a directory which is acceptable to the remote server. See page 8 for more information about setting up and using TFTP.
When reading the symbol table PMON may complain that it does not have enough room to store the program's symbols. To increase the size of the heap, use the set heaptop command to reserve more space and, if necessary, relink your program with a higher base address. The boot command will also detect cases where the program being loaded would overwrite PMON's crucial data or heap: again relinking your program at a different address will cure the problem.
Whilst it is loading each section of the file, boot displays the memory
address (in hex) and size (in decimal) of that section. Typically these sections will be in the order .text, .data and .bss.
…………………………………………………………………………………………..
bt The bt command displays a function call backtrace.
…………………………………………………………………………………………..
Format The for mat for this command is:
bt [-v] [cnt]
where:
-v specifies that each function's stackframe base address and size
should be displayed.
cnt specifies the number of lines to be displayed.
When invoking this command with no options, the backtrace displays the
names and up to four arguments for each level of stackframe.
…………………………………………………………………………………………..
The bt command displays a list of function calls, starting with the function in which the EPC register currently lies, and finishing when a return address becomes ''invalid''. An address is deemed invalid if it does not lie within one of the ranges specified by the validpc environment variable.
Each line of output gives the current position in a function, and up to four of its arguments. The arguments can only be retrieved if they are saved within the function prologue, and this is unlikely to be the case for assembler functions and optimised C code. If you want to be able to see the arguments to C functions, then compile your program with optimisation disabled.
If the -v option is given, then the command additionally displays the stackframe base address and size for each function. It will also indicate the amount of dynamic stack space allocated using C's alloca function, or equivalent.
The output of this command is passed to the more command, letting the user view one screenful of output at a time. Optionally, the user can specify cnt, which limits the number of lines to that number. An example illustrating the use of the bt command follows.
PMON> c write+10
write+0×0010 3c09a07f lui t1,0xa07f
PMON> bt
write+0×0010 (0×00000001,0xa0030300,0x0000001c)
flsbuf+0×0234 (0xa0030300,0xa0029030)
printf+0x045c (0xa0025490,0xa0020000,0×000000001,0×00000010)
main+0×0138 (0×00000001,0xa07ffffe0)
_start+0×0040 ()
See also the more command .
…………………………………………………………………………………………..
c The c command makes program execution continue after a breakpoint has stopped program execution.
…………………………………………………………………………………………..
Format The format for this command is:
c [bptadr]
where:
bptadr specifies a single breakpoint. The breakpoint is removed when
execution halts at this specified address.
Invoking the c command with no arguments causes the program execution to continue from the address specified in the EPC register.
…………………………………………………………………………………………..
When the user enters the c command, program execution starts at the
address pointed to by the EPC register's current value. Use the g command to start program execution from an address specified on the command line.
As an option, a single temporary breakpoint may be specified. The temporary breakpoint is removed when execution halts. The temporary breakpoint is removed if another breakpoint stops program execution first.
An example of the c command follows.
PMON> c a0020104 Continue execution until 0xA0020104.
…………………………………………………………………………………………..
call The call command executes a function.
…………………………………………………………………………………………..
Format The for mat of the call command is:
call adr [val|-s str]
where:
adr is the starting address of a function.
val is the value to pass to the function.
-s str is the string to pass to the function.
…………………………………………………………………………………………..
The call command executes the function whose address was specified as the first argument. Up to four optional arguments, if specified, are passed to the function in registers a0 to a3.
The call command is similar to the c (continue) command, except the call command does not update the shadow registers with new values after the function is completed.
An example of the call function follows. In this example, the call command executes the function at 0×80020304, passing the single argument 0x8002236C (converted into binary) to the function via register a0.
PMON> call 80020304 8002236c
…………………………………………………………………………………………..
copy The copy command copies a specified number of bytes from one location in memor y to another.
…………………………………………………………………………………………..
Format The for mat of the copy command is:
copy from to siz
where:
from declares the source address location.
to declares the target address location.
siz is the size of the block of memor y to be moved. This quantity is
specified in bytes.
If to is less than from, then copying is perfor med in ascending order starting at from. If from is less than to, then copying is perfor med in descending order starting at from+siz.
…………………………………………………………………………………………..
The copy command replicates a specified number of bytes from one place in memory to another.
When moving a data block down, the source data is copied from the bottom of the block upwards: and when moving a data block up, the source data is copied from the top of the block downwards. By this technique, there is no risk of copying over data in overlapping block move operations; as the data in the overlapping area is copied first.
The following example shows how to copy a block of memor y, 4 Kbytes in size, with a base address of 0×80020000, to another 4-Kbyte area starting at the address 0×80060000.
PMON> copy 80020000 80060000 4000
…………………………………………………………………………………………..
d The d command displays memory contents in hex or ASCII for mat.
…………………………………………………………………………………………..
Format The for mat for this command is:
d [-b|h|w|s] adr [cnt|-rreg]
where:
-b displays the memory contents in groups of 8-bit bytes.
-h displays the memory contents in 16-bit half-word groups.
-w displays the memory contents in 32-bit word groups.
-d displays the memory contents in 64-bit double-word groups.
-s displays the memory contents as a null terminated string.
adr specifies the base address from which data is displayed.
cnt specifies the number of lines to be displayed.
-rreg displays the contents of memory as register reg.
…………………………………………………………………………………………..
The d command displays memory, starting at the specified address, in hexadecimal or ASCII for mat. A -b, -h, -w, or -s option, if specified, sets how the data is displayed. See the examples at the end of this section for illustration of the possible display formats. The output of this command is passed to the more command, letting the user view one screenful of output at a time. Optionally, the user can specify cnt, which limits the number of lines to that number.
…………………………………………………………………………………………..
If invoked without a -b, -h, -w, -d or -s option, the datasz variable sets the
display for mat. Setting datasz to ''-b'', ''-h'', ''-w'' or ''-d'' has the same effect as the command line options of the same names described in this section. The datasz variable does not effect any other command displays.
The following example displays memory star ting at 0×0010000.
PMON> d a0010000
a0010000 bf c0 2b 00 bf c0 2b 00 bf c0 2b 00 bf c0 2b 3c ..+…+…+…+<
a0010010 bf c0 2b 3c bf c0 2b 3c bf c0 2b 20 bf c0 2b 20 ..+<..+<..+…+.
a0010020 bf c0 2b 20 bf c0 2b a8 bf c0 2b 78 bf c0 2b 60 ..+…+…+x..+'
a0010030 bf c0 2b 48 bf c0 2b a8 bf c0 2b a8 bf c0 2b a8 ..+H..+…+…+.
a0010040 bf c0 2b 78 bf c0 2b 60 bf c0 2b 48 bf c0 2e 78 ..+x..+'..+H…x
a0010050 bf c0 2f 08 bf c0 2e c4 bf c0 2e 80 bf c0 2f 90 ../………../.
a0010060 bf c0 2f 90 bf c0 2f 90 bf c0 2e 78 bf c0 2e 78 ../…/….x…x
a0010070 bf c0 2e 78 00 00 00 00 00 00 00 00 00 00 00 00 …x…………
…………………………………………………………………………………………..
date The date command displays or sets the date and time.
…………………………………………………………………………………………..
Format The format of the date command is:
date [yymmddHHMM.SS]
where:
yymmddHHMM.SS
is the new date and time.
…………………………………………………………………………………………..
The date command with no arguments displays the current date and time as stored in the board's batter y-backed clock/calendar device. If an argument is given, then this sets the current date and time.
The optional argument is a string of pairs of digits, with the following meaning:
yy year (modulo 100)
mm month (Januar y = 1)
dd day of month
HH hour (24 hour clock)
MM minute
.SS seconds
When setting the date and time, you only need to enter as much as needs changing, starting with the minutes, then hours, then day, etc. Any value
which is omitted is unchanged, except for seconds, which will be set to zero if omitted.
Some examples of the date command follow.
PMON> date Display current time
Wed Feb 23 13:29:33 1994
PMON> date 32 Change minutes
Wed Feb 23 13:32:00 1994
PMON> date 1405 Change hours and minutes
Wed Feb 23 14:05:00 1994
PMON> date 9402241103 New date and time
Thu Feb 24 11:03:00 1994
…………………………………………………………………………………………..
db The db command deletes the specified breakpoints.
…………………………………………………………………………………………..
Format The for mat for this command is:
db [numb|*]
where:
numb is the breakpoint number to be deleted.
* deletes all breakpoints.
Entering db without any parameters lists all existing breakpoints. Enter ing an aster isk (''*'') instead of a breakpoint number deletes all the existing breakpoints.
…………………………………………………………………………………………..
The db command deletes one or more specified breakpoints.
Examples illustrating the use of the db command follow.
PMON> db 3 Delete breakpoint 3.
PMON> db 4 6 Delete breakpoints 4 and 6.
PMON> db Display all breakpoints.
Bpt 0 = a002000c
PMON> db * Delete all breakpoints.
…………………………………………………………………………………………..
eset The eset command edits environment var iables.
…………………………………………………………………………………………..
Format The for mat for this command is:
eset name…
where:
name is the name of the environment var iable to edit.
…………………………………………………………………………………………..
The eset command is used to edit environment variable values. For each variable name given as an argument the eset command displays the variable name and its value. and then allows you to edit it using the same line-editing facilities available in the sh command. When you press carriage-return, the new value is stored.
When using this command you should not place quotation marks around a multiple-word value; otherwise the quotation marks will be stored with the variable, which is probably not what you want.
See also the set and unset commands respectively.
…………………………………………………………………………………………..
fill The fill command writes a hexadecimal pattern or str ing to a block of
memor y.
…………………………………………………………………………………………..
Format The for mat for this command is:
fill from to {val|-s str}…
where:
from is the base address for the fill operation.
to is the end address for the fill operation.
val is the hexadecimal value of the byte that is written to the area to
be filled.
-s str specifies that the memory block should be filled with an ASCII
string rather than a particular value. Str ing str is the ASCII string
to be written to the memory block dur ing the fill operation if the -s
parameter is specified.
…………………………………………………………………………………………..
The fill command fills an area of memory with a specified hexadecimal
pattern or repeating string. The pattern can be a single byte or multiple bytes.For the fill command to wor k correctly, to must be greater than from. If the -s option is specified, then the next parameter is interpreted as an ASCII str ing. Multiple-word strings may be specified by enclosing them in quotes.
For example, to clear an area of memory from 0xA0020000 to 0xA0021000, enter :
PMON> fill a0020000 a0021000 0
To fill an area of memory from 0xA0020000 to 0xA0021000 with the string of values 0×41, 0×42, 0×43, 0×44, and 0×45, enter:
PMON> fill a0020000 a00210000 41 42 43 44 45
To fill an area of memory from 0xA0020000 to 0xA0021000 with the ASCII string “hello world”, enter :
PMON> fill a0020000 a0021000 -s “hello world”
…………………………………………………………………………………………..
flush The flush command flushes the data and/or instruction cache.
…………………………………………………………………………………………..
Format The for mat for this command is:
flush [-di]
where:
-d flushes the data cache only.
-i flushes the instruction cache only.
Entering flush without any parameters flushes both caches.
…………………………………………………………………………………………..
The flush command flushes the data and/or instruction cache.
…………………………………………………………………………………………..
g The g command starts program execution.
…………………………………………………………………………………………..
Format The for mat for this command is:
g [-s] [-b bptadr] [-e adr] [– args…]
where:
-b bptadr is a breakpoint address where program execution is to be
stopped. This breakpoint is removed the next time that execution halts.
-e adr is the address of the first instruction to be executed.
-s is a flag indicating that the stack pointer, sp, should not be set.
– args indicates that the remaining argument or arguments args are to be passed to the client program. If the first argument does not star t with a ''-'', then the ''–'' separator can be omitted.
By default, the g command starts program execution at the address in the
EPC register, and sets the stack pointer, sp, to the top of the stack area.
…………………………………………………………………………………………..
The g command starts program execution. If the user does not specify the star ting address with -e, then execution starts at the current value of the EPC register, otherwise it starts at adr.
If the -b option is specified, then a temporary breakpoint is set at bptadr. The temporar y breakpoint remains in effect only until the next time that program execution is halted.
If the user specifies args, then the Monitor passes them to the client program by the following method. It places the number of arguments (argc) in register a0. It also places the address of an array of pointers to the command-argument strings (argv) in register a1. The first array entry will point to the string ''g'' (this command). If you use start-up code which preserves registers a0 and a1, then function main will receive argc and argv so that it can read options from the command line,
Examples illustrating the use of the g command follow.
PMON> g $karg Start executing with karg env-variable at the current value of the EPC register.
PMON> g -e a0020000 Star t executing at 0xA002.0000.
PMON> g -b a0020008 Star t executing at EPC
break at 0xA0020008.
PMON> g -e a0020000 -b a0020008 Star t executing at 0xA0020000
and break at 0xA0020008.
…………………………………………………………………………………………..
h The h command provides on-line help.
…………………………………………………………………………………………..
Format The format for this command is:
h [*|cmd…]
where:
* provides detailed help on all the commands.
cmd is a command. The Monitor then provides help on the stated
command.
If the command is executed without any parameters, then the Monitor lists all the available commands.
…………………………………………………………………………………………..
The h command provides on-line help. If issued without arguments, all commands are listed. If issued with one or more command names as an option, it produces more detailed help on those commands.
The * option produces detailed help on all the commands, using the more
command to control output on the screen.
Examples illustrating the use of the h command follow.
PMON> h
Misc
devls list devices flush flush caches
...
Debugger
g start execution (go) sym define symbol
…
Shell
…
PMON> h date
date [yyyymmddhhmm.ss] get/set date and time
…………………………………………………………………………………………..
hi The hi command lists the command history.
…………………………………………………………………………………………..
Format The format for this command is:
hi [cnt]
where:
cnt is the number of commands to list.
Entering the command with no parameters lists the last 200 executed command lines to the screen.
…………………………………………………………………………………………..
The hi command shows the command history, together with the history number for each command, in reverse order (the last command entered is listed first; the first command entered is listed last). The command numbers are reset to zero each time the system is reset.
Entering the hi command with no arguments lists the last 200 commands. This option is useful for determining the history number for a particular command.
The user can page through the output of the hi command, one screen at a time.
The optional cnt parameter selects a set number of lines to be output. The histor y list is intentionally in the reverse order to that used in a C shell, so that the latest entry is displayed first. If a command line is identical to the previous command, it is not added to the command history.
Examples illustrating the use of the hi command follow.
PMON> hi 3 Display the three last commands.
14 hi 3
13 hi
12 l
PMON> hi Display the entire history, using more
13 hi to control the screen output.
12 l
11 to
10 t
9 l
8 g start main
7 hi
6 g
5 ls -a @epc
4 d Pmon+200+0t13*4
more… q
See also the sh command, which maintains a command history.
…………………………………………………………………………………………..
l The l command disassembles instructions from memory.
…………………………………………………………………………………………..
Format The for mat for this command is:
l [-b|c|t] [adr [cnt]]
where:
-b lists only branches.
-c lists only calls.
-t lists the trace buffer.
adr is the base address from which to disassemble instructions.
cnt is the number of lines to disassemble.
When invoking this command with no options, disassembly starts at the
address in the EPC register and is output to the more command.
…………………………………………………………………………………………..
The l command disassembles the memory contents, star ting either at the EPC register's current value or at the specified address. The output of this command is passed to the more command, letting the user view one screenful of disassembled output at a time. Optionally, the user can specify a count value, which limits the number of disassembled lines to that number.
…………………………………………………………………………………………..
The regstyle environment variable determines whether the Monitor displays hardware or software register names. Hardware register names are simply $0 through $31. Software registers are defined by the MIPS software conventions. Set regstyle to ''hw'' for hardware register names. Set regstyle to ''sw'' for software register names.
Examples illustrating the use of the l command follow.
PMON> set regstyle sw Select s/w names
PMON> l 9fc00240 4 Disassemble 4 instructions
Pmon+0×240 3c020040 lui v0,0×40
Pmon+0×244 40826000 mtc0 v0,C0_SR
Pmon+0×248 3c048001 lui a0,0×8001
Pmon+0×248 8c850080 lw a1,128(a0)
PMON> set regstyle hw Select h/w names
PMON> l 9fc00240 4
Pmon+0×240 3c020040 lui $2,0×40
Pmon+0×244 40826000 mtc0 $2,$12
Pmon+0×248 3c048001 lui $4,0×8001
Pmon+0×248 8c850080 lw $5,128($4)
See also the more command.
…………………………………………………………………………………………..
load The load command downloads programs and data from the host.
…………………………………………………………………………………………..
Format The for mat for this command is:
load [-beastifrl][-o offset] path
where:
| [-s] [-b] [-e] [-a] [-t] [-i] [-f flash_addr] [-o load_addr] [-n] [-y] [-v] [-w] [-k] [-r] [-d] path | Don't clear old symbols. Don't clear breakpoints. Don't clear exception handlers. Don't add offset to symbols. Load at top of memory. Ignore checksum errors. Load file into flash rom begin at flash_addr. Load file into ram begin at load_addr. Don't load symbols. Only load symbols. Verbose message. Reverse endianness. Prepare for kernel symbols. Load raw file. Load st7foxf1(EC bin). path and filename\\ |
Invoking the load command with no parameters or arguments clears the symbol table, deletes all current breakpoints, allows the Monitor to receive programs or data from the host.
…………………………………………………………………………………………..
The load command accepts programs and data from the host in LSI Logic's proprietary FastLoad format.
On a networked board you can download a Fast-Load file using TFTP, by specifying path as ''tftp://ipaddress/filename''. for more infor mation about setting up and using TFTP.
The load command normally clears the symbol table, exception handlers, and all breakpoints. The -s and -b options suppress the clearing of the symbol table and breakpoints, respectively. The value of the EPC register is set automatically to the entry point of the program. Therefore, to execute the downloaded program, only the g command is required.
The load command returns the error message ''out of memory'' if there is insufficient space in the heap for the program's global symbols. To increase the size of the heap, use the set heaptop command to reserve more space in the heap and, if necessary, relink your program with a higher start address.
Examples illustrating the use of the load command follow:
1. Load RAM-like PMON image from host into memory(ram) and run
PMON> load tftp://172.16.0.30/gzram
PMON> g
2. Load ROM-like PMON image from host into flash memory(rom), also it takes effects of Updating PMON on board
PMON> load -r -f bfc00000 tftp://172.16.0.30/gzrom.bin
3. Load Linux kernel image from hard disk and run
PMON> load /dev/fs/ext2@wd0/boot/vmlinux
PMON> g $karg
4. Load Linux kernel image from U disk and run
PMON> load /dev/fs/ext2@usb0/vmlinux
PMON> g $karg
…………………………………………………………………………………………..
ls The ls command lists the current symbols in the symbol table.
…………………………………………………………………………………………..
Format The for mat for this command is:
ls [-ln] [sym|-v|-a adr]
where:
-l provides a long listing, showing the address value for each symbol.
-n lists the symbols in ascending order of address.
sym is a pattern filter for the symbols to be shown. Both character
wildcards (''?'' ) and word wildcards (''*'' ) are permitted.
-v is the verbose option, showing the value in hexadecimal, decimal,
and octal.
-a shows the address in symbolic form.
adr is the address for which a symbol or offset from a symbol is
sought.
Invoking the ls command without any options or parameters lists the symbols in descending order of address without displaying the actual address for each symbol.
…………………………………………………………………………………………..
The ls command lists the symbols in the symbol table in alphabetical order.
The -l option produces a long listing, which includes the address value of
each symbol. The -n option causes the symbols to be listed in ascending
order of address. The -a adr option lists the symbol at the next lowest
address. The -v adr option prints the result in hex, decimal, and octal. The -v option is useful for computing the value of an expression that may include registers, symbols, and absolute values.
Examples illustrating the use of the ls command follow.
PMON> ls List symbols in alphabetic order.
flush_cache start
PMON> ls -l List symbols in alphabetic order with
9fc016f0 flush_cache addresses.
9fc00240 start
PMON> ls -ln List symbols and addresses in
9fc00240 start ascending order of address.
9fc016f0 flush_cache
PMON> ls s* List symbols starting with the letter ''s''.
start
PMON> ls -a 9fc00260 List symbol at the next lowest address.
9fc00240 start+0×20
PMON> ls -a @epc List symbol at the next lowest address
a0020020 = start+0×20 from EPC.
PMON> ls -v @t0+0t10*4 Display the value of the expression
0x800222e8 = 0t-2147343640 = 0o20000421350
…………………………………………………………………………………………..
m The m command displays and modifies memory.
…………………………………………………………………………………………..
Format The for mat for this command is:
m [-bhwdnx] adr [val|-s str]..
where:
| [-b] [-h] [-w] [-x] [-d] [-n] <hexval> CR = ^|- . | Access bytes Access halt-words Access words Swap bytes Access double-words Non-interactive (no write) Set memory, forward one In interactive mode, move forward one byte with no other change. In interactive mode, read current address again. In interactive mode, move back one byte. Exit interactive mode. |
Invoking the ls command without any options or parameters lists the symbols in descending order of address without displaying the actual address for each symbol.
…………………………………………………………………………………………..
This command can display and then modify memory locations interactively.
This command can also set memory to a specified value directly.
If invoked with one or more values following the address, the command is
executed immediately, without entering the interactive mode.
If the command is invoked without a value, the command enters the interactive memory mode. In interactive memor y mode, the user enters a command at the cursor. The interactive memor y mode first displays the address and its current value. Interactive memor y mode then lets the user select one of the commands listed in Table 4.1.
Table 4.1 Interactive Memory Mode Commands
| Command | Action |
| hex value | Set memor y to hexadecimal value and then move forward one byte. |
| <CR> | Move forward one byte. |
| = | Stay at the same address and display the address again. |
| ˆ or - | Move backwards one byte. |
| . | Exit the m command. |
If the -s option is specified, then the Monitor displays the memory contents as an ASCII string. A multiple-word string may be specified by enclosing the multiple-word string in quotation marks.
Examples illustrating the use of the m command follow.
PMON> m a4000000 Display memor y at address in
interactive mode.
a4000000 ff _ User can enter command at cursor
PMON> m a0020000 Display memor y at 0xA0020000.
a0020000 01 <CR>
a0020001 02 <CR>
a0020002 03 <CR>
a0020003 04 .
PMON> m a0020000 22 Set address 0xA0020000 to 0×22.
PMON> m -h a0020000 2233 Set address 0xA0020000 to 0×2233.
PMON> m 80020000 -s even Set memory star ting at 0×8002.0000 to
the string ''even''.
PMON> m 80030100 -s “PROM Monitor”
Set memory star ting at 0×8003.0100 to
the string ''PROM Monitor''.
…………………………………………………………………………………………..
more The more command provides screen-at-a-time control for user input.
…………………………………………………………………………………………..
Format The more command is an embedded command and is not accessible to the user on the command line.
…………………………………………………………………………………………..
The more command is not specified by the user on the command line, but is implicitly used by cer tain commands. After displaying the number of lines according to the value of the moresz environment var iable, the more command displays the prompt ''more…'' Commands that use the more command include h, d, l, search, and ls.
The user can enter the following commands at the ''more…'' prompt:
…………………………………………………………………………………………..
The moresz variable sets how many lines are displayed on one screen during screen-at-a-time output. If moresz is set to zero, then the screen scrolls continuously. The ˆS or ˆQ control sequence must be used to pause the output, and the ˆC control sequence must be used to terminate output.
For example, to set the default number of lines output by the more command to 12, enter:
PMON> set moresz 12
See also the set command for the setup of the environment var iables.
…………………………………………………………………………………………..
nmt The nmt command executes the memory test.
…………………………………………………………………………………………..
Format The for mat for this command is:
nmt <base> <size> <loop>
where:
| <base> <size> <loop> | Start address.(In hex form) Memory size.(In hex form ) Times to test. |
…………………………………………………………………………………………..
The nmt memor y test is not an exhaustive test. In the nmt test, a single ''walking one'' is written to each word and cleared in turn. Then, to test other bits in the word, each word is loaded with its own address and then read back. Because this test writes an exclusive value to every word, it is sufficient to find most stuck-at faults and shorts. How ever, this test is not adequate to find pattern sensitivity and leakage faults.
Examples illustrating the use of the nmt command follow.
PMON> nmt 80200000 10 3 Test 0x10M bytes there times starting at 0×80200000
…………………………………………………………………………………………..
ping The ping command ''bounces'' a packet to and from a specified networ k
host.
…………………………………………………………………………………………..
Format The format for this command is:
ping [-qfrv] [-c cnt][-s size] host
where:
| [-q] [-f] [-r] [-v] [-c cnt] [-s size] host | Quiet - nothing is displayed except summary. Set Don't Fragment flag in packet. Record route for count hops. Verbose − display all ICMP messages, not just echo replies Number of echo requests to send. [-s size] Use packets of size bytes (default=56). Internet host address to send packets to. |
…………………………………………………………………………………………..
The ping command is used to ver ify ether net networ k connections and
setup. It makes use of a feature of the ''ICMP'' protocol, which is used by
hosts and gateways for low-level administrative chores. Each ICMP host is required to respond to an ECHO_REQUEST datagram with an
ECHO_RESPONSE. ECHO_REQUEST datagrams (''pings'') have an IP and ICMP header, followed by a time and then an arbitrar y number of ''pad'' bytes used to fill out the packet. The command continues pinging until interrupted by a Control-C.
When using ping for fault isolation, start by pinging ''127.0.0.1'' (a universal self-address, by inter net convention.) This verifies that at least the onboard setup is wor kable. Then, hosts and gateways further and further away should be ''pinged''. Round-trip times and packet loss statistics are computed. If duplicate packets are received, they are not included in the packet loss calculation, although the round trip time of these packets is used in calculating the minimum/average/maximum round-trip time numbers. When the program is ter minated by a Control-C a brief summary is displayed.
Ping will report duplicate and damaged packets. Duplicate packets ''should never happen'': they'd have to be gateway problems. Tell your network manager.
Damaged packets (data doesn't look like it should) are serious cause for
alarm and often indicate broken hardware somewhere in the ping packet's path (in the networ k or in the hosts).
The ''TTL'' field of an IP packet is used to count the number of times the
packet passes through a router; once it gets down to zero the packet is discarded, which prevents accidental internet loops from recycling the same old packets forever. It's common practice for each router in the Internet to decrement the TTL field by exactly one. The biggest possible value of TTL is 255, and most Unix systems set the TTL field of ICMP ECHO_REQUEST packets to 255. This could, conceivably, mean that you can ''ping'' some hosts, but not reach them with tftp.
In normal operation ping prints the TTL value from the packet it receives.
When a remote system receives a ping packet, it can do one of three things with the TTL field in its response:
• Not change it; this is what Berkeley Unix systems did before the 4.3 tahoe
release. In this case the TTL value in the received packet will be 255
minus the number of routers in the round-trip path.
• Set it to 255; this is what current Berkeley Unix systems do. In this case
the TTL value in the received packet will be 255 minus the number of
routers in the path from the remote system to the ping host.
• Set it to some other value. Some machines use the same value for ICMP
packets that they use for TCP packets, for example either 30 or 60. Others may use completely wild values.
…………………………………………………………………………………………..
r The r command sets or displays register values.
…………………………………………………………………………………………..
Format The for mat for this command is:
r [reg|* [val|field val]]
where:
reg is the name of the register or registers (specified by wildcard
characters) to display or modify.
val is the value to which the specified register or registers should be
modified.
field val is the value to which the specified field in the specified register
should be modified.
* displays the contents of all registers except floating-point registers.
f* displays the contents of all floating-point registers.
Invoking the r command without any parameters or arguments displays a list of all the general-pur pose registers.
…………………………………………………………………………………………..
The r command sets or displays register values. The character and word
wildcards, ''*'' and ''?'', can be used in the register name. This command
accepts both hardware and software names.See also the l command for disassembling instructions from memory .
…………………………………………………………………………………………..
The regsize variable selects how many bits to display for the general-purpose registers (i.e. $0 to $31), and some Coprocessor 0 registers (e.g. EPC). If regsize is set to ''32'' then 32-bits will be displayed, and if it is set to ''64'' then 64-bits will be displayed.
Note that regsize does not affect how the floating point registers are displayed. These will be displayed as 64-bit registers only if the FR bit is set in the CPU's Status register (called sr or C0_SR).
Examples illustrating the use of the r command follow.
PMON> r Display all general-pur pose registers.
PMON> r * Display all register values.
PMON> r 8 Display $8 (t0).
PMON> r t0 Display t0 ($8).
PMON> r t* Display t0 through t9.
PMON> r epc Display EPC register.
PMON> r epc start Set EPC register to the symbol start value.
PMON> r 4 45 Set register 4 to 45.
PMON> r t0 45 Set register t0 to 45.
PMON> r sr 0 Set SR to zero.
PMON> r sr bev 1 Set the BEV bit of SR to one.
PMON> r epc a0020000 Set EPC to A002.0000.
…………………………………………………………………………………………..
reboot The reboot command attempts to restart the PMON monitor (and any other code which runs before PMON at bootstrap time) by jumping to 0xBFC00000 - the MIPS restart location. If your system initialisation depends on some device receiving a hardware reset, this may not wor k.
…………………………………………………………………………………………..
Format The for mat for this command is just
reboot
…………………………………………………………………………………………..
search The search command executes a search for a memory pattern.
…………………………………………………………………………………………..
Format The for mat for this command is:
search from to {val|-s str}…
where:
from is the start address for the search operation.
to is the end address for the search operation.
val is the hexadecimal value that is the object of the search.
-s str specifies that the search operation is for a string str.
…………………………………………………………………………………………..
The search command searches memory for a pattern. The pattern may be a single byte, multiple bytes, or an ASCII string.
If the -s option is specified, then the next parameter is interpreted as an
ASCII string. To search for a multiple-word string, enclose the string in double quotation marks.
The output of this command is printed to the screen via the more command.
The following example searches for 3c and d4 from 0xA0020000 to
0xA0030000:
PMON> search a0020000 a0030000 3c d4
The following example searches or ''ABC'' from 0xA0020000 to 0xA0030000:
PMON> search a0020000 a0030000 -s “ABC”
See also the more command.
…………………………………………………………………………………………..
set The set command sets and displays environment var iables.
…………………………………………………………………………………………..
Format The for mat for this command is:
set [name [value]]
where:
name is the name of the environment variable to set.
value is the string to which the environment var iable is set.
Enter ing the set command with no arguments displays all the current environment var iables.
…………………………………………………………………………………………..
The set command is used to set or display environment variable values,
which are stored in NVRAM.
In some cases, when the Monitor displays a variable's current value, the Monitor prints a list of allowed values enclosed in square brackets; in other cases, no list is shown. In general, when the value is a numer ic value, or when the value has an unlimited range of possible values, no list is shown.
Where a variable has a list of values, the set command will check that the specified value is in the list. Most other values will only be checked when a command uses a variable.
To set a var iable to a multiple-word value, enclose the value in single or double quotation marks.
See also the eset and unset commands.
Examples illustrating the use of the set command follow.
PMON> set Display all current values.
brkcmd “l @epc 1”
datasz -b [-b -h -w]
dlecho off [off on lfeed]
dlproto EtxAck [none XonXoff EtxAck]
ethaddr 00:40:bc:03:00:00
heaptop 80020000
hostport tty1
inalpha hex [hex symbol]
inbase 16 [auto 8 10 16]
moresz 10
prompt “PMON> ”
regstyle sw [hw sw]
PMON> set moresz Display current moresz.
moresz = 10
PMON> set moresz 20 Set moresz to 20 decimal.
PMON> set brkcmd “l @epc 1;r cause;r” Set brkcmd to the str ing
''l @epc 1;r cause;r''
…………………………………………………………………………………………..
sym The sym command sets a symbolic name for a var iable.
…………………………………………………………………………………………..
Format The for mat for this command is:
sym name value
where:
name is the name of the var iable for which a value is to be set.
value is the value to which the var iable is set.
…………………………………………………………………………………………..
The sym command sets a symbolic name to the specified value. Normally the load and boot commands clears the symbol table. How ever, there is an option to overr ide the clearing of the symbol table .
Symbols can be displayed using the ls command.
Examples illustrating the use of this command follow.
PMON> sym start 9fc00240
PMON> sym flush_cache 9fc016f0
PMON> l start 4
start:
start+0×240 3c09a07f lui t1,0xa07f
start+0×244 3c08003c lui t0,0x3c
start+0×248 3529ff20 ori t1,t1,0xff20
PMON> l 9fc0027c 5
start+0x27c 03a1e825 or sp,sp,at
start+0×280 0ff005bc jal flush_cache
start+0×284 24040000 addiu a0,zero,0×0
start+0×288 0ff005bc jal flush_cache
start+0x28c 24040001 addiu a0,zero,0×1
See also the ls, boot, load, l, and sh commands.
…………………………………………………………………………………………..
t The t command initiates a trace procedure.
…………………………………………………………………………………………..
| The for mat for this command is: | |
| t [-vbci] [-m adr val] [-M adr val] [-r reg val] | |
| [-R reg val][cnt] | |
| or : | |
| to [-vbci] [-m adr val] [-M adr val] [-r reg val] | |
| [-R reg val][cnt] | |
| where: | |
| -v | lists each step (verbose). |
| -b | captures only branches. |
| -c | captures only calls (jal instruction). |
| -i | stops on invalid program counter. |
| -m adr val | stops when memory at address adr is equal to value val. |
| -M adr val | stops when memory at address adr is not equal to value val. |
| -r reg val | stops when register reg is equal to value val. |
| -R reg val | stops when register reg is not equal to value val. |
| cnt | traces cnt instr uctions. |
…………………………………………………………………………………………..
The t command executes the instruction addressed by the current value of the EPC register. The to command is similar to the t command, except that the to command treats an entire procedure as a single step. For example, if the current instruction at EPC is a jump and link instruction, jal, the next stop is at EPC+8.
The command or commands that are executed on completion of the single step is determined by the value of the environment var iable brkcmd.
An example illustrating the use of this command follows.
PMON> t
Pmon+0×240 3c09a07f lui t1,0xa07f
…………………………………………………………………………………………..
tr The tr command selects transparent mode.
…………………………………………………………………………………………..
Format The for mat for this command is:
tr
…………………………………………………………………………………………..
The tr command selects transparent mode. In transparent mode, the Monitor copies any characters typed on the keyboard to the hostport and then copies characters arriving at the hostport to the screen. The tr command lets the user run the Monitor on the same serial port that is used as a login line.
…………………………………………………………………………………………..
The environment variable trabort selects the character that terminates the transparent mode and returns the Monitor to the default command mode.
See also the set command for the setup of the environment var iables.
…………………………………………………………………………………………..
unset The unset command removes environment var iables.
…………………………………………………………………………………………..
Format The for mat for this command is:
unset name…
where:
name is the name of an environment var iable to remove . Both character
wildcards ''?'' and word wildcards ''*'' are permitted.
…………………………………………………………………………………………..
The unset command removes environment var iables that are no longer
required. For each var iable name given as an argument the unset command removes all var iables which match that name.
If you attempt to remove an environment var iables which has a pervasive standard use within PMON, then it is not removed, but is reset to its default value.
See also the eset and set commands.
Examples illustrating the use of the unset command follow.
PMON> unset bootfile Remove bootfile variable.
PMON> unset datasz Reset datasz variable to default.
PMON> unset it* Remove all var iables starting with ''it''


