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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [README.or1k] - Diff between revs 348 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

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