Re: How to install RTAI 5.1 on Debian?

Guo Yunfei <[email protected]> Mon, 12 Feb 2018 22:41:29 +0800
Newsgroups gmane.linux.real-time.rtai
Message-ID <CAN_Un=Wa+vJBB4bFAvkdiU7NwsLC_-zfBVVkw-JBO=kN=Tu2mQ@mail.gmail.com>
--===============4643487948641599020==
Content-Type: multipart/alternative; boundary="001a1148e120aa90cb056504dffb"

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

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
>
>
>

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

<div dir=3D"ltr">Not.<div>I using the patchs in RTAI-5.1 directory.</div><d=
iv>I had tried=C2=A0hal-linux-3.10.32-x86-8.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; com=
mand.</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</d=
iv><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:[email protected]" target=3D"_blank">paolo.=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=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_6538383722746369347moz-cite-prefix">Is there any 3.8.13=
 patch in RTAI-5.1?
      <br>
      Paolo<div><div class=3D"h5"><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"h5">
     =20
      <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.</span><=
/div>
        <div><span>When I install RTAI 5.1 as
            same steps. =C2=A0the RTAI 5.1 can be make successfully.</span>=
</div>
        <div><span>But the system not reponse
            after I test the latency by that &quot;run &quot; command.</spa=
n></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>--------------</spa=
n></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_6538383722746369347_Prerequisites"></a>Prerequisit=
es</h4>
        <p>Install Ubuntu 12.04.4 using one
          of the following images:</p>
        <p><a href=3D"http://releases.ubuntu.com/precise/ubuntu-12.04.4-des=
ktop-amd64.iso" target=3D"_blank">http://releases.ubuntu.com/<wbr>precise/u=
buntu-12.04.4-<wbr>desktop-amd64.iso</a></p>
        <p><a href=3D"http://releases.ubuntu.com/precise/ubuntu-12.04.4-des=
ktop-i386.iso" target=3D"_blank">http://releases.ubuntu.com/<wbr>precise/ub=
untu-12.04.4-<wbr>desktop-i386.iso</a></p>
        <p>And then follow the installation
          instructions here:=C2=A0<a href=3D"https://help.ubuntu.com/commun=
ity/Installation/" target=3D"_blank">https://help.ubuntu.com/<wbr>community=
/Installation/</a></p>
        <h4><a name=3D"m_6538383722746369347_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 b=
uild-essential kernel-package vim cvs
</pre>
        <h4><a name=3D"m_6538383722746369347_I_Kernel_source_and_RTAI_downl=
oa"></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://kernel.org" target=
=3D"_blank">kernel.org</a></p>
        <pre style=3D"color:rgb(0,0,0)"># wget <a href=3D"https://www.kerne=
l.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.bz2" target=3D"_blank">https:/=
/www.kernel.org/pub/<wbr>linux/kernel/v3.x/linux-3.8.<wbr>13.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"https://www.rtai.=
org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2" target=3D"_blank">https://ww=
w.rtai.org/<wbr>userfiles/downloads/RTAI/rtai-<wbr>4.0.tar.bz2</a>
tar xf rtai-4.0.tar.bz2</pre>
        <h4><a name=3D"m_6538383722746369347_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_6538383722746369347_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/<wbr>x86/patches/hal-linux-3.8.13-<wbr>x86-4.patch
</pre>
        <h5><a name=3D"m_6538383722746369347_Kernel_Configuration"></a>Kern=
el 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<br>
          </em>-&gt; Maximum number of CPUs (NR_CPUS) =3D=C2=A0<em>Set your
            number (it&#39;s generally &quot;4&quot;)</em><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:transparen=
t"></span></p>
        <p>CPU idle PM support<br>
          <span style=3D"background-color:transparent">-&gt; Cpu idle
            Driver for Intel Processors =3D=C2=A0</span><em style=3D"backgr=
ound-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</span><em style=3D"background-color:transpa=
rent">DISABLE
            IT<br>
          </em><span style=3D"background-color:transparent">-&gt; APM
            (Advanced Power Management) BIOS support =3D=C2=A0</span><em st=
yle=3D"background-color:transparent">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-color:transparent">DISABLE IT<br>
          </em><span style=3D"background-color:transparent">CPU 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_6538383722746369347_III_Kernel_Compilation"></a><s=
trong>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_6538383722746369347_Kernel_Boot_Options"></a>Kerne=
l 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_DEFAULT=3D&quot;=
<wbr>quiet 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_6538383722746369347_IV_RTAI_installation"></a><str=
ong>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=
_6538383722746369347gmail-twikiNewLink"><a href=3D"https://twiki.eurecom.fr=
/twiki/bin/edit/OpenAirInterface/OpenAir?topicparent=3DOpenAirInterface.Ope=
nAirKernel357Ubuntu1204x86Setups;nowysiwyg=3D0" rel=3D"nofollow" title=3D"O=
penAir (this topic does not yet
              exist; you can create it)" target=3D"_blank">OpenAir</a></spa=
n>=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; st=
ep
          until it&#39;s OK</p>
        <pre style=3D"color:rgb(0,0,0)"># make &amp;&amp; make install </pr=
e>
        <p>Add what follows, to the end of
          the file ~/.bashrc</p>
        <pre style=3D"color:rgb(0,0,0)">export PATH=3D/usr/realtime/bin:$PA=
TH=20
export LD_LIBRARY_PATH=3D$LD_LIBRARY_<wbr>PATH:/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</pre>
        <p>and run &quot;ldconfig&quot;in order to
          take it into 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/testsuite/kern/<=
wbr>latency =20
# ./run </pre>
        <div>//----------------------------<wbr>---------------------------=
---<wbr>------------------------------<wbr>-</div>
      </div>
      <br>
      <fieldset class=3D"m_6538383722746369347mimeAttachmentHeader"></field=
set>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Rtai mailing list
<a class=3D"m_6538383722746369347moz-txt-link-abbreviated" href=3D"mailto:R=
[email protected]" target=3D"_blank">[email protected]</a>
<a class=3D"m_6538383722746369347moz-txt-link-freetext" href=3D"https://mai=
l.rtai.org/cgi-bin/mailman/listinfo/rtai" target=3D"_blank">https://mail.rt=
ai.org/cgi-bin/<wbr>mailman/listinfo/rtai</a></pre>
    </blockquote>
    <p><br>
    </p>
  </div>

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

--001a1148e120aa90cb056504dffb--

--===============4643487948641599020==
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
--===============4643487948641599020==--