Simple question about RTL

xuelin.tian at qkmtech.com xuelin.tian at qkmtech.com
Thu Aug 25 03:02:24 UTC 2016


Hi Chris,
thanks for you reply. I'm trying to understand the concept here, and some points are still confusing me. 
In general, linking process should happen before applications taking control of CPU, which means the OS should handle the linking process. In RTEMS, the Init task should take care of this, am I right?
Now, for example, I have one base kernel and one tar file. My base kernel is running on my target (ZedBoard), and how can I load the tar file into memory using shell command via Jtag? 



Best wishes,
Tim Tian
xuelin.tian at qkmtech.com
 
From: Chris Johns
Date: 2016-08-23 08:37
To: users
Subject: Re: Simple question about RTL
On 19/08/2016 16:39, xuelin.tian at qkmtech.com wrote:
> I have a simple question about RTEMS dynamic loading. I have set up my
> shell via serial port, and it works well. As my system (base kernel) is
> running, how can I load my application (like, ***.tar) into my target?
 
For testing and playing around the RTL shell commands are the simplest. 
Your target needs to be able to read the code some way.
 
For real applications there are a few parts to the problem you need to 
solve:
 
  1. Loading symbols.
  2. Target access to the code to load.
  3. Code in the base image to load the code.
 
These are system level issues and vary based on a your system 
requirements and the target hardware.
 
For symbol loading you can either perform a two pass linking process and 
embed the symbols in the base image. The first link pass creates an 
image that can be used to obtain the list of symbols in the base and the 
second pass links a generated file containing those symbols resolving 
them to the final address map. The second method for symbols is to 
create an external object file of the symbols from the base image you 
load dynamically. This approach means you have suitable target storage 
to hold this file, eg a JFFS2 file system.
 
Target access to the code means you have some storage on the target you 
can write the code into. You could also have a reliable network, ie an 
engineered network, to download the code at start up. What you can do 
and how it works is very target and system dependent. RTEMS has a wide 
range of file systems, media and network transfer methods to help.
 
You need some code in the base image to manage the loading of your code. 
There is a shell command or you can write code to make dlopen calls. You 
may also want to package the code before placing it on the target. For 
example you may have a few files in your application, the symbols, a 
root module and then other modules. By packaging I mean you may create a 
gz compressed tar file on the host and you add code to the vase image to 
decompress and unpack the tar file before loading. The tar file could 
also be encrypted depending on your requirements.
 
Chris
_______________________________________________
users mailing list
users at rtems.org
http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160825/b29e1f87/attachment-0002.html>


More information about the users mailing list