<div dir="ltr">Hello Gedare,<div><br></div><div>alas, given that I believe in all the infrastructure with how things boot well for our existing 4.9 setup, I couldn't get much conclusive clue on how to coax the startup script be found and run for the new assembly. I recall my last attempt was to giving it a shot with 4.12 instead, at which point I ran into some sources not being available where they should be, and diving into that...</div><div><br></div><div>Indeed thanks to Heinz for his input, he was working on putting cexp/gesys in <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rtemsInit - I wonder how it turned out. Also, perhaps someone has a procedure for RTEMS+Cexp+GeSys on 4.12? Or, well, 4.10? It shouldn't be too much of a rocket science I presume, but when rtems-source-builder fails to download something and I have to fix location, or for whatever reason a dependency version ends up being odd which results in an error much later in the process... if only there was a comprehensive procedure. I tried to make my process as detailed as possible, but it didn't just work when trying same steps for 4.12.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Anton.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 4, 2018 at 10:38 AM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry, I just found that Heinz actually also replied to this back in<br>
december, but in the digest form. :) **slowly working my way through<br>
email backlog for spring semester /sigh/*<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, May 4, 2018 at 10:36 AM, Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br>
> Hello Anton,<br>
><br>
> On Wed, Dec 13, 2017 at 9:13 PM, Anton Derbenev <<a href="mailto:aaderbenev@gmail.com">aaderbenev@gmail.com</a>> wrote:<br>
>> Hello all,<br>
>><br>
>> at NSLS-II, we have several dozen MVME3100 VME crates running RTEMS with<br>
>> EPICS driver for various diagnostics and MRF timing hardware. The entire<br>
>> setup was handily created quite some time ago by combining RTEMS 4.9 with<br>
>> Cexp and GeSys to provide convenient booting and debugging capabilities. As<br>
>> an effort to make the setup more up-to-date, I made an attempt to compose a<br>
>> how-to which would describe how to successfully compile a bootable<br>
>> RTEMS+Cexp+GeSys image. A nice "bonus" would be if that image also worked<br>
>> when being run on a crate.<br>
>><br>
>> It is not my first attempt as I already tried to do a similar thing for<br>
>> RTEMS 4.10. While in both cases I found lots of work being put by the<br>
>> community in helpful toolsets and documentation, the building process was<br>
>> not as straightforward as one would imagine by reading the QuickStart guide.<br>
>> There are many stumbles which, while probably being primitive in most cases,<br>
>> could be annoying to a user who lacks core developer knowledge and<br>
>> perspective. Some things can be mentioned _somewhere_ and can only be found<br>
>> quickly by google-fu and/or luck.<br>
>><br>
>> This time I reached for RTEMS 5 right away. Results which I achieved are<br>
>> very similar to those which I had for RTEMS 4.10 - I can create a bootable<br>
>> image which appears to have working GeSys and Cexp shell, but access to<br>
>> "st.sys" fails along with other suspicious symptoms.<br>
>><br>
>> Below is my "how-to" process which yields a bootable "rtems.ralf" file, and<br>
>> results for our test MVME3100 system boot procedure. Some points highlighted<br>
>> will probably be useful for further users' reference, and some of them come<br>
>> from earlier conversations on the mailing list. My hope is that someone<br>
>> knowledgeable will kindly review my steps and give some hint why the image<br>
>> fails to work as expected. Perhaps it would be great to have a step-by-step<br>
>> how-to as a part of documentation somewhere.<br>
>><br>
>> ====================<br>
>> RTEMS 5 + Cexp + GeSys How-To<br>
>><br>
>> 1. Get RTEMS source builder (rsb). As a part of its configuration, rsb will<br>
>> try to fetch various sources from multiple locations. If rsb is being<br>
>> configured in a protected environment (e.g. http proxy, firewalls, etc.),<br>
>> source locations can be unavailable. Get rsb sources on a machine which can<br>
>> freely download from <a href="http://git.rtems.org" rel="noreferrer" target="_blank">git.rtems.org</a>, <a href="http://github.com" rel="noreferrer" target="_blank">github.com</a> etc. with both http(s) and<br>
>> git protocol:<br>
>><br>
>> $ mkdir --parents ~/src/RTEMS<br>
>> $ cd ~/src/RTEMS<br>
>> $ git clone <a href="http://github.com/RTEMS/rtems-source-builder.git" rel="noreferrer" target="_blank">http://github.com/RTEMS/rtems-<wbr>source-builder.git</a> rsb<br>
>> $ cd rsb/rtems<br>
>><br>
>> Perform dry configuration and only download sources, as suggested here:<br>
>><br>
>> <a href="https://lists.rtems.org/pipermail/users/2017-September/031647.html" rel="noreferrer" target="_blank">https://lists.rtems.org/<wbr>pipermail/users/2017-<wbr>September/031647.html</a><br>
>><br>
>> Choose profile as appropriate (rtems-powerpc for MVME3100):<br>
>><br>
>> $ ../source-builder/sb-set-<wbr>builder --dry-run --with-download<br>
>> --without-error-report --without-release-url 5/rtems-powerpc<br>
>><br>
>> 2. If firewalls and proxies are not a problem for you, skip this step. Even<br>
>> though sources were pre-downloaded, rsb will try to fetch the rtems-tools<br>
>> repository during the build process (even if --no-download is specified). We<br>
>> need to make sure the repository is accessible or the lengthy build process<br>
>> (~ hour on two cores) will fail. In our environment, git protocol didn't<br>
>> work through http(s) proxy, so git config was modified:<br>
>><br>
>> $ cd ~/src/RTEMS/rsb/rtems<br>
>> $ nano sources/git/rtems-tools.git/.<wbr>git/config<br>
>><br>
>> Replace:<br>
>> url = git://<a href="http://git.rtems.org/rtems-tools.git" rel="noreferrer" target="_blank">git.rtems.org/rtems-<wbr>tools.git</a><br>
>> with:<br>
>> url = <a href="https://github.com/RTEMS/rtems-tools.git" rel="noreferrer" target="_blank">https://github.com/RTEMS/<wbr>rtems-tools.git</a><br>
>><br>
>> 3. rsb now has sources and patches downloaded. If you will build RTEMS on a<br>
>> different host, move the entire folder to the build machine.<br>
>><br>
>> My build setup:<br>
>><br>
>> $ uname -a<br>
>> Linux sandbox8 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26)<br>
>> x86_64 GNU/Linux<br>
>> $ cat /etc/debian_version<br>
>> 8.9<br>
>><br>
>> All further steps are performed on the build machine.<br>
>><br>
>> 4. Run sb-check and install necessary packages if the check tool complains:<br>
>><br>
>> $ cd ~/src/RTEMS/rsb<br>
>> $ ./source-builder/sb-check<br>
>><br>
>> Alas, sb-check doesn't check for everything. For example, the build process<br>
>> can fail with something like:<br>
>><br>
>> checking for python... /usr/bin/python<br>
>> checking for python2.7... no<br>
>><br>
>> This is resolved by being lucky in finding a similar issue discussed on the<br>
>> mailing list. Additional packages may be needed, in the mentioned case it<br>
>> was:<br>
>><br>
>> $ sudo apt-get install python2.7-dev<br>
>><br>
>> 5. Build rsb (takes a while, was an hour on my dual-core VM). Since sources<br>
>> were pre-downloaded, specify "--no-download" (however rtems-tools will still<br>
>> be fetched!):<br>
>><br>
>> $ ../source-builder/sb-set-<wbr>builder --no-download --prefix=$HOME/src/RTEMS/5<br>
>> 5/rtems-powerpc<br>
>><br>
>> 6. Build rtems. First make sure rsb tools are in path:<br>
>><br>
>> $ export PATH=$HOME/src/RTEMS/5/bin:$<wbr>PATH<br>
>><br>
>> Get RTEMS source:<br>
>><br>
>> $ cd ~/src/RTEMS<br>
>> $ mkdir kernel<br>
>> $ cd kernel<br>
>> $ git clone <a href="https://github.com/RTEMS/rtems.git" rel="noreferrer" target="_blank">https://github.com/RTEMS/<wbr>rtems.git</a><br>
>><br>
>> Run bootstrap scripts to generate files which are missing in cloned<br>
>> repository:<br>
>><br>
>> $ cd rtems<br>
>> $ ./bootstrap -c<br>
>> $ ./bootstrap -p<br>
>> $ ../../rsb/source-builder/sb-<wbr>bootstrap<br>
>> $ cd ..<br>
>><br>
>> Configure and build RTEMS for the target:<br>
>><br>
>> $ mkdir build-mvme3100<br>
>> $ cd build-mvme3100<br>
>> $ ../rtems/configure --enable-networking --enable-cxx --enable-rdbg<br>
>> --enable-posix --prefix=$HOME/src/RTEMS/5 --target=powerpc-rtems5<br>
>> --enable-rtemsbsp=mvme3100<br>
>> $ make -j 8<br>
>> $ make install<br>
>><br>
>> 7. Build Cexp. Two things which are not straightforward is getting all<br>
>> submodules and running "make prep".<br>
>><br>
>> $ cd ~/src/RTEMS<br>
>> $ mkdir cexp<br>
>> $ cd cexp<br>
>> $ git clone <a href="https://github.com/till-s/cexpsh.git" rel="noreferrer" target="_blank">https://github.com/till-s/<wbr>cexpsh.git</a><br>
>> $ cd cexpsh<br>
>> $ git submodule update --init --recursive<br>
>><br>
>> As with RTEMS bootstrap, we need to generate some missing files. Stunningly,<br>
>> I didn't find it mentioned in cexpsh/INSTALL:<br>
>><br>
>> $ make prep<br>
>><br>
>> Now the code is ready to be configured and built. Use<br>
>> "--enable-std-rtems-<wbr>installdirs" to perform installation on top of the<br>
>> previously built RTEMS tree:<br>
>><br>
>> $ cd ..<br>
>> $ mkdir build-mvme3100<br>
>> $ cd build-mvme3100<br>
>> $ ../cexpsh/configure --enable-std-rtems-installdirs<br>
>> --with-rtems-top=$HOME/src/<wbr>RTEMS/5 --host=powerpc-rtems5<br>
>> --enable-rtemsbsp=mvme3100<br>
>> $ make -j 8<br>
>> $ make install<br>
>><br>
>> 8. Build GeSys. Another trickery here - before configuring, it is necessary<br>
>> to build the ldep tool as mentioned in documentation.<br>
>><br>
>> Get all GeSys sources and submodules:<br>
>><br>
>> $ cd ~/src/RTEMS<br>
>> $ mkdir gesys<br>
>> $ cd gesys<br>
>> $ git clone <a href="https://github.com/till-s/rtems-gesys.git" rel="noreferrer" target="_blank">https://github.com/till-s/<wbr>rtems-gesys.git</a><br>
>> $ cd rtems-gesys<br>
>> $ git submodule update --init --recursive<br>
>><br>
>> As for other parts, generate missing files by running the bootstrap tool:<br>
>><br>
>> $ ./bootstrap<br>
>><br>
>> Another bootstrap is necessary for ldep:<br>
>><br>
>> $ cd ldep<br>
>> $ ./bootstrap<br>
>> $ mkdir build<br>
>> $ cd build<br>
>><br>
>> Configure and install ldep to where all rsb stuff is:<br>
>><br>
>> $ ../configure --prefix=$HOME/src/RTEMS/5<br>
>> $ make<br>
>> $ make install<br>
>><br>
>> Configure and install GeSys in the same tree where RTEMS and Cexp are by<br>
>> using "--enable-std-rtems-<wbr>installdirs". Note that $HOME/src/RTEMS/5/bin must<br>
>> be in PATH:<br>
>><br>
>> $ cd ~/src/RTEMS/gesys<br>
>> $ mkdir build-mvme3100<br>
>> $ cd build-mvme3100<br>
>> $ ../rtems-gesys/configure --enable-std-rtems-installdirs<br>
>> --with-rtems-top=$HOME/src/<wbr>RTEMS/5 --host=powerpc-rtems5<br>
>> --enable-rtemsbsp=mvme3100<br>
>> $ make -j 8<br>
>> $ make install<br>
>><br>
>> 9. Behold the build binaries:<br>
>><br>
>> $ cd ~/src/RTEMS/5/powerpc-rtems5/<wbr>bin<br>
>> $ ls<br>
>> ar ld nm objdump readelf rtems.ralf st.sys<br>
>> as ld.bfd objcopy ranlib rtems.exe strip<br>
>><br>
>> rtems.ralf is the thing. It worth mentioning that none of .obj files loaded<br>
>> in the "st.sys" are present (telnetd.obj, monitor.obj etc.)<br>
>><br>
>> ====================<br>
>> Boot the image<br>
>><br>
>> I put the resulting image in our VME timing test setup which successfully<br>
>> boots and runs RTEMS 4.9. Boot procedure is DHCP with MOTLoad netBoot.<br>
>> "rtems.ralf" was renamed to "rtems.boot" for booting purposes. Boot<br>
>> sequence:<br>
>><br>
>> ********************<br>
>> Copyright(C)2008-2013,Emerson Network Power-Embedded Computing,Inc.<br>
>> All Rights Reserved<br>
>> Copyright Motorola Inc. 1999-2007, All Rights Reserved<br>
>> MOTLoad RTOS Version 2.0, PAL Version 1.2 RM04<br>
>> Wed Nov 6 17:17:43 MST 2013<br>
>><br>
>> MPU-Type =MPC8540<br>
>> MPU-Int Clock Speed =666MHz<br>
>> MPU-CCB Clock Speed =333MHz<br>
>> MPU-DDR Clock Speed =166MHz<br>
>> MPU-PCI Clock Speed =66MHz, PCI, 64-bit<br>
>> MPU-Int Cache(L2) Enabled, 256KB, L2CTL =A8000300<br>
>><br>
>> Reset/Boot Vector =Flash0<br>
>><br>
>> Local Memory Found =10000000 (&268435456)<br>
>> User Download Buffer =0159D000:0179CFFF<br>
>><br>
>> MVME3100> bootmem=malloc 0x500000<br>
>> return = 0193D000 (&26464256)<br>
>> errno = 00000000<br>
>> MVME3100> netBoot -d/dev/enet0 -v -abootmem -p -h -u<br>
>> Network Loading from: /dev/enet0<br>
>><br>
>> Locating BOOTP Server... Found It!<br>
>><br>
>> Client IP Address = 10.0.1.104<br>
>> Server IP Address = 10.0.1.1<br>
>> Gateway IP Address = 0.0.0.0<br>
>> Subnet IP Address Mask = 255.255.255.0<br>
>> Boot File Name = rtems-5/rtems.boot<br>
>> Load Address = 0193D000<br>
>> Buffer Size = ffffffff<br>
>><br>
>> Network Boot File Load Start - Press <ESC> to Bypass, <SPC> to Continue<br>
>><br>
>> Network Boot File Load in Progress - Press <CTRL-C> to Abort[]>>>><br>
>> ...<br>
>> Bytes Received =&4886264, Bytes Loaded =&4886264<br>
>> Bytes/Second =&488626, Elapsed Time =10 Second(s)<br>
>><br>
>> Execution Halted on Request<br>
>> MV----------------------------<wbr>-------------<br>
>> Welcome to rtems-5.0.0 (PowerPC/Generic (no FPU)/mvme3100)<br>
>> BSP: mvme3100, CVS Release ($Name$)<br>
>> CPU 0x8020 - rev 0x20<br>
>> Additionnal boot options are H<br>
>> Initial system stack at 14c9980<br>
>> Software IRQ stack starts at 14c9a90 with size 16384<br>
>> Going to start PCI buses scanning and initialization<br>
>> Board Type: MVME3100-1152 (S/N E10EA0D)<br>
>> External (=PCI Bus) Clock Freq : 66666666 Hz<br>
>> Core Complex Bus (CCB) Clock Freq: 333333330 Hz<br>
>> CPU Clock Freq: 133333332 Hz<br>
>> Ethernet 0 EC:9E:CD:0E:16:5B<br>
>> Ethernet 1 EC:9E:CD:0E:16:5C<br>
>> Ethernet 2 EC:9E:CD:0E:16:5D<br>
>> Number of PCI buses found is : 2<br>
>> BUS:SLOT:FUN VENDOR-DEV_ID: COMMAND STATUS BASE_ADDR0 BASE_ADDR1 IRQ_PIN -><br>
>> IRQ_LINE<br>
>> 0:0x00:0 0x1057-0x0008: 0x0006 0x20b0 0x80000000 0x00000000 0 -><br>
>> 0 (=0x00)<br>
>> 0:0x11:0 0x10e3-0x0148: 0x0146 0x02b0 0x80100004 0x00000000 1 -><br>
>> 0 (=0x00)<br>
>> 0:0x12:0 0x10b5-0x6520: 0x0147 0x02b0 0x00000000 0x00000000 0 -><br>
>> 0 (=0x00)<br>
>> 0:0x14:0 0x1095-0x3124: 0x01c7 0x02b0 0x80300004 0x00000000 1 -><br>
>> 2 (=0x02)<br>
>> 1:0x00:0 0x10b5-0x9030: 0x0142 0x0290 0x80200000 0x00000000 1 -><br>
>> 4 (=0x04)<br>
>> Memory: 268435456 bytes<br>
>> Cleared PCI errors: pci_stat was 0x20b0<br>
>> OpenPIC Version 1.2 (1 CPUs and 56 IRQ sources) at 0x3775135744<br>
>> OpenPIC Vendor 0 (Unknown), Device 0 (Unknown), Stepping 0<br>
>> OpenPIC timer frequency is 41666666 Hz<br>
>> MSR is 0x00001000, TCR 0x04000000<br>
>> ------------------------------<wbr>-----------<br>
>> Exit from bspstart<br>
>> libi2c: Library not initialized<br>
>> Registering mpc8540 i2c bus driver :No such file or directory<br>
>> Tundra Tsi148 PCI-VME bridge detected at 0x80100000, IRQ 0<br>
>> Tsi148 Outbound Ports:<br>
>> Port VME-Addr Size PCI-Adrs Mode:<br>
>> 0: 0x20000000 0x0e000000 0xc0000000 A32, SUP, D32, SCT<br>
>> 1: 0x00000000 0x00ff0000 0xcf000000 A24, SUP, D32, SCT<br>
>> 2: 0x00000000 0x00010000 0xcfff0000 A16, SUP, D32, SCT<br>
>> 7: 0x00000000 0x01000000 0xce000000 CSR, SUP, D32, SCT<br>
>> Tsi148 Inbound Ports:<br>
>> Port VME-Addr Size PCI-Adrs Mode:<br>
>> 0: 0xc0000000 0x10000000 0x00000000 A32, PGM, DAT, SUP, USR, MBLT, BLT<br>
>> vmeTsi148 IRQ manager: looking for registers on VME...<br>
>> Trying to find CSR on VME...<br>
>> vmeTsi148 - IRQ manager using VME CSR to flush FIFO<br>
>> Registering /dev/console as minor 0 (==/dev/ttyS0)<br>
>> Welcome to RTEMS 5.0.0 GeSys<br>
>> This system was built on 20171213EST19:00:39<br>
>> Installing TIOCGWINSZ line discipline: ok.<br>
>> To skip initialization, press a key now...<br>
>> bootpc_init: using network interface 'tse1'<br>
>> bootpc hw address is ec:9e:cd:e:16:5b<br>
>> My ip address is 10 .0 .1 .104<br>
>> Time Server is 10 .0 .1 .1<br>
>> Domain name is cs.nsls2.local<br>
>> Boot file is rtems-5/rtems.boot<br>
>> Command line is IOCNAME=timing<br>
>> Subnet mask is 255 .255 .255 .0<br>
>> Server ip address is 10 .0 .1 .1<br>
>> Gateway ip address is 0 .0 .0 .0<br>
>> Log server ip address is 10 .0 .1 .1<br>
>> bootpc_adjust_interface: add net route, error=114<br>
>> Trying to synchronize NTP...OK<br>
>> Trying symfile 'BUILTIN', system script 'st.sys'<br>
>> 'st.sys':<br>
>> opening script file: No such file or directory<br>
>> Type 'cexpsh.help()' for help (no quotes)<br>
>> ********************<br>
>><br>
>> There are several suspicious points: PCI buses scanning not reporting<br>
>> anything, i2c library/driver errors, bootpc_adjust_interface error, and of<br>
>> course "st.sys" script not being found. Peculiar enough, I can perform NFS<br>
>> mount and run a script from there. It doesn't work smoothly however and<br>
>> nfsMountsShow output is odd:<br>
>><br>
>> Cexp>nfsInit(0,0)<br>
>> RTEMS-NFS, Till Straumann, Stanford/SLAC/SSRL 2002, See LICENSE file for<br>
>> licensing info.<br>
>> 0x00000000 (0)<br>
>> Cexp>nfsMount("10.0.1.1","/<wbr>srv/tftp/rtems-5","/common")<br>
>> Trying to mount 10.0.1.1:/srv/tftp/rtems-5 on /common<br>
>> RTEMS-RPCIOD, Till Straumann, Stanford/SLAC/SSRL 2002, See LICENSE file for<br>
>> licensing info.<br>
>> 0x00000000 (0)<br>
>> Cexp>nfsMountsShow(0)<br>
>> Currently Mounted NFS:<br>
>> 10.0.1.1:/srv/tftp/rtems-5 on /<br>
>> 0x00000000 (0)<br>
>><br>
>> ====================<br>
>> Conclusion<br>
>><br>
>> To conclude that, I'd be happy to hear any suggestions and insights to the<br>
>> procedure described. It might be something as obvious as missing an option<br>
>> somewhere. It would be also great if anyone who has a working<br>
>> RTEMS+Cexp+GeSys setup would share instructions on how to make it work<br>
>> properly.<br>
>><br>
><br>
> I don't know if you ever worked this out for yourself. libnetworking<br>
> does not get a lot of usage in RTEMS-5.0. Heinz Junkes tells me that<br>
> he got EPICS-7 working on RTEMS-5 with PPC/MVME6100, but I don't know<br>
> if they use the cexp/gesys modules yet.<br>
><br>
> Gedare<br>
><br>
>> Best regards,<br>
>> Anton A. Derbenev<br>
>> NSLS-II<br>
>> Brookhaven National Laboratory<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> users mailing list<br>
>> <a href="mailto:users@rtems.org">users@rtems.org</a><br>
>> <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>