URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [rtems/] [README.or1k] - Rev 602
Go to most recent revision | Compare with Previous | Blame | View Log
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, whichis called bender. To make this package, it may be necessary toedit the board configuration make file in rtems-4.5.0/make/custom.The file is called bender.cfg. It was necessary to hard code somelibraries in this file, as I could not figure out how to make theautomatic scripts link against the correct libraries. There is ahardcoded path to your gcclib directory which it may be necessaryto change.Configure is excluded from CVS depository. In order to build orrebuild it you will need:autoconf v2.12 or laterautomake v1.4 or laterTo build configure run bootstrap script in top rtems directory bytyping./bootstrapIf you wish to rebuild existing configure scripts type./bootstrap -c./bootstrapThen create an or1k directory under the main rtems directory,cd into this directory, and type../configure --target=or1k --program-prefix=<your-or1k-prefix>Where "<your-or1k-prefix>" represents the prefix you have assignedto 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 supportpackage and the example tests.If you don't happen to have a board available for this CPU, youcan run this against the architectural or1k simulator. There areseveral ways to do this. The one which I have found most helpfulfor debugging is to use it in gdb mode.First, you'll need a console. The or1k simulator is currentlyconfigured 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 intoFIFOs. Do this by running the command:mkfifo /tmp/uart0.txmkfifo /tmp/uart0.rxYou can now create an input and an output stream which you can seeby opening 2 windows. In the first window, type:cat > /tmp/uart0.rxIn the other window, type:cat < /tmp/uart0.txThe "rx" window is where you will type, and the "tx" window willprint messages.Next, start up the simulator by typing "sim -srv 7777". This assumesor1ksim is in your path and that you want to start the gdb server onport 7777.You are now ready to load the code and run. To do this, type:cd rtems-4.5.0/or1k<your-or1k-prefix>gdb bender/samples/hello.exeAgain, substitute your actual prefix for "<your-or1k-prefix>". In mycase, this is "or32-rtems-". A log of this session is shown below. Abreakpoint has been placed on the exit function so that you can seethe exit code. Note that if you don't do this, there is no way toautomatically stop the process. It will simply appear to hang, andgdb will never return.flex% or32-rtems-gdb bender/samples/hello.exeGNU gdb 5.0Copyright 2000 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome 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:7777Remote or1k debugging using jtag://localhost:77770x0 in text_start ()(gdb) load bender/samples/hello.exeLoading section .text, size 0x30130 lma 0x0Loading section .data, size 0x1cc4 lma 0x30130Start address 0x2000 , load size 204276Transfer rate: 1634208 bits/sec, 510 bytes/write.(gdb) b exitBreakpoint 1 at 0x24444: file exit.c, line 65.(gdb) runStarting program: /home/opencores/2008/rtems-4.5.0/or1k/bender/samples/hello.exeBreakpoint 1, exit (code=0) at exit.c:6565 exit.c: No such file or directory.(or1k) quitflex%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 onthe Or1k simulator! You can now write your own RTEMS code andrun it in the same way.If you want, you can follow the same procedure to run theregression test. This is found in the directoryor1k/bender/tests/base_sp.exe. Use the above instructions,and replace bender/tests/base_sp.exe everywhere you seebender/samples/hello.exe. It will test a large portionof the RTEMS functionality. You should see the followingafter executing this:----*** SAMPLE SINGLE PROCESSOR APPLICATION ***Creating and starting an application taskApplication 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'snow up to you to start having fun with RTEMS. Good luck....Chris Ziomkowskichris@asics.ws
Go to most recent revision | Compare with Previous | Blame | View Log
