OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rtems/] [README.or1k] - Blame information for rev 208

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 208 chris
This is the Or1k specific README file for the RTEMS project.
2
Please send questions or comments to Chris Ziomkowski,
3
chris@asics.ws. I will try my best to answer your questions.
4
 
5
Currently, there is only 1 board support package for Or1k, which
6
is called bender. To make this package, it may be necessary to
7
edit the board configuration make file in rtems-4.5.0/make/custom.
8
The file is called bender.cfg. It was necessary to hard code some
9
libraries in this file, as I could not figure out how to make the
10
automatic scripts link against the correct libraries. There is a
11
hardcoded path to your gcclib directory which it may be necessary
12
to change.
13
 
14
After you have done this, create an or1k directory under the
15
main rtems-4.5.0 directory. cd into this directory, and type
16
 
17
 
18
../configure  --target=or1k --program-prefix=
19
 
20
Where "" represents the prefix you have assigned
21
to your or1k tools. For example, mine reads:
22
 
23
../configure  --target=or1k --program-prefix=or32-rtems-
24
 
25
This should setup the makefiles necessary to create the package.
26
You can now simply type "make", which should build the bender support
27
package and the example tests.
28
 
29
If you don't happen to have a board available for this CPU, you
30
can run this against the architectural or1k simulator. There are
31
several ways to do this. The one which I have found most helpful
32
for debugging is to use it in gdb mode.
33
 
34
First, you'll need a console. The or1k simulator is currently
35
configured to open a serial port on /tmp/uart0.rx and /tmp/uart0.tx.
36
To use this as a normal console, you'll need to make these into
37
FIFOs. Do this by running the command:
38
 
39
mkfifo /tmp/uart0.tx
40
mkfifo /tmp/uart0.rx
41
 
42
You can now create an input and an output stream which you can see
43
by opening 2 windows. In the first window, type:
44
 
45
cat > /tmp/uart0.rx
46
 
47
In the other window, type:
48
 
49
cat < /tmp/uart0.tx
50
 
51
The "rx" window is where you will type, and the "tx" window will
52
print messages.
53
 
54
Next, start up the simulator by typing "sim -srv 7777". This assumes
55
or1ksim is in your path and that you want to start the gdb server on
56
port 7777.
57
 
58
You are now ready to load the code and run. To do this, type:
59
 
60
cd rtems-4.5.0/or1k
61
gdb bender/samples/hello.exe
62
 
63
Again, substitute your actual prefix for "". In my
64
case, this is "or32-rtems-". A log of this session is shown below. A
65
breakpoint has been placed on the exit function so that you can see
66
the exit code. Note that if you don't do this, there is no way to
67
automatically stop the process. It will simply appear to hang, and
68
gdb will never return.
69
 
70
flex% or32-rtems-gdb bender/samples/hello.exe
71
GNU gdb 5.0
72
Copyright 2000 Free Software Foundation, Inc.
73
GDB is free software, covered by the GNU General Public License, and you are
74
welcome to change it and/or distribute copies of it under certain conditions.
75
Type "show copying" to see the conditions.
76
There is absolutely no warranty for GDB.  Type "show warranty" for details.
77
This GDB was configured as "--host=i686-pc-linux-gnu --target=or32-rtems"...
78
(gdb) target jtag jtag://localhost:7777
79
Remote or1k debugging using jtag://localhost:7777
80
0x0 in text_start ()
81
(gdb) load bender/samples/hello.exe
82
Loading section .text, size 0x30130 lma 0x0
83
Loading section .data, size 0x1cc4 lma 0x30130
84
Start address 0x2000 , load size 204276
85
Transfer rate: 1634208 bits/sec, 510 bytes/write.
86
(gdb) b exit
87
Breakpoint 1 at 0x24444: file exit.c, line 65.
88
(gdb) run
89
Starting program: /home/opencores/2008/rtems-4.5.0/or1k/bender/samples/hello.exe
90
 
91
Breakpoint 1, exit (code=0) at exit.c:65
92
65      exit.c: No such file or directory.
93
(or1k) quit
94
flex%
95
 
96
 
97
On your "tx" window, you should see the following message:
98
 
99
----
100
 
101
 
102
*** HELLO WORLD TEST ***
103
Hello World
104
*** END OF HELLO WORLD TEST ***
105
 
106
----
107
 
108
Congratulations! You have just run a program under RTEMS on
109
the Or1k simulator! You can now write your own RTEMS code and
110
run it in the same way.
111
 
112
If you want, you can follow the same procedure to run the
113
regression test. This is found in the directory
114
or1k/bender/tests/base_sp.exe. Use the above instructions,
115
and replace bender/tests/base_sp.exe everywhere you see
116
bender/samples/hello.exe. It will test a large portion
117
of the RTEMS functionality. You should see the following
118
after executing this:
119
 
120
----
121
 
122
*** SAMPLE SINGLE PROCESSOR APPLICATION ***
123
Creating and starting an application task
124
Application task was invoked with argument (0) and has id of 0x8010002
125
*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***
126
 
127
---
128
 
129
You should now have a good idea of how to run executables. It's
130
now up to you to start having fun with RTEMS. Good luck....
131
 
132
Chris Ziomkowski
133
chris@asics.ws

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.