<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi Chris,</div><div>thanks for you reply. I'm trying to understand the concept here, and some points are still confusing me. </div><div>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?</div><div>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? </div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div><font color="#0000ff">Best wishes,</font></div><div><font color="#0000ff">Tim Tian</font></div><div><font color="#0000ff">xuelin.tian@qkmtech.com</font></div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:chrisj@rtems.org">Chris Johns</a></div><div><b>Date:</b> 2016-08-23 08:37</div><div><b>To:</b> <a href="mailto:users@rtems.org">users</a></div><div><b>Subject:</b> Re: Simple question about RTL</div></div></div><div><div>On 19/08/2016 16:39, xuelin.tian@qkmtech.com wrote:</div>
<div>> I have a simple question about RTEMS dynamic loading. I have set up my</div>
<div>> shell via serial port, and it works well. As my system (base kernel) is</div>
<div>> running, how can I load my application (like, ***.tar) into my target?</div>
<div> </div>
<div>For testing and playing around the RTL shell commands are the simplest. </div>
<div>Your target needs to be able to read the code some way.</div>
<div> </div>
<div>For real applications there are a few parts to the problem you need to </div>
<div>solve:</div>
<div> </div>
<div> 1. Loading symbols.</div>
<div> 2. Target access to the code to load.</div>
<div> 3. Code in the base image to load the code.</div>
<div> </div>
<div>These are system level issues and vary based on a your system </div>
<div>requirements and the target hardware.</div>
<div> </div>
<div>For symbol loading you can either perform a two pass linking process and </div>
<div>embed the symbols in the base image. The first link pass creates an </div>
<div>image that can be used to obtain the list of symbols in the base and the </div>
<div>second pass links a generated file containing those symbols resolving </div>
<div>them to the final address map. The second method for symbols is to </div>
<div>create an external object file of the symbols from the base image you </div>
<div>load dynamically. This approach means you have suitable target storage </div>
<div>to hold this file, eg a JFFS2 file system.</div>
<div> </div>
<div>Target access to the code means you have some storage on the target you </div>
<div>can write the code into. You could also have a reliable network, ie an </div>
<div>engineered network, to download the code at start up. What you can do </div>
<div>and how it works is very target and system dependent. RTEMS has a wide </div>
<div>range of file systems, media and network transfer methods to help.</div>
<div> </div>
<div>You need some code in the base image to manage the loading of your code. </div>
<div>There is a shell command or you can write code to make dlopen calls. You </div>
<div>may also want to package the code before placing it on the target. For </div>
<div>example you may have a few files in your application, the symbols, a </div>
<div>root module and then other modules. By packaging I mean you may create a </div>
<div>gz compressed tar file on the host and you add code to the vase image to </div>
<div>decompress and unpack the tar file before loading. The tar file could </div>
<div>also be encrypted depending on your requirements.</div>
<div> </div>
<div>Chris</div>
<div>_______________________________________________</div>
<div>users mailing list</div>
<div>users@rtems.org</div>
<div>http://lists.rtems.org/mailman/listinfo/users</div>
</div></blockquote>
</body></html>