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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [README.or1k] - Diff between revs 30 and 173

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 30 Rev 173
?rev1line?
?rev2line?
 
This is the Or1k specific README file for the RTEMS project.
 
Please send questions or comments to Chris Ziomkowski,
 
chris@asics.ws. I will try my best to answer your questions.
 
 
 
Currently, there is only 1 board support package for Or1k, which
 
is called bender. To make this package, it may be necessary to
 
edit the board configuration make file in rtems-4.5.0/make/custom.
 
The file is called bender.cfg. It was necessary to hard code some
 
libraries in this file, as I could not figure out how to make the
 
automatic scripts link against the correct libraries. There is a
 
hardcoded path to your gcclib directory which it may be necessary
 
to change.
 
 
 
Configure is excluded from CVS depository. In order to build or
 
rebuild it you will need:
 
  autoconf v2.12 or later
 
  automake v1.4 or later
 
 
 
To build configure run bootstrap script in top rtems directory by
 
typing
 
 
 
./bootstrap
 
 
 
If you wish to rebuild existing configure scripts type
 
 
 
./bootstrap -c
 
./bootstrap
 
 
 
Then create an or1k directory under the main rtems directory,
 
cd into this directory, and type
 
 
 
../configure  --target=or1k --program-prefix=
 
 
 
Where "" represents the prefix you have assigned
 
to your or1k tools. For example, mine reads:
 
 
 
../configure  --target=or1k --program-prefix=or32-rtems-
 
 
 
This should setup the makefiles necessary to create the package.
 
You can now simply type "make", which should build the bender support
 
package and the example tests.
 
 
 
If you don't happen to have a board available for this CPU, you
 
can run this against the architectural or1k simulator. There are
 
several ways to do this. The one which I have found most helpful
 
for debugging is to use it in gdb mode.
 
 
 
First, you'll need a console. The or1k simulator is currently
 
configured to open a serial port on /tmp/uart0.rx and /tmp/uart0.tx.
 
To use this as a normal console, you'll need to make these into
 
FIFOs. Do this by running the command:
 
 
 
mkfifo /tmp/uart0.tx
 
mkfifo /tmp/uart0.rx
 
 
 
You can now create an input and an output stream which you can see
 
by opening 2 windows. In the first window, type:
 
 
 
cat > /tmp/uart0.rx
 
 
 
In the other window, type:
 
 
 
cat < /tmp/uart0.tx
 
 
 
The "rx" window is where you will type, and the "tx" window will
 
print messages.
 
 
 
Next, start up the simulator by typing "sim -srv 7777". This assumes
 
or1ksim is in your path and that you want to start the gdb server on
 
port 7777.
 
 
 
You are now ready to load the code and run. To do this, type:
 
 
 
cd rtems-4.5.0/or1k
 
gdb bender/samples/hello.exe
 
 
 
Again, substitute your actual prefix for "". In my
 
case, this is "or32-rtems-". A log of this session is shown below. A
 
breakpoint has been placed on the exit function so that you can see
 
the exit code. Note that if you don't do this, there is no way to
 
automatically stop the process. It will simply appear to hang, and
 
gdb will never return.
 
 
 
flex% or32-rtems-gdb bender/samples/hello.exe
 
GNU gdb 5.0
 
Copyright 2000 Free Software Foundation, Inc.
 
GDB is free software, covered by the GNU General Public License, and you are
 
welcome to change it and/or distribute copies of it under certain conditions.
 
Type "show copying" to see the conditions.
 
There is absolutely no warranty for GDB.  Type "show warranty" for details.
 
This GDB was configured as "--host=i686-pc-linux-gnu --target=or32-rtems"...
 
(gdb) target jtag jtag://localhost:7777
 
Remote or1k debugging using jtag://localhost:7777
 
0x0 in text_start ()
 
(gdb) load bender/samples/hello.exe
 
Loading section .text, size 0x30130 lma 0x0
 
Loading section .data, size 0x1cc4 lma 0x30130
 
Start address 0x2000 , load size 204276
 
Transfer rate: 1634208 bits/sec, 510 bytes/write.
 
(gdb) b exit
 
Breakpoint 1 at 0x24444: file exit.c, line 65.
 
(gdb) run
 
Starting program: /home/opencores/2008/rtems-4.5.0/or1k/bender/samples/hello.exe
 
 
 
Breakpoint 1, exit (code=0) at exit.c:65
 
65      exit.c: No such file or directory.
 
(or1k) quit
 
flex%
 
 
 
 
 
On your "tx" window, you should see the following message:
 
 
 
----
 
 
 
 
 
*** HELLO WORLD TEST ***
 
Hello World
 
*** END OF HELLO WORLD TEST ***
 
 
 
----
 
 
 
Congratulations! You have just run a program under RTEMS on
 
the Or1k simulator! You can now write your own RTEMS code and
 
run it in the same way.
 
 
 
If you want, you can follow the same procedure to run the
 
regression test. This is found in the directory
 
or1k/bender/tests/base_sp.exe. Use the above instructions,
 
and replace bender/tests/base_sp.exe everywhere you see
 
bender/samples/hello.exe. It will test a large portion
 
of the RTEMS functionality. You should see the following
 
after executing this:
 
 
 
----
 
 
 
*** SAMPLE SINGLE PROCESSOR APPLICATION ***
 
Creating and starting an application task
 
Application task was invoked with argument (0) and has id of 0x8010002
 
*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***
 
 
 
---
 
 
 
You should now have a good idea of how to run executables. It's
 
now up to you to start having fun with RTEMS. Good luck....
 
 
 
Chris Ziomkowski
 
chris@asics.ws

powered by: WebSVN 2.1.0

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