This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RTEMS Q.
- To: Geoffroy Montel <g_montel at yahoo dot com>
- Subject: Re: RTEMS Q.
- From: Joel Sherrill <joel at OARcorp dot com>
- Date: Tue, 7 Jul 1998 11:20:21 -0500 (CDT)
- cc: tomaz dot stih at triglif dot com, egcs at cygnus dot com, rtems-list at advicom dot net
On Fri, 3 Jul 1998, Geoffroy Montel wrote:
> > I am new to RTEMS and I have several questions about it.
> Welcome!
It is a growing world. :)
> > I am using my linux-i586 to produce code for m68k which
> > will run on embedded 68008 board. I went through asm
> > code step by step to find out where RTEMS starts.
AFAIK RTEMS has never been run on a 68008. You might want to look at the
definitions in score/cpu/m68k/m68k.h to see that they are OK.
> the linkcmds, that the RAM begins at address 0x0, and that the VBR is
> the first thing you'll find in RAM.
> I don't know if it depends on the file format produced, I don't think so
> At least it should work even for coff or a.out format
Most of the BSPs for 683xx systems include this type of setup.
> > - i would like to produce code that would have
> > .text and .data in ROM and .bss in RAM, how do I
> > produce pure binary code for my ROM that I can simply
> > burn to EPROM and what is common practise to do
> > this in embedded systems?
> You have to use the linkcmds again :)
> You can tell the linker where the different sections should go
> For instance,
> 1. you put the RAM in 0x0
> 2. you put the ROM in 0x10000000
> and then you assign CS0 to 0x0 (if CS0 controls the RAM chip) and CS1
> to 0x10000000 (if CS1 controls the ROM chip) in the board
> initialisation code
The linker scripts are fairly complex beasts to master. The people on the
crossgcc@cygnus.com mailing list have a lot of experience with them.
> > - after I (that'll be tha day) successfuly compile RTEMS what
> > form does it takes? Is it a library that I simply link with my
> > projects or what? Which are the files that I receive as
> > results?
> RTEMS consists of a library you link with your program. The resulting
> form
> is an executable which format is the one you specified in the linkcmds
Yep.
> > - i am using original gcc and have problems with
> > ctype.h and stdio.h, are there any problems if I
> > use egcs instead?
> No problem, the very-soon-to-be-released version of RTEMS needs egcs
But still uses gcc2 source for GNAT/RTEMS so it should work OK.
> > - I tried to compile RTEMS 3.6.0 unix (linux) emulator
> > and almost succed, there were some problems with
> > conflicting definitions for __open and __seek inside
> > my system defined fcntl.h and RTEMS libio.h which
> > I solved using conditional compilation but still
> > the compilation ends because of libc problems
> > (RTEMS cannot find initialization routine for libc).
> Wait for the newest version or ask joel@oarcorp.com
The 3.6.0 linux port was done to a very old linux version. Unfortunately,
the internal names in the linux libc conflicting with some of the ones we
used for out libc support code (reentrant malloc, etc.). There is a patch
for 3.6.0 specifically to fix this problem in the directory
/oarcorp/pub/rtems/3.6.0-patches on ftp.oarcorp.com. It changes some
symbol names in the libc support and the linux bsp. It does not make the
same change to every BSP.
> > - How do I tell RTEMS to use Cygnus Newlib library
> > and header files instead of my linux ones?
> RTEMS 4.0 uses Cygnus Newlib :)
On embedded targets, RTEMS uses newlib and has done so since at least
version 3.2.1 :)
> > - Does RTEMS come with its own little libc
> > (I saw some .c files) there or are those files just
> > wrappers to libc or newlib?
> No, it just patches Cygnus Newlib
Patches is a bit understating it. Actually libc contains a few things:
+ replacement routines like the RTEMS malloc family
+ the glue between newlib and the BSP for IO
+ RTEMS specific implementations of things like gettimeofday
> > - Are there simpler packs for specific platforms
> > avaliable? I would kill for motorola 68k dev tools
> > binaries and compiled main (not BSP dependent)
> > RTEMS parts with GNU debugger support.
> dunno
At various times, there have been prebuilt m68k toolsets for some hosts.
Believe it or not, it is not that hard to build a cross toolset. The
upcoming RTEMS release includes very detailed instructions and a script
which does most of the work for you.
Geoffroy has put a lot of work into making sure this works on Cygwin as
well.
> Hope it helps, check the GNU LD documentation for more details about
> linkcmds syntax.
I found that examples of other linker scripts were quite helpful as well.
--joel