|Re: [pok-devel] Start a guest binary in a partition|
[ Thread Index |
| More lists.tuxfamily.org/pok-devel Archives
- To: pok-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [pok-devel] Start a guest binary in a partition
- From: Joel Sherrill <joel.sherrill@xxxxxxxxx>
- Date: Fri, 3 May 2013 09:29:53 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=sm4oix8wh/68COPpfj8upuN6ZjmfRDmUs7XL4jyJhaw=; b=pJlQmq4Awt0DkLI3CY9Dx5onk0NOzBBc/WyS/kgSC557RPX+WA9S3b7tsJfkb6h5eQ qRcdfZHITjbY67eLoq7oAIehayuqUE1gYp92ll4Ei3fN3Ym2ivt6yz2VbW4Uro/9xjVz PLZ6O0X2CYcllLgVNDSu/M4dBSzGnvGKoL0LJEehnuAHf+krd+KIhviqfCt8s7gr1sIC tFg2uEs//ALfH/ee/HFanyrrFmF1BtdM6HCoSDbSyVH3Dh13k83fjSjk6cFUn/xS+lbf N9wmMbHJAwj7uLRCoIHYQEn4ytwBh4xkXmURxeF0RlZ4zU38Bi6rTdfXKUCUcaLsP2Kz JPKA==
Others hopefully will have more Pok specific advice.
First do an objdump on the RTEMS executable and see if it
is the appropriate physical memory in the final merged
Pok/RTEMS executable. Use physical addresses for this.
If the memory image looks ok, you may be able to use
the symbol-file command (I think that's it) in gdb to load
symbols from the RTEMS executable.
If the RTEMS executable was converted to binary, all
symbolic information was lost and that will let gdb retrieve it.
Or it could just be lost in the "insertion into Pok"
On Fri, May 3, 2013 at 5:17 AM, Philipp Eppelt <philipp.eppelt@xxxxxxxxxxxxxxxxxxxxx>
I tried to inject an RTEMS binary into POK.
By modifying the generated-code/cpu/Makefile to use hello.exe (RTEMS) as partition binary instead of part1/part1.elf and I introduced a makefile rule just depending on $(TARGET), so the partitions and kernel aren't rebuild.
partitions.bin -> nm shows the RTEMS symbols
sizes.c -> contains the size of hello.exe
make run spins in a reload cycle.
However, I did at least expect the binary to be loaded, but I didn't manage to confirm this with make run-gdb. It behaves strange, as breakpoints are accepted but the execution won't stop at the defined breakpoint. Sometimes it does after various tries and symbol-file switches.
Do you have some recommendations to solve this gdb issue?
Or an idea how I can confirm the successful loading of the hello.exe binary?
On 05/02/2013 07:39 PM, Philipp Eppelt wrote:
I am a student at Dresden University of Technology, currently applying
to Google Summer of Code for the RTEMS project.
The purpose of my project is to design and implement a
paravirtualization layer in RTEMS to ease virtualization. As
proof-of-concept I like to use POK as host system.
In last year's GSoC a student used POK to run RTEMS with the goal to get
RTEMS ARINC 653 compliant.
He introduced new syscalls to POK and combined the RTEMS partly linked
..ralf file with the POK binary. He used cat to pipe both binaries into
the same file and used some 'magic' to fuse the two systems.
However, none of the usual tools (nm, readelf, objdump) read the
resulting binary correctly, therefore I refrain from taking this way.
Additionally, I don't want to use direct syscalls from the guest, as the
virtualization layer in RTEMS should be portable.
Now I am searching for a way to start the RTEMS guest binary.
My first idea was to build an application in POK containing all 'guest
communication functions' (e.g. disable/enable interrupts, console
access) and to pass the fully linked file as a library to RTEMS. Then
the RTEMS build process would run without errors, as the missing
function implementations are provided.
But I don't know, how I can call the RTEMS bsp_start() function for
instance, as POK doesn't know about this at compile time.
The second idea was to build RTEMS first. This will fail due to
undefined references cause by the 'communication functions'. The partly
linked .ralf file could then be inserted while POK is linked, resolving
the undefined references. This is pretty much the approach of last
year's student. But that would intercept with the build process of POK
and is therefore no satisfying approach. An custom linker script might
resolve the issues with the tools, though.
So I am a little stuck here and seeking guidance.
Do you have another idea?
Is there some source code supporting foreign binaries to be executed in
Do you know of projects doing something similar?