public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: RTEMS Q.
@ 1998-07-03 12:21 Geoffroy Montel
  1998-07-08  7:59 ` Joel Sherrill
  0 siblings, 1 reply; 6+ messages in thread
From: Geoffroy Montel @ 1998-07-03 12:21 UTC (permalink / raw)
  To: tomaz.stih, egcs, rtems-list

Hi,

> I am new to RTEMS and I have several questions about it.
Welcome!

> 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.
 
> As you might know m68k boards (without using VBR) have
> vector table and first entry in the table is SSP and second is
> RESET vector thus I was looking for code that would be
> compiled to address 0x00000000 and would contain
> vector table. But all I could find was crt0 in newlib and
> start.s (I think) in RTEMS which contain startup code
> and entry point but no vector table.
> 
> I also looked through several BSPs with no success.
> 
> My questions are :
> 
> - does linker produce appropriate RTEMS vector table
> and jumps to entry point without my intervention,
> does this depends on file format produced?
The linkcmds (a script file passed to the linker) has to reserve some
room in your .bss section for the vector table. You can find the
linkcmds
in the BSP
Then the board initialisation code will assign the VBR register to 
the start of the vector table in RAM.
To put the vector table in 0x0, you just have to tell the linker, with
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

> - 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

> - 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

> - 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

> - 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

> - How do I tell RTEMS to use Cygnus Newlib library
> and header files instead of my linux ones?
RTEMS 4.0 uses Cygnus Newlib :)

> - 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

> - 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

Hope it helps, check the GNU LD documentation for more details about 
linkcmds syntax.

Best regards,

Geoffroy

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: RTEMS Q.
@ 1998-07-09 22:28 Tomaz Stih
  1998-07-10  6:04 ` Andreas Schwab
  1998-07-10  8:14 ` Joel Sherrill
  0 siblings, 2 replies; 6+ messages in thread
From: Tomaz Stih @ 1998-07-09 22:28 UTC (permalink / raw)
  To: 'egcs@cygnus.com'

>    I am using a linux-i586 host to produce code for a
>mvme135 which is an embedded mc68020 computer. I use the
>prom monitor to download the code. 

What is a prom monitor? My problem is that when I write an asm
program like :

	move.l #10,d0
	move.l d0,d1

it linkes not into few bytes but (with stripped option on) into 30Kb 
of code regardless of me using coff, ihex, bin or whatever format.

How do I tell GNU asm and linker to produce pure binary that I can
burn into eprom.

>    My first address is 0x4000 (due to monitor). In this address
>RTEMS put a NOP and a JUMP start_address. So you have almost a
>proper reset vector: you must change NOP and JUMP op. code by your
>SSP.

I thought so but I am still not sure if I understand this.
RTEMS starts with something like:

SYM(start):
SYM(M68kVec):
	NOP
	JUMP start_around
	DC.B 4088 /* space for vectors */
	...

If I understand this then RTEMS is not written to start in pure
68000 environment. Instead in my code I should first 
set the vector table to jump to my program and then jump to 
start of RTEMS.
Is this correct?

Is there anywhere well written documentation for GNU Assembler
for motorola (and for other platforms) avaliable (the asm syntax, tutorial
diffrent from GNU AS which describes the usage of assembler application) 
I know motorola from ATARI ST and it had different assembler syntax.

Regards,
Tomaz


^ permalink raw reply	[flat|nested] 6+ messages in thread
* RTEMS Q.
@ 1998-07-03 12:21 Tomaz Stih
  0 siblings, 0 replies; 6+ messages in thread
From: Tomaz Stih @ 1998-07-03 12:21 UTC (permalink / raw)
  To: 'egcs@cygnus.com', 'rtems-list@advicom.net'

I am new to RTEMS and I have several questions about it.

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.

As you might know m68k boards (without using VBR) have
vector table and first entry in the table is SSP and second is
RESET vector thus I was looking for code that would be
compiled to address 0x00000000 and would contain
vector table. But all I could find was crt0 in newlib and
start.s (I think) in RTEMS which contain startup code
and entry point but no vector table.

I also looked through several BSPs with no success.

My questions are :

- does linker produce appropriate RTEMS vector table
and jumps to entry point without my intervention,
does this depends on file format produced?

- 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?

- 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?

- i am using original gcc and have problems with
ctype.h and stdio.h, are there any problems if I 
use egcs instead?

- 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).

- How do I tell RTEMS to use Cygnus Newlib library
and header files instead of my linux ones?

- Does RTEMS come with its own little libc
(I saw some .c files) there or are those files just
wrappers to libc or newlib?

- 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.

Regards,
Tomaz


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1998-07-10  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-03 12:21 RTEMS Q Geoffroy Montel
1998-07-08  7:59 ` Joel Sherrill
  -- strict thread matches above, loose matches on Subject: below --
1998-07-09 22:28 Tomaz Stih
1998-07-10  6:04 ` Andreas Schwab
1998-07-10  8:14 ` Joel Sherrill
1998-07-03 12:21 Tomaz Stih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).