qemu-leon2 was Re: Converting RTEMS ELF files into Linux boot image format

Joel Sherrill joel.sherrill at OARcorp.com
Tue Sep 8 21:34:35 UTC 2009


Jérôme Hugues wrote:
> Hi,
>
> Le 4 sept. 09 à 16:39, Joel Sherrill a écrit :
>
>   
>> I was looking again at running some RTEMS BSPs
>> on qemu.  In particular, the mcf5206elite and
>> leon2 should run on qemu.  BUT.. qemu is setup
>> to boot Linux.
>> Does someone out there have any thoughts on how
>> to convert an RTEMS ELF into something it would
>> be willing/able to boot?
>>     
>
> I don't think QEmu supports leon2 already.
>
> The Couverture project added support for leon2 in a separate patch,  
> but I don't think it is merged to trunk
> see http://forge.open-do.org/projects/couverture/
>
> patch is there http://forge.open-do.org/scm/viewvc.php/trunk/couverture/tools/?root=couverture
> (note the patch adds at697 as a machine for QEmu. It is for the Atmel  
> AT697 board, based on a leon2 chip see
> 	http://www.atmel.com/dyn/products/product_card.asp?part_id=3178)
> I could get an application running with it with the following line:
>
> ./qemu-system-sparc -nographic -M at697 -kernel <my_app>
> I could get one application running using a gnat compiler for leon,  
> but not using RTEMS 4.8 :(
>   
Thank you.  The CVS head gives this:

$ ./install/bin//qemu-system-sparc -nographic -M at697 -kernel 
sparc-leon2-ticker.ralf
Leon: read unknown register 0x0014
bootcard: Work space too big for work area! (0x00000000 > 0x00000000)
qemu: fatal: Trap 0x80 while interrupts disabled, Error state
pc: 40002020  npc: 40002024
General Registers:

This is a VERY VERY good sign believe it or not.  The line starting
"bootcard:..." is printed by the BSP.  That means the BSP's serial
IO is working!!!

It looks like the BSP is assuming grmon is the only way it gets started.
grmon sets rdb_start with the size of RAM and I am guessing we
see it as 0 when on qemu.

This is VERY VERY close to working.  Anyone up for the challenge?


> Perhaps the patch mentioned below will provide some guidance.
> Note that couverture also has an example with a bareboard ppc and a  
> bareboard leon (no kernel at all, not even the gnat runtime)
> perhaps this will provide an entrypoint. (in the tools/xcov/examples  
> directory)
> Hope this helps
> Note I work on the Couverture project, but I'm not directly involved  
> in the qemu part of this project.


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list