1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | |
---|
6 | The contents of this directory are based upon the "r46kstub.tar.gz" package |
---|
7 | released to the net by |
---|
8 | |
---|
9 | C. M. Heard |
---|
10 | VVNET, Inc. phone: +1 408 247 9376 |
---|
11 | 4040 Moorpark Ave. Suite 206 fax: +1 408 244 3651 |
---|
12 | San Jose, CA 95117 USA e-mail: heard@vvnet.com |
---|
13 | |
---|
14 | This package was released in the September 1996 time frame for use |
---|
15 | with gdb 4.16 and an IDT R4600 Orion. The stub was modified to support |
---|
16 | R3000 class CPUs and to work within the mips-rtems exeception processing |
---|
17 | framework. |
---|
18 | |
---|
19 | THe file memlimits.h could end up being target board dependent. If |
---|
20 | this is the case, copy it to your BSP directory and modify as necessary. |
---|
21 | |
---|
22 | --joel |
---|
23 | 8 February 2002 |
---|
24 | |
---|
25 | Original README |
---|
26 | =============== |
---|
27 | |
---|
28 | The r46kstub directory and its compressed archive (r46kstub.tar.gz) contain |
---|
29 | the 9/29/96 source code snapshot for a ROM-resident gdb-4.16 debug agent |
---|
30 | (aka stub) for the IDT R4600 Orion processor. It is based on the stub for |
---|
31 | the Hitachi SH processor written by Ben Lee and Steve Chamberlain and |
---|
32 | supplied with the gdb-4.16 distribution; that stub in turn was "originally |
---|
33 | based on an m68k software stub written by Glenn Engel at HP, but has changed |
---|
34 | quite a bit". The modifications for the R4600 were contributed by C. M. |
---|
35 | Heard of VVNET, Inc. and were based in part on the Algorithmics R4000 version |
---|
36 | of Phil Bunce's PMON program. |
---|
37 | |
---|
38 | The distribution consists of the following files: |
---|
39 | |
---|
40 | -rw-r--r-- 1 1178 Sep 29 16:34 ChangeLog |
---|
41 | -rw-r--r-- 1 748 Jul 26 01:18 Makefile |
---|
42 | -rw-r--r-- 1 6652 Sep 29 16:34 README |
---|
43 | -rw-r--r-- 1 1829 May 21 02:02 gdb_if.h |
---|
44 | -rw-r--r-- 1 3745 Sep 29 14:03 ioaddr.h |
---|
45 | -rw-r--r-- 1 2906 Sep 29 14:39 limits.h |
---|
46 | -rw-r--r-- 1 6552 May 23 00:17 mips_opcode.h |
---|
47 | -rw-r--r-- 1 14017 May 21 02:04 r4600.h |
---|
48 | -rw-r--r-- 1 23874 Jul 21 20:31 r46kstub.c |
---|
49 | -rw-r--r-- 1 1064 Jul 3 12:35 r46kstub.ld |
---|
50 | -rw-r--r-- 1 13299 Sep 29 16:24 stubinit.S |
---|
51 | |
---|
52 | With the exception of mips_opcode.h, which is a slightly modified version |
---|
53 | of a header file contributed by Ralph Campbell to 4.4 BSD and is therefore |
---|
54 | copyrighted by the UC Regents, all of the source files have been dedicated |
---|
55 | by their authors to the public domain. Use them as you wish, but do so |
---|
56 | at your own risk! The authors accept _no_ responsibility for any errors. |
---|
57 | |
---|
58 | The debug agent contained herein is at this writing in active use at VVNET |
---|
59 | supporting initial hardware debug and board bring-up of an OC-12 ATM probe |
---|
60 | board. It uses polled I/O on a 16C450 UART. We had originally intended to |
---|
61 | add support for interrupts to allow gdb to break in on a running program, |
---|
62 | but we have found that this is not really necessary since the reset button |
---|
63 | will accomplish the same purpose (thanks to the MIPS feature of saving the |
---|
64 | program counter in the ErrorEPC register when a reset exception occurs). |
---|
65 | |
---|
66 | Be aware that this stub handles ALL interrupts and exceptions except for |
---|
67 | reset (or NMI) in the same way -- by passing control to the debug command |
---|
68 | loop. It of course uses the ROM exception vectors to do so. In order to |
---|
69 | support code that actally needs to use interrupts we use use a more elaborate |
---|
70 | stub that is linked with the downloaded program. It hooks the RAM exception |
---|
71 | vectors and clears the BEV status bit to gain control. The ROM-based stub |
---|
72 | is still used in this case for initial program loading. |
---|
73 | |
---|
74 | In order to port this stub to a different platform you will at a minimum |
---|
75 | need to customize the macros in limits.h (which define the limits of readable, |
---|
76 | writeable, and steppable address space) and the I/O addresses in ioaddr.h |
---|
77 | (which define the 16C450 MMIO addresses). If you use something other than |
---|
78 | a 16C450 UART you will probably also need to modify the portions of stubinit.S |
---|
79 | which deal with the serial port. I've tried to be careful to respect all the |
---|
80 | architecturally-defined hazards as described in Appendix F of Kane and |
---|
81 | Heinrich, MIPS RISC Architecture, in order to minimize the work in porting |
---|
82 | to 4000-series processors other than the R4600, but no guarantees are offered. |
---|
83 | Support is presently restricted to big-endian addressing, and I've not even |
---|
84 | considered what changes would be needed for little-endian support. |
---|
85 | |
---|
86 | When this stub is built with gcc-2.7.2 and binutils-2.6 you will see a few |
---|
87 | warning messages from the single-step support routine where a cast is used |
---|
88 | to sign-extend a pointer (the next instruction address) into a long long |
---|
89 | (the PC image). Those warnings are expected; I've checked the generated |
---|
90 | code and it is doing what I had intended. But you should not see any other |
---|
91 | warnings or errors. Here is a log of the build: |
---|
92 | |
---|
93 | mips64orion-idt-elf-gcc -g -Wa,-ahld -Wall -membedded-data \ |
---|
94 | -O3 -c r46kstub.c >r46kstub.L |
---|
95 | r46kstub.c: In function `doSStep': |
---|
96 | r46kstub.c:537: warning: cast to pointer from integer of different size |
---|
97 | r46kstub.c:539: warning: cast to pointer from integer of different size |
---|
98 | r46kstub.c:547: warning: cast to pointer from integer of different size |
---|
99 | r46kstub.c:561: warning: cast to pointer from integer of different size |
---|
100 | r46kstub.c:563: warning: cast to pointer from integer of different size |
---|
101 | r46kstub.c:572: warning: cast to pointer from integer of different size |
---|
102 | r46kstub.c:574: warning: cast to pointer from integer of different size |
---|
103 | r46kstub.c:582: warning: cast to pointer from integer of different size |
---|
104 | r46kstub.c:589: warning: cast to pointer from integer of different size |
---|
105 | r46kstub.c:591: warning: cast to pointer from integer of different size |
---|
106 | r46kstub.c:597: warning: cast to pointer from integer of different size |
---|
107 | r46kstub.c:599: warning: cast to pointer from integer of different size |
---|
108 | r46kstub.c:605: warning: cast to pointer from integer of different size |
---|
109 | r46kstub.c:607: warning: cast to pointer from integer of different size |
---|
110 | r46kstub.c:613: warning: cast to pointer from integer of different size |
---|
111 | r46kstub.c:615: warning: cast to pointer from integer of different size |
---|
112 | r46kstub.c:624: warning: cast to pointer from integer of different size |
---|
113 | r46kstub.c:628: warning: cast to pointer from integer of different size |
---|
114 | r46kstub.c:635: warning: cast to pointer from integer of different size |
---|
115 | r46kstub.c:637: warning: cast to pointer from integer of different size |
---|
116 | mips64orion-idt-elf-gcc -g -Wa,-ahld -Wall -membedded-data \ |
---|
117 | -O3 -c stubinit.S >stubinit.L |
---|
118 | mips64orion-idt-elf-ld -t -s -T r46kstub.ld -Map r46kstub.map -o r46kstub.out |
---|
119 | mips64orion-idt-elf-ld: mode elf32bmip |
---|
120 | stubinit.o |
---|
121 | r46kstub.o |
---|
122 | mips64orion-idt-elf-objcopy -S -R .bss -R .data -R .reginfo \ |
---|
123 | -O srec r46kstub.out r46kstub.hex |
---|
124 | |
---|
125 | Limitations: stubinit.S deliberately forces the PC (which is a 64-bit |
---|
126 | register) to contain a legitimate sign-extended 32-bit value. This was |
---|
127 | done to cope with a bug in gdb-4.16, which does _not_ properly sign-extend |
---|
128 | the initial PC when it loads a program. This means that you cannot use |
---|
129 | the "set" command to load an unmapped sixty-four bit virtual address into |
---|
130 | the PC, as you can for all other registers. |
---|
131 | |
---|
132 | Please send bug reports, comments, or suggestions for improvement to: |
---|