Re: How to install RTAI 5.1 on Debian?

Guo Yunfei <[email protected]> Mon, 12 Feb 2018 23:07:14 +0800
Newsgroups gmane.linux.real-time.rtai
Message-ID <CAN_Un=XVv4ku72AZk=bOiQhBJ+hojj__7RVz-ieZqnj-Cfwj+Q@mail.gmail.com>
--===============3683631303600586673==
Content-Type: multipart/alternative; boundary="001a113f697cb5290f0565053b32"

--001a113f697cb5290f0565053b32
Content-Type: text/plain; charset="UTF-8"

How to do it?
How to switch the legacy support on and off?

On Mon, Feb 12, 2018 at 10:49 PM, Paolo Mantegazza <
[email protected]> wrote:

> Have you disabled the legacy support?
> Paolo
>
>
> On 02/12/2018 03:41 PM, Guo Yunfei wrote:
>
> Not.
> I using the patchs in RTAI-5.1 directory.
> I had tried hal-linux-3.10.32-x86-8.patch ,
> and hal-linux-3.16.7-x86-5.patch
> and hal-linux-3.18.20-x86-6.patch
>
> all of them make and make install was successful.
>
> But when I test the latency by that "run" command.
> the computer not response and hang .
> need to  power off to reboot.
>
> BR
> Guo Yunfei
>
>
> On Mon, Feb 12, 2018 at 10:17 PM, Paolo Mantegazza <
> [email protected]> wrote:
>
>> Is there any 3.8.13 patch in RTAI-5.1?
>> Paolo
>>
>>
>> On 02/12/2018 02:23 PM, Guo Yunfei wrote:
>>
>>
>> Hi. everybody.
>>
>> I always install RTAI 4.0 and RTAI 4.1 on Debian as below steps and using
>> it perfect.
>> When I install RTAI 5.1 as same steps.  the RTAI 5.1 can be make
>> successfully.
>> But the system not reponse after I test the latency by that "run "
>> command.
>>
>> Could some one give me a guide of installation of RTAI 5.1 on Debian?
>>
>> Best Regards
>> Guo Yunfei
>>
>> My steps:
>> //------------------------------------------
>> This document describes how to install RTAI 4.0 on a Ubuntu 12.04.4 LTS
>> using a 3.8.13 kernel, either 32bit or 64 bit version.
>> Prerequisites
>>
>> Install Ubuntu 12.04.4 using one of the following images:
>>
>> http://releases.ubuntu.com/precise/ubuntu-12.04.4-desktop-amd64.iso
>>
>> http://releases.ubuntu.com/precise/ubuntu-12.04.4-desktop-i386.iso
>>
>> And then follow the installation instructions here:
>> https://help.ubuntu.com/community/Installation/
>> Introduction
>>
>> If the ROOT user is not created yet, log as your usual user, open a
>> terminal and type ->
>>
>> # sudo su -
>> # sudo passwd root
>>
>> Enter the password for the ROOT user. Log out and log in as Root.
>>
>> Open a terminal and update your package repository source file :
>>
>> # apt-get update
>>
>> Some tools are required in order to set up the kernel (You need to be
>> connected to Internet)
>>
>> # apt-get -y install qt3-apps-dev build-essential kernel-package vim cvs
>>
>> I - Kernel source and RTAI download
>>
>> # cd /usr/src/
>>
>> Get the kernel source from kernel.org
>>
>> # wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.bz2
>> # tar xf linux-3.8.13.tar.bz2
>>
>> Get RTAI 4.0 from the RTAI homepage
>>
>> # wget https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2
>> tar xf rtai-4.0.tar.bz2
>>
>> II - Kernel Preparation
>>
>> # cd /usr/src
>> # ln -s linux-3.8.13 linux
>> # cd linux
>>
>> Applying patch
>>
>> If you want first simulate the patch application, use "--dry-run" after
>> "-p1". It won't touch any files on your computer, but you can see if you
>> get Hunks or not.
>>
>> # patch -p1 < /usr/src/rtai-4.0/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch
>>
>> Kernel Configuration
>>
>> # cd /usr/src/linux
>>
>> In order to retrieve your current kernel configuration : (If at this
>> step, questions are asked give the answer by default)
>>
>> # make oldconfig
>>
>> Now we modify the kernel settings the way we need it (NOTE: some
>> parameters cannot be disabled with xconfig - better to use menuconfig):
>>
>> # make xconfig
>>
>> Set up the kernel settings as follows :
>>
>> *Processor type and features*
>>
>> -> Processor family =
>> *Select yours *-> Maximum number of CPUs (NR_CPUS) = *Set your number
>> (it's generally "4")*
>> -> SMT (Hyperthreading) scheduler support = *DISABLE IT*
>>
>> *Power Management and ACPI options*
>>
>> CPU idle PM support
>> -> Cpu idle Driver for Intel Processors =
>> *DISABLE IT *-> ACPI (Advanced Configuration and Power Interface)
>> Support -> PROCESSOR =
>> *DISABLE IT *-> APM (Advanced Power Management) BIOS support =
>> *DISABLE IT *-> CPU Frequency scaling -> CPU Frequency scaling =
>> *DISABLE IT *CPU idle PM support = DISABLE IT
>>
>> Save and Quit
>>
>> Note (Sylvain, May 2014): these settings should be verified in the
>> .config file, since there have been cases that xconfig does not do it
>> correctly.
>> *III - Kernel Compilation*
>>
>> # cd /usr/src/linux
>> # make && make modules_install && make install
>>
>> NOTE: The compilation time might be decreased by passing the flags -jX
>> (with X=number of CPUs you have on your machine). This has for effect to
>> parallelize the kernel compilation between the CPUs. This will take ~1 hour.
>> Kernel Boot Options
>>
>> This is very important - it took us (and the guys at the RTAI mailing
>> list) ages to find that special config that makes everything work smoothly!
>>
>> You need to add the following option to the kernel at boot time
>>
>> lapic=notscdeadline
>>
>> The best way to do this is in /etc/default/grub in the field
>> GRUB_CMDLINE_LINUX_DEFAULT, i.e.,
>>
>> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash lapic=notscdeadline"
>>
>> You will also have to change the GRUB_DEFAULT to the number that
>> corresponds to the new kernel.
>>
>> Finally run update-grub and reboot
>>
>> # update-grub
>> # reboot
>>
>> *IV - RTAI installation*
>>
>> Now that the system has restarted, make sure you booted on your new
>> OpenAir
>> <https://twiki.eurecom.fr/twiki/bin/edit/OpenAirInterface/OpenAir?topicparent=OpenAirInterface.OpenAirKernel357Ubuntu1204x86Setups;nowysiwyg=0>
>>  kernel
>>
>> # uname -r
>>
>> Should give you "3.8.13" as result
>>
>> # cd /usr/src/rtai-4.0
>> # make xconfig
>>
>> UPDATE the CPUs number according to your configuration and disable
>> RTAI_USE_NEWERR and real-time COMEDI support in Add-ons. Enable the
>> watchdog, CONFIG_RTAI_WD.
>>
>> Save and quit. If any error occurs here, solve it and repeat this "make
>> xconfig" step until it's OK
>>
>> # make && make install
>>
>> Add what follows, to the end of the file ~/.bashrc
>>
>> export PATH=/usr/realtime/bin:$PATH
>> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/realtime/lib
>>
>> Create a file /etc/ld.so.conf.d/rtai.conf with the content
>>
>> /usr/realtime/lib
>>
>> and run "ldconfig"in order to take it into account
>>
>> We will test the RTAI system via the latency test
>>
>> # cd /usr/realtime/testsuite/kern/latency
>> # ./run
>>
>> //----------------------------------------------------------
>> -------------------------------
>>
>>
>> _______________________________________________
>> Rtai mailing [email protected]://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>>
>>
>>
>
>

--001a113f697cb5290f0565053b32
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">How to do it?<div>How to switch the legacy support on and =
off?</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">O=
n Mon, Feb 12, 2018 at 10:49 PM, Paolo Mantegazza <span dir=3D"ltr">&lt;<a =
href=3D"mailto:[email protected]" target=3D"_blank">paolo.mantegaz=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20
   =20
 =20
  <div text=3D"#000000" bgcolor=3D"#FFFFFF">
    <div class=3D"m_-2910489949509702935moz-cite-prefix">Have you disabled =
the legacy support?<span class=3D"HOEnZb"><font color=3D"#888888"><br>
      Paolo</font></span><div><div class=3D"h5"><br>
      <br>
      On 02/12/2018 03:41 PM, Guo Yunfei wrote:<br>
    </div></div></div><div><div class=3D"h5">
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">Not.
        <div>I using the patchs in RTAI-5.1 directory.</div>
        <div>I had tried=C2=A0hal-linux-3.10.32-x86-8.<wbr>patch ,</div>
        <div>and hal-linux-3.16.7-x86-5.patch=C2=A0</div>
        <div>and hal-linux-3.18.20-x86-6.patch</div>
        <div><br>
        </div>
        <div>all of them make and make install was successful.</div>
        <div><br>
        </div>
        <div>But when I test the latency by that &quot;run&quot; command.</=
div>
        <div>the computer not response and hang .</div>
        <div>need to =C2=A0power off to reboot.</div>
        <div><br>
        </div>
        <div>BR</div>
        <div>Guo Yunfei</div>
        <div><br>
        </div>
      </div>
      <div class=3D"gmail_extra"><br>
        <div class=3D"gmail_quote">On Mon, Feb 12, 2018 at 10:17 PM, Paolo
          Mantegazza <span dir=3D"ltr">&lt;<a href=3D"mailto:paolo.mantegaz=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex">
            <div text=3D"#000000" bgcolor=3D"#FFFFFF">
              <div class=3D"m_-2910489949509702935m_6538383722746369347moz-=
cite-prefix">Is there
                any 3.8.13 patch in RTAI-5.1? <br>
                Paolo
                <div>
                  <div class=3D"m_-2910489949509702935h5"><br>
                    =C2=A0<br>
                    On 02/12/2018 02:23 PM, Guo Yunfei wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type=3D"cite">
                <div>
                  <div class=3D"m_-2910489949509702935h5">
                    <div dir=3D"ltr">
                      <div><span><br>
                        </span></div>
                      <div><span>Hi. everybody.</span></div>
                      <div><span><br>
                        </span></div>
                      <div><span>I always install RTAI 4.0 and RTAI 4.1
                          on Debian as below steps and using it perfect.</s=
pan></div>
                      <div><span>When I install RTAI 5.1 as same steps.
                          =C2=A0the RTAI 5.1 can be make successfully.</spa=
n></div>
                      <div><span>But the system not reponse after I test
                          the latency by that &quot;run &quot; command.</sp=
an></div>
                      <div><span><br>
                        </span></div>
                      <div><span>Could some one give me a guide of
                          installation of RTAI 5.1 on Debian?</span></div>
                      <div><span><br>
                        </span></div>
                      <div><span>Best Regards</span></div>
                      <div><span>Guo Yunfei</span></div>
                      <div><span><br>
                        </span></div>
                      <span>
                        <div>My steps:<span><br>
                          </span></div>
                        <div><span>//----------------------------<wbr>-----=
---------</span></div>
                        <div>This document describes how to install RTAI
                          4.0 on a Ubuntu 12.04.4 LTS using a 3.8.13
                          kernel, either 32bit or 64 bit version.<br>
                        </div>
                      </span>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_Prerequisites"></a>Prerequisites</h4>
                      <p>Install Ubuntu 12.04.4 using one of the
                        following images:</p>
                      <p><a href=3D"http://releases.ubuntu.com/precise/ubun=
tu-12.04.4-desktop-amd64.iso" target=3D"_blank">http://releases.ubuntu.com/=
pre<wbr>cise/ubuntu-12.04.4-desktop-<wbr>amd64.iso</a></p>
                      <p><a href=3D"http://releases.ubuntu.com/precise/ubun=
tu-12.04.4-desktop-i386.iso" target=3D"_blank">http://releases.ubuntu.com/p=
re<wbr>cise/ubuntu-12.04.4-desktop-<wbr>i386.iso</a></p>
                      <p>And then follow the installation instructions
                        here:=C2=A0<a href=3D"https://help.ubuntu.com/commu=
nity/Installation/" target=3D"_blank">https://help.ubuntu.com/<wbr>communit=
y/Installation/</a></p>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_Introduction"></a>Introduction</h4>
                      <p>If the ROOT user is not created yet, log as
                        your usual user, open a terminal and type -&gt;</p>
                      <pre style=3D"color:rgb(0,0,0)"># sudo su -
# sudo passwd root
</pre>
                      <p>Enter the password for the ROOT user. Log out
                        and log in as Root.</p>
                      <p>Open a terminal and update your package
                        repository source file :</p>
                      <pre style=3D"color:rgb(0,0,0)"># apt-get update
</pre>
                      <p>Some tools are required in order to set up the
                        kernel (You need to be connected to Internet)</p>
                      <pre style=3D"color:rgb(0,0,0)"># apt-get -y install =
qt3-apps-dev build-essential kernel-package vim cvs
</pre>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_I_Kernel_source_and_RTAI_downloa"></a>I - Kernel source
                        and RTAI download</h4>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/src/</pre>
                      <p>Get the kernel source from <a href=3D"http://kerne=
l.org" target=3D"_blank">kernel.org</a></p>
                      <pre style=3D"color:rgb(0,0,0)"># wget <a href=3D"htt=
ps://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.bz2" target=3D"_=
blank">https://www.kernel.org/pub/lin<wbr>ux/kernel/v3.x/linux-3.8.13.<wbr>=
tar.bz2</a>
# tar xf linux-3.8.13.tar.bz2
</pre>
                      <p>Get RTAI 4.0 from the RTAI homepage</p>
                      <pre style=3D"color:rgb(0,0,0)"># wget <a href=3D"htt=
ps://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2" target=3D"_bla=
nk">https://www.rtai.org/userfiles<wbr>/downloads/RTAI/rtai-4.0.tar.<wbr>bz=
2</a>
tar xf rtai-4.0.tar.bz2</pre>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_II_Kernel_Preparation"></a>II - Kernel
                        Preparation</h4>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/src
# ln -s linux-3.8.13 linux
# cd linux </pre>
                      <h5><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_Applying_patch"></a>Applying patch</h5>
                      <p>If you want first simulate the patch
                        application, use &quot;--dry-run&quot; after &quot;=
-p1&quot;. It
                        won&#39;t touch any files on your computer, but you
                        can see if you get Hunks or not.</p>
                      <pre style=3D"color:rgb(0,0,0)"># patch -p1 &lt; /usr=
/src/rtai-4.0/base/arch/x8<wbr>6/patches/hal-linux-3.8.13-x86<wbr>-4.patch
</pre>
                      <h5><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_Kernel_Configuration"></a>Kernel
                        Configuration</h5>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/src/linux</=
pre>
                      <p>In order to retrieve your current kernel
                        configuration : (If at this step, questions are
                        asked give the answer by default)</p>
                      <pre style=3D"color:rgb(0,0,0)"># make oldconfig</pre=
>
                      <p>Now we modify the kernel settings the way we
                        need it (NOTE: some parameters cannot be
                        disabled with xconfig - better to use
                        menuconfig):</p>
                      <pre style=3D"color:rgb(0,0,0)"># make xconfig </pre>
                      <p>Set up the kernel settings as follows :</p>
                      <p><strong>Processor type and features</strong></p>
                      <p>-&gt; Processor family =3D=C2=A0<em>Select yours<b=
r>
                        </em>-&gt; Maximum number of CPUs (NR_CPUS) =3D=C2=
=A0<em>Set
                          your number (it&#39;s generally &quot;4&quot;)</e=
m><br>
                        -&gt; SMT (Hyperthreading) scheduler support =3D=C2=
=A0<em>DISABLE
                          IT</em></p>
                      <p><strong>Power Management and ACPI options</strong>=
<span style=3D"background-color:transparent"></span></p>
                      <p>CPU idle PM support<br>
                        <span style=3D"background-color:transparent">-&gt;
                          Cpu idle Driver for Intel Processors =3D=C2=A0</s=
pan><em style=3D"background-color:transparent">DISABLE
                          IT<br>
                        </em><span style=3D"background-color:transparent">-=
&gt;
                          ACPI (Advanced Configuration and Power
                          Interface) Support -&gt; PROCESSOR =3D=C2=A0</spa=
n><em style=3D"background-color:transparent">DISABLE
                          IT<br>
                        </em><span style=3D"background-color:transparent">-=
&gt;
                          APM (Advanced Power Management) BIOS support
                          =3D=C2=A0</span><em style=3D"background-color:tra=
nsparent">DISABLE
                          IT<br>
                        </em><span style=3D"background-color:transparent">-=
&gt;
                          CPU Frequency scaling -&gt; CPU Frequency
                          scaling =3D=C2=A0</span><em style=3D"background-c=
olor:transparent">DISABLE
                          IT<br>
                        </em><span style=3D"background-color:transparent">C=
PU
                          idle PM support =3D DISABLE IT</span></p>
                      <p>Save and Quit</p>
                      <p>Note (Sylvain, May 2014): these settings should
                        be verified in the .config file, since there
                        have been cases that xconfig does not do it
                        correctly.</p>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_III_Kernel_Compilation"></a><strong>III -
                          Kernel Compilation</strong></h4>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/src/linux
# make &amp;&amp; make modules_install &amp;&amp; make install</pre>
                      <p>NOTE: The compilation time might be decreased
                        by passing the flags -jX (with X=3Dnumber of CPUs
                        you have on your machine). This has for effect
                        to parallelize the kernel compilation between
                        the CPUs. This will take ~1 hour.</p>
                      <h5><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_Kernel_Boot_Options"></a>Kernel Boot Options</h5>
                      <p>This is very important - it took us (and the
                        guys at the RTAI mailing list) ages to find that
                        special config that makes everything work
                        smoothly!</p>
                      <p>You need to add the following option to the
                        kernel at boot time</p>
                      <pre style=3D"color:rgb(0,0,0)">lapic=3Dnotscdeadline=
</pre>
                      <p>The best way to do this is in /etc/default/grub
                        in the field GRUB_CMDLINE_LINUX_DEFAULT, i.e.,</p>
                      <pre style=3D"color:rgb(0,0,0)">GRUB_CMDLINE_LINUX_DE=
FAULT=3D&quot;qu<wbr>iet splash lapic=3Dnotscdeadline&quot;</pre>
                      <p>You will also have to change the GRUB_DEFAULT
                        to the number that corresponds to the new
                        kernel.</p>
                      <p>Finally run update-grub and reboot</p>
                      <pre style=3D"color:rgb(0,0,0)"># update-grub
# reboot
</pre>
                      <h4><a name=3D"m_-2910489949509702935_m_6538383722746=
369347_IV_RTAI_installation"></a><strong>IV - RTAI
                          installation</strong></h4>
                      <p>Now that the system has restarted, make sure
                        you booted on your new=C2=A0<span class=3D"m_-29104=
89949509702935m_6538383722746369347gmail-twikiNewLink"><a href=3D"https://t=
wiki.eurecom.fr/twiki/bin/edit/OpenAirInterface/OpenAir?topicparent=3DOpenA=
irInterface.OpenAirKernel357Ubuntu1204x86Setups;nowysiwyg=3D0" rel=3D"nofol=
low" title=3D"OpenAir (this topic
                            does not yet exist; you can create it)" target=
=3D"_blank">OpenAir</a></span>=C2=A0kernel</p>
                      <pre style=3D"color:rgb(0,0,0)"># uname -r </pre>
                      <p>Should give you &quot;3.8.13&quot; as result</p>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/src/rtai-4.=
0 =20
# make xconfig =20
</pre>
                      <p>UPDATE the CPUs number according to your
                        configuration and disable RTAI_USE_NEWERR and
                        real-time COMEDI support in Add-ons. Enable the
                        watchdog, CONFIG_RTAI_WD.</p>
                      <p>Save and quit. If any error occurs here, solve
                        it and repeat this &quot;make xconfig&quot; step un=
til
                        it&#39;s OK</p>
                      <pre style=3D"color:rgb(0,0,0)"># make &amp;&amp; mak=
e install </pre>
                      <p>Add what follows, to the end of the file
                        ~/.bashrc</p>
                      <pre style=3D"color:rgb(0,0,0)">export PATH=3D/usr/re=
altime/bin:$PATH=20
export LD_LIBRARY_PATH=3D$LD_LIBRARY_PA<wbr>TH:/usr/realtime/lib
</pre>
                      <p>Create a file /etc/ld.so.conf.d/rtai.conf with
                        the content</p>
                      <pre style=3D"color:rgb(0,0,0)">/usr/realtime/lib</pr=
e>
                      <p>and run &quot;ldconfig&quot;in order to take it in=
to
                        account</p>
                      <p>We will test the RTAI system via the latency
                        test</p>
                      <pre style=3D"color:rgb(0,0,0)"># cd /usr/realtime/te=
stsuite/kern/l<wbr>atency =20
# ./run </pre>
                      <div>//----------------------------<wbr>-------------=
-----------------<wbr>------------------------------<wbr>-</div>
                    </div>
                    <br>
                    <fieldset class=3D"m_-2910489949509702935m_653838372274=
6369347mimeAttachmentHeader"></fieldset>
                    <br>
                  </div>
                </div>
                <pre>______________________________<wbr>_________________
Rtai mailing list
<a class=3D"m_-2910489949509702935m_6538383722746369347moz-txt-link-abbrevi=
ated" href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>
<a class=3D"m_-2910489949509702935m_6538383722746369347moz-txt-link-freetex=
t" href=3D"https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai" target=3D"_=
blank">https://mail.rtai.org/cgi-bin/<wbr>mailman/listinfo/rtai</a></pre>
              </blockquote>
              <p><br>
              </p>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <p><br>
    </p>
  </div></div></div>

</blockquote></div><br></div>

--001a113f697cb5290f0565053b32--

--===============3683631303600586673==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
--===============3683631303600586673==--