<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 8, 2020 at 11:10 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Aug 8, 2020 at 11:08 AM Mritunjay Sharma<br>
<<a href="mailto:mritunjaysharma394@gmail.com" target="_blank">mritunjaysharma394@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Sat, Aug 8, 2020 at 9:46 PM Heinz Junkes <<a href="mailto:junkes@fhi-berlin.mpg.de" target="_blank">junkes@fhi-berlin.mpg.de</a>> wrote:<br>
>><br>
>> Hallo Mritunjay,<br>
>> everything looks pretty good. I'm commenting on the text. I also send this mail<br>
>> to two EPICS experts (Andrew Johnson and Michael Davidsaver). Maybe they also have some ideas.<br>
><br>
><br>
> Thank you so much Heinz! It will be really a great help!<br>
>><br>
>><br>
>><br>
>> ><br>
>> > Current Status:<br>
>> ><br>
>> > 1) Successfully built EPICS7 with RTEMS5 by hand for pc-386<br>
>> > 2) Worked for RSB recipe.<br>
>> > In its due process, I Wrote:<br>
>> > i) rsb/rtems/config/epics/epics-7-1.cfg<br>
>> > ii)rsb/rtems/config/epics/epics-base.bset<br>
>> > iii)rsb/source-builder/config/epics-7-1.cfg<br>
>> > 3) Added Patch for RTEMS-pc-386 support which made the above recipe work successfully.<br>
>> > 4) Therefore, Successully built EPICS7 with RTEMS5 by using RSB recipe as well for pc-386 as of now.<br>
>> > 5) Sent 4 Patches for review of the same.<br>
>> ><br>
>> > What problems are in the next steps?<br>
>> ><br>
>> > 1) How to make it work across different architectures?<br>
>> > 2) Exisiting EPICS works on the old legacy network stack.<br>
>> > 3) I am not using EPICS upstream branch. It is being built<br>
>> > by Heinz's epics playground.<br>
>> > 4) Doubts in how to start with testing.<br>
>> ><br>
>> > My Resarch work for the Problem no: 1<br>
>> ><br>
>> > I have gone through the EPICS developer guide from here<br>
>> > exhaustively in the past couple of day and here are few interesting things<br>
>> > that I found which can help:<br>
>> ><br>
>> > 1) "The main ingredients of the build system are:<br>
>> > • A set of configuration files and tools provided in the EPICS base/configure directory<br>
>> > • A corresponding set of configuration files in the <top>/configure directory of a non-base <top> directory<br>
>> > structure to be built. The makeBaseApp.pl and makeBaseExt.pl scripts create these configuration files. Many of<br>
>> > these files just include a file of the same name from the base/configure directory.<br>
>> > • Makefiles in each directory of the <top> directory structure to be built<br>
>> > • User created configuration files in build created $(INSTALL_LOCATION)/cfg directories.<br>
>> > "<br>
>> ><br>
>> > Remarks: Now since it is also mentioned in the guide that "makeBaseApp.pl<br>
>> > creates directories and then copies template files into the newly created directories<br>
>> > while expanding macros in the template files. EPICS base provides two sets of template files: simple and example."<br>
>> > Can we think of using makeBaseApp.pl to that end? Making the user allow<br>
>> > to change the configurations from the terminal?<br>
>><br>
>> I don't think that makeBaseApp.pl will help you. This is intended to build an example IOC. It takes the settings from the above mentioned configuration files.<br>
>><br>
>> You "only" need to specify the location of the RTEMS installation in configure/os/CONFIG_SITE.Common.RTEMS.<br>
>> RTEMS_VERSION =<br>
>> RTEMS_BASE =<br>
>><br>
>> Then you have to define the target in configure/CONFIG_SITE:<br>
>> ...<br>
>> # Which target architectures to cross-compile for.<br>
>> # Definitions in configure/os/CONFIG_SITE.<host>.Common<br>
>> # may override this setting.<br>
>> CROSS_COMPILER_TARGET_ARCHS=<br>
>> …<br>
>> e.g. “CROSS_COMPILER_TARGET_ARCHS=RTEMS-xilinx_zynq_a9_qemu"<br>
>><br>
>> And for each target there must be a file in configure/os:<br>
>> e.g. CONFIG_Common.RTEMS-xilinx_zynq_a9_qemu<br>
>> If it is not provided by EPICS, the RSB should install it there (adapted to the target to be used by epics make).<br>
><br>
<br>
Probably they should be provided by EPICS for known-to-work<br>
configurations. If they are not, we should push upstream.<br>
<br>
><br>
> Yes, Heinz. I followed the above steps and created a patch which I applied in the configuration files of RSB recipe.<br>
> The problem with it is that it's made only for pc-386 and I have to hardcode there about location of the RTEMS installation in<br>
> configure/os/CONFIG_SITE.Common.RTEMS. My doubt is how to modify the patch that can it offer user-specific location of the RTEMS<br>
> installation and bsp?<br>
>><br>
<br>
I still think this should be done through some kind of pre-processing<br>
(scripting) over these configuration files for a given target, using<br>
some fixed pattern, rather than by patching. A patch is fine for<br>
proof-of-concept, but I don't think we want to have x patches for x<br>
BSP targets of EPICS. Maybe it is fine, there aren't that many BSP<br>
targets right now, but I can see this kind of patch-based<br>
configuration getting a little unwieldy.<br>
<br>
If you proceed with the patch-based approach, you need to figure out<br>
how to pick the right patch to apply based on the target/bsp build. So<br>
that would be your next step. Create a patch for the zynq, and see if<br>
you can dynamically determine which one to apply (zynq or pc386) based<br>
on RSB internal state/variables.<br>
<br></blockquote><div>Thank you for the suggestions. I will start working on creating the patch for zynq and will see if </div><div>something can be done to dynamically determine them. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>><br>
>> ><br>
>> > 2) "The startup directory in EPICS base contains a perl script, EpicsHostArch.pl, which can be used to define<br>
>> > EPICS_HOST_ARCH. This script can be invoked with a command line parameter defining the alternate compiler (e.g.<br>
>> > if invoking EpicsHostArch.pl yields solaris-sparc, then invoking EpicsHostArch.pl gnu will yield<br>
>> > solaris-sparc-gnu).<br>
>> > The startup directory also contains scripts to help users set the path and other environment variables”<br>
>> This has nothing to do with 2)<br>
><br>
><br>
> I am sorry for the misunderstanding. All the 4 points mentioned here are my observations only for the Problem No.1<br>
> `1) How to make it work across different architectures?`<br>
>><br>
>><br>
>> There's no need to adjust anything here. The EPICS make recognizes the architecture on which it is started.<br>
>><br>
>> > Remarks: As EPICS_HOST_ARCH, can we do something similar for CROSS_COMPILER_TARGET_ARCHS?<br>
>> ><br>
>> > 3) ") The following is a summary of targets that can be specified for gnumake:<br>
>> > • <action><br>
>> > • <arch><br>
>> > • <action>.<arch><br>
>> > • <dir><br>
>> > • <dir>.<action><br>
>> > • <dir>.<arch><br>
>> > • <dir>.<action>.<arch><br>
>> > where:<br>
>> > <arch> is an architecture such as solaris-sparc, vxWorks-68040, win32-x86, etc.<br>
>> > <action> is help, clean, realclean, distclean, inc, install, build, rebuild, buildInstall, realuninstall, or uninstall"<br>
>> ><br>
>> > Remarks: Now similar to the above stated, can we work for Cross Compiler target Architecture?<br>
>> ><br>
>><br>
>> But this does not refer to 3) ?<br>
><br>
><br>
> No no, this remark is also for the problem 1 only as told above. Slight misunderstanding here :)<br>
>><br>
>><br>
>><br>
>><br>
>> 3) You have to take "my" repo at the moment, because the adaptations to RTEMS5 are not yet included in the official epics-base. This is a hen-and-egg problem because RTEMS is only now in the release phase, so my changes have not been implemented yet.<br>
><br>
><br>
> Ok, I hope Dr. Gedare and Chris can help you with that.<br>
<br>
We just need to be ready for when RTEMS 5.1 is officially released.<br>
Hopefully soon, but I don't have a timeline. Releases are mostly<br>
volunteer time, so they happen when they happen. We're trying to get<br>
better about that, but it is hard (due to lack of incentives).<br>
<br></blockquote><div>I think that makes it clear, Heinz. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>><br>
>><br>
>> 2) I'm just about to figure out in the Epics Makefiles whether the target was built with the legacy-stack or libbsd-stack. It's working already.<br>
>> Now I also have to adjust the rtems_init.c accordingly. Here I have to clean up a little bit. But I hope to have this finished by the middle of the week.<br>
><br>
><br>
> Thank you so much for the update!<br>
><br>
> So I would like to ask my other mentors - what can I do for the time being? What should be the next steps for this week?<br>
<br>
Prepare the zynq patch and try to work out the logic of how to select<br>
the right patch to apply.<br>
<br>
Then similar logic might be usable to script the configuration changes<br>
of EPICS so we don't need patches.<br>
<br></blockquote><div>Sure, I will do and update soon. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> And yes how to begin the testing part?<br>
<br>
This was suggested by Heinz earlier to look at the CI test scripts<br>
that EPICS maintainers use.<br></blockquote><div><br></div><div>Yes, it slipped out of my mind. Will check and revert. </div><div><br></div><div>Thanks</div><div>Mritunjay Sharma</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> I have tried to find some resources but I think it will be<br>
> better if you can help somewhere to look at.<br>
><br>
> Thanks<br>
> Mritunjay Sharma<br>
>><br>
>><br>
>> > These were the little doubts that originated from the research work I did.<br>
>> > I will like the opinion of mentors that what can be the optimal way now to approach the<br>
>> > project after this? What can be some resources for better research work of the<br>
>> > above problems?<br>
>> ><br>
>> > Also, for the reference:<br>
>> > Link to the changes in commits of rsb can be found here: <a href="https://github.com/RTEMS/rtems-source-builder/compare/master...mritunjaysharma394:epics-support" rel="noreferrer" target="_blank">https://github.com/RTEMS/rtems-source-builder/compare/master...mritunjaysharma394:epics-support</a><br>
>> ><br>
>> > The patch for epics can be found here: <a href="https://github.com/mritunjaysharma394/epics-mritunjay/tree/master/patches" rel="noreferrer" target="_blank">https://github.com/mritunjaysharma394/epics-mritunjay/tree/master/patches</a><br>
>> ><br>
>> ><br>
>> > Thanks<br>
>> > Mritunjay Sharma<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> Heinz<br>
</blockquote></div></div>