1 2 3 Previous Next 35 Replies Latest reply on Oct 16, 2012 8:50 AM by mziwisky

    Is there any documentation for running applications on Baremetal

    vjain27

      Hi,

       

      I need to run applications on SCC Baremetal. Please let me know if there any step by step document for

      running applications on baremetal. The SCC board which I am working on currently has linux loaded on each core.

      What needs to be done to run it in Baremetal mode ?

       

      Thanks

        • 1. Re: Is there any documentation for running applications on Baremetal
          mziwisky

          See attachment.  I've put together something that might help you get started.  It's just enough source to configure the Pentium cores and launch into your C code, plus a few functions for finding out what core and tile you are, and some default exception handlers so that you get stackdumps when you try to do stuff like divide by zero.  There is also a little tool you can run to get output from the cores.  See README.txt for details.  Hope this helps!

           

          Michael

           

          EDIT:  Now hosted on the SCC SVN repo at http://marcbug.scc-dc.com/svn/repository/trunk/baremetal/baremichael/tarballs/

          The tarball originally attached here is now called baremichael_v0.tgz in the repo.  A later version with more features is also available there.

          • 2. Re: Is there any documentation for running applications on Baremetal
            vjain27

            Thanks a lot!! I was eagerly waiting for someone to reply. I guess I will have to go through the stuff a few times before I understand it completely.

            But before that  I would like to ask one more question. Actually I am sharing a marc machine with some other users. Currenly the SCC has

            linux loaded on each cores. Would it be proper to run Baremetal applications on the SCC? Please excuse me if it sounds a little silly. I haven't put much thought into it but I just want that it should not create problems with other users who are using the same SCC.

             

            Thanks!

            • 3. Re: Is there any documentation for running applications on Baremetal
              tedk

              Thanks, Mike for responding. We've all been very busy here and some important posts languish more than they should. Working on baremetal has fallen behind.

               

              vjain27, I don't see your name as an account in the Data Center ... I guess because you are using a different username there.

               

              But if you are sharing a data center machine, that sharing is blocked out in time. Different users are not using the system as the same time. When you are using it you have exclusinve access. And most people when they get access and are using Linux, boot Linux on the cores. It only takes a couple of minutes. You don't know what state the last user left the cores in. The last user may have been running their own customized version of Linux.

               

              Please report your baremetal experiences here. Mike is a baremetal expert.

              1 of 1 people found this helpful
              • 4. Re: Is there any documentation for running applications on Baremetal
                vjain27

                Thanks Ted!

                 

                My university has an account on an MCPC. Anybody who wants to access it has to telnet into a system in the lab and then telnet into the MCPC

                from there.Should this be in the datacenter ? I wasn't told to access it at any specfic time but I was told that some other universities are also accessing the same SCC.

                I am sorry I don't have much information.

                • 5. Re: Is there any documentation for running applications on Baremetal
                  mziwisky

                  vjain27 wrote:

                   

                  I guess I will have to go through the stuff a few times before I understand it completely.

                   

                  Feel free to ask any questions you have about the source.  To start off, I'll summarize the code path here.

                   

                  After pulling a core's reset, that core begins execution at 0xfffffff0.  The code loaded there is seen in boot/reset_vector.S.  All it does is disable interrupts, load up the data segment registers, and long jump to 0x00000000.

                   

                  The code that gets loaded to 0x00000000 is boot/startup.S.  Upon resetting, the Pentium core boots up in 16-bit real mode; startup.S contains code to get into 32-bit protected mode.  The global descriptor table (GDT) gets set up to provide a simple, flat memory space.  Space is reserved for the interrupt descriptor table (IDT), the entries to which get filled in later.  Then an LGDT instruction is executed to begin using the GDT that was defined earlier.  Protected mode is entered, segment registers are loaded with the appropriate index into the GDT, and a long jump is executed to get into 32-bit mode.  From there, LIDT is executed to begin using the IDT that was defined earlier, the stack pointer is set to 64k after the end of your compiled binary, the stack is cleared, the BSS section is cleared, floating point unit is activated, then platforminit is called.

                   

                  platforminit() is in system/platforminit.c.  It initializes the print buffer that is used by miketerm (which is the utility that displays your printf() output) and initializes the IDT to set up some default handlers for the 32 reserved Intel exceptions.  (And, actually, for another 16 exceptions/interrupts after those.)

                   

                  platforminit() then returns to startup.S, which calls main().  main() is expected to take no parameters and return void.  After the code there finishes executing, the processor halts.

                  1 of 1 people found this helpful
                  • 6. Re: Is there any documentation for running applications on Baremetal
                    vjain27

                    Hi Mike, Ted,

                    I am thinking of implementing a simple message passing application using the

                    code provided by Mike. I dont want to use RCCE but do want to use MPB. Could you please

                    advice on how should I proceed ?

                     

                    - Thanks

                    • 7. Re: Is there any documentation for running applications on Baremetal
                      hoffman

                      from what i can recall you'll need to :

                       

                         configure virtual memory using 4k pages

                       

                         globally enable mpb using the 11th bit of CR4

                       

                         set up the lut entires to point to the mpbs

                       

                         map those entires with the PAGESIZE bit set

                      • 8. Re: Is there any documentation for running applications on Baremetal
                        darence

                        Can I get some help to get started? I've managed to compile everything, but I can't start miketerm. It says:

                         

                        [00]: MIKETERM ERROR: Couldn't find appropriate line in buffer. Bye!
                          head = 372959315; tail = 2147483647

                         

                        Here's the output of "make run" (with the default code):

                         

                         

                        sccBoot -g obj/; sccReset -r 0x0 0x1 0x14 0x18 0x2f
                        INFO: Welcome to sccBoot 1.4.1 (build date Jul  4 2011 - 16:14:13)...
                        INFO: Pulling reset of all cores...
                        INFO: Preloading Memory with object file...
                        INFO: Found object for MC x=0, y=0: "obj//mch_0_0.32.obj"...
                        INFO: writeMemFromOBJ(...): Configuration of memory done!
                        INFO: Successfully (re-)loaded object file "obj//mch_0_0.32.obj"...
                        INFO: Found object for MC x=5, y=0: "obj//mch_5_0.32.obj"...
                        INFO: writeMemFromOBJ(...): Configuration of memory done!
                        INFO: Successfully (re-)loaded object file "obj//mch_5_0.32.obj"...
                        INFO: Found object for MC x=0, y=2: "obj//mch_0_2.32.obj"...
                        INFO: writeMemFromOBJ(...): Configuration of memory done!
                        INFO: Successfully (re-)loaded object file "obj//mch_0_2.32.obj"...
                        INFO: Found object for MC x=5, y=2: "obj//mch_5_2.32.obj"...
                        INFO: writeMemFromOBJ(...): Configuration of memory done!
                        INFO: Successfully (re-)loaded object file "obj//mch_5_2.32.obj"...
                        INFO: Preloading LUTs...
                        INFO: Configuring LUTs with content of file "obj//lut_init.dat"...
                        INFO: -> Configuration of LUTs done!
                        INFO: Image is now pre-loaded. Release resets to start individual cores...
                        INFO: Welcome to sccReset 1.4.1 (build date Jun 28 2011 - 16:00:14)...
                        INFO: Resets have been released: 5 cores (PIDs = 0x00, 0x01, 0x14, 0x18 and 0x2f)...

                        • 9. Re: Is there any documentation for running applications on Baremetal
                          hoffman

                          sorry, i worked on the ETI baremetal framework, so i didn't really use any of

                          that toolchain, in particular miketerm

                           

                          the one part of that project that was open sourced is a library to read an write memory,

                          write the luts, reset the processor etc. its really just a boiled down version of ssclib

                          without the qt, queing, api support. it might be an easier place to start it you're building

                          up from 0xffffff00

                          • 10. Re: Is there any documentation for running applications on Baremetal
                            tedk

                            I think the ETI Framework is your best approach to using baremetal on the SCC. Currently this framework works on a sccKit 1.3.0 system. The FPGA bitstream changed for 1.4.0 and the framework sitll needs to understand that change.

                             

                            What system do you work on? If you don't have access to a system running 1.3.0, we can arrange that, although you may have to share it with others also intetrested in baremetal.

                            • 11. Re: Is there any documentation for running applications on Baremetal
                              mziwisky
                              Can I get some help to get started? I've managed to compile everything, but I can't start miketerm.

                               

                              The first thing you'll want to try, if you haven't already, is to do `make run` first, and then run miketerm.  miketerm and the provided framework rely on a circular buffer being constructed in shared memory by the code that runs on the SCC.  If that code hasn't already run once, you might have garbage values for the buffer head and tail, and miketerm won't handle it correctly.  Now, assuming that doesn't fix the problem...

                               

                              miketerm relies upon sccDump and sccWrite from the sccKit.  It works well on my marc machine (marc019), which is running sccKit version 1.4.0.  It looks like you're running version 1.4.1.  I downloaded the 1.4.1 binaries and tried it out with them, and I'm getting an error, but it's different than yours.  If you want to switch over and try running ETI's framework, you're of course welcome, but I'd be happy to look into this issue with my framework if you want to try it out a little longer.

                               

                              So if you want to stick with miketerm, try the command `sccDump -d 0 0x1ec000000 32` and let me know what your output is.  I get:

                               

                              [mziwisky@marc019 1.4.1/]$ bin/sccDump -d 0 0x1ec000000 32

                              INFO: Packet tracing is disabled...
                              INFO: Initializing System Interface (SCEMI setup)....
                              INFO: Successfully connected to PCIe driver...
                              INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
                              INFO: --------------------------------------------------

                               

                              Memory access out of range. Limit = 100000000 hex. Please reduce start address.
                              --------------------------------------------------

                               

                              Ted -- I believe this is an error in 1.4.1.  0x1ec000000 ought to be a valid address for the memory controllers.  It is, in fact, the beginning of the shared memory space that is mapped to 0x80000000 on all cores by the default LUT configuration.  This command works fine with sccKit 1.4.0.  Is there something I'm overlooking?  Or shall I file a bug report on this?  Note that this is the same output I get from each of the three 1.4.1 binaries (i.e. sccKit_1.4.1.tar.bz2, sccKit_1.4.1.1.tar.bz2, and sccKit_1.4.1.2.tar.bz2).

                              • 12. Re: Is there any documentation for running applications on Baremetal
                                mziwisky

                                vjain27 wrote:

                                 

                                Hi Mike, Ted,

                                I am thinking of implementing a simple message passing application using the

                                code provided by Mike. I dont want to use RCCE but do want to use MPB. Could you please

                                advice on how should I proceed ?

                                 

                                - Thanks

                                 

                                I'm also working on a message passing API, but not very far along yet.  The advice hoffman gave seems plausible from what I've read in the EAS, but I haven't experimented with it yet, so I can't say for sure.  The steps he talks about seem to be necessary to make sure the cache hardware correctly sets the MPBT bit for cache lines that come from the MPB.  This is important if you want to use the CL1INVMB command, which invalidates MPB cache lines but leaves non-MPB lines intact.  (Again, this is a bit of speculation on my part -- I haven't played with it yet!)

                                 

                                In addition, you'll probably want to use the LINT0 and/or LINT1 pins of a core's local APIC to signal that someone else has written a message to its MPB.  If so, then you'll need to enable the local APIC and configure its LVT0 and/or LVT1 registers to associate the LINT0/1 pins with an interrupt vector, then associate that vector with a handler in the IDT.  There is info on configuring the LAPIC in the Pentium SW Developer's Manual Vol 3.  I have done the LAPIC configuration already, but unfortunately that code is not ready to be shared!  If you'd like it, just let me know, and I'll clean it up and post it here.

                                 

                                --Mike

                                • 13. Re: Is there any documentation for running applications on Baremetal
                                  darence

                                  My sccDump output seems to be different (no errors):

                                  INFO: Packet tracing is disabled...
                                  INFO: Initializing System Interface (SCEMI setup)....
                                  INFO: Successfully connected to PCIe driver...
                                  INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
                                  INFO:  Contacting SystemIF to read memory. Please be patient ...
                                  INFO:  done System Read.
                                  --------------------------------------------------
                                    Reading on PERIW of Tile x=0, y=0
                                    startAddress = 1ec000000 hex (8254390272 dec)
                                    stopAddress  = 1ec00001f hex
                                    Requested/Displayed length: 32/32 bytes
                                  --------------------------------------------------
                                  ** 8 bits alignment
                                  --------------------------------------------------
                                  00000001ec000000 | 1c 00 00 00 00 00 00 00  | ........
                                  00000001ec000008 | 00 00 00 00 00 00 00 00  | ........
                                  00000001ec000010 | 1c 00 00 00 00 00 00 00  | ........
                                  00000001ec000018 | 00 00 00 00 00 00 00 00  | ........

                                   

                                  As for miketerm, I did try to run "make run" first, but it doesn't help... Anyway, I'll have sccKit downgraded -- looks like a good idea for both your framework and ETI.

                                  • 14. Re: Is there any documentation for running applications on Baremetal
                                    tedk

                                    Mike,

                                    I'm not seeing this error. I can read the memory from the command line and from the Gui memory reader widget.

                                     


                                    tekubasx@marc101:~$ sccDump -d 0 0x1ec000000 64
                                    INFO: Packet tracing is disabled...
                                    INFO: Initializing System Interface (SCEMI setup)....
                                    ERROR: Couldn't open device /dev/crbif0rb0...
                                    ERROR: initializeSysIF(): Failed to open PCIe driver device. Driver in use or PCIe link down...
                                    ERROR: Unable to connect to PCIe driver...
                                           Make sure that PCIe driver is installed and
                                           not in use by someone else... Aborting!
                                    tekubasx@marc101:~$ sccDump -d 0 0x1ec000000 64
                                    INFO: Packet tracing is disabled...
                                    INFO: Initializing System Interface (SCEMI setup)....
                                    INFO: Successfully connected to PCIe driver...
                                    INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
                                    INFO:  Contacting SystemIF to read memory. Please be patient ...
                                    INFO:  done System Read.
                                    --------------------------------------------------
                                      Reading on PERIW of Tile x=0, y=0
                                      startAddress = 1ec000000 hex (8254390272 dec)
                                      stopAddress  = 1ec00003f hex
                                      Requested/Displayed length: 64/64 bytes
                                    --------------------------------------------------
                                    ** 8 bits alignment
                                    --------------------------------------------------
                                    00000001ec000000 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000008 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000010 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000018 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000020 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000028 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000030 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000038 | 00 00 00 00 00 00 00 00  | ........
                                    [1]+  Done                    sccGui
                                    tekubasx@marc101:~$ sccDump -d 0 0x1ec000000 32
                                    INFO: Packet tracing is disabled...
                                    INFO: Initializing System Interface (SCEMI setup)....
                                    INFO: Successfully connected to PCIe driver...
                                    INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
                                    INFO:  Contacting SystemIF to read memory. Please be patient ...
                                    INFO:  done System Read.
                                    --------------------------------------------------
                                      Reading on PERIW of Tile x=0, y=0
                                      startAddress = 1ec000000 hex (8254390272 dec)
                                      stopAddress  = 1ec00001f hex
                                      Requested/Displayed length: 32/32 bytes
                                    --------------------------------------------------
                                    ** 8 bits alignment
                                    --------------------------------------------------
                                    00000001ec000000 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000008 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000010 | 00 00 00 00 00 00 00 00  | ........
                                    00000001ec000018 | 00 00 00 00 00 00 00 00  | ........
                                    tekubasx@marc101:~$

                                    1 2 3 Previous Next