index.html 70.4 KB
Newer Older
Philippe Gerum's avatar
Philippe Gerum committed
1 2 3 4 5 6 7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.8" />
<title>Installing Xenomai 3.x</title>
Philippe Gerum's avatar
Philippe Gerum committed
8 9
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
Philippe Gerum's avatar
Philippe Gerum committed
10

Philippe Gerum's avatar
Philippe Gerum committed
11 12 13 14
/* Default font. */
body {
  font-family: Georgia,serif;
}
Philippe Gerum's avatar
Philippe Gerum committed
15

Philippe Gerum's avatar
Philippe Gerum committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
  font-family: Arial,Helvetica,sans-serif;
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}
h5 {
  font-size: 1.0em;
}

div.sectionbody {
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}


#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}

#footer {
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid #dddddd;
  border-left: 4px solid #f0f0f0;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid #dddddd;
  border-left: 5px solid #f0f0f0;
  background: #f8f8f8;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #f0f0f0;
  color: #888;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > pre.content {
  font-family: inherit;
  font-size: inherit;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}

div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}

div.colist td {
  padding-right: 0.5em;
  padding-bottom: 0.3em;
  vertical-align: top;
}
div.colist td img {
  margin-top: 0.3em;
}

@media print {
  #footer-badges { display: none; }
}

#toc {
  margin-bottom: 2.5em;
}

#toctitle {
  color: #527bbd;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}

span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }

span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }

span.big { font-size: 2em; }
span.small { font-size: 0.6em; }

span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }

div.unbreakable { page-break-inside: avoid; }


/*
 * xhtml11 specific
 *
 * */

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-weight: bold;
  color: #527bbd;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


/*
 * html5 specific
 *
 * */

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
}
p.tableblock {
  margin-top: 0;
}
table.tableblock {
  border-width: 3px;
  border-spacing: 0px;
  border-style: solid;
  border-color: #527bbd;
  border-collapse: collapse;
}
th.tableblock, td.tableblock {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #527bbd;
}

table.tableblock.frame-topbot {
  border-left-style: hidden;
  border-right-style: hidden;
}
table.tableblock.frame-sides {
  border-top-style: hidden;
  border-bottom-style: hidden;
}
table.tableblock.frame-none {
  border-style: hidden;
}

th.tableblock.halign-left, td.tableblock.halign-left {
  text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
  text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
  text-align: right;
}

th.tableblock.valign-top, td.tableblock.valign-top {
  vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
  vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  vertical-align: bottom;
}


/*
 * manpage specific
 *
 * */

body.manpage h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
body.manpage h2 {
  border-style: none;
}
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


</style>
Philippe Gerum's avatar
Philippe Gerum committed
537 538
<script type="text/javascript">
/*<![CDATA[*/
Philippe Gerum's avatar
Philippe Gerum committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  if (!toc) {
    return;
  }

  // Delete existing TOC entries in case we're reloading the TOC.
  var tocEntriesToRemove = [];
  var i;
  for (i = 0; i < toc.childNodes.length; i++) {
    var entry = toc.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div'
     && entry.getAttribute("class")
     && entry.getAttribute("class").match(/^toclevel/))
      tocEntriesToRemove.push(entry);
  }
  for (i = 0; i < tocEntriesToRemove.length; i++) {
    toc.removeChild(tocEntriesToRemove[i]);
  }

  // Rebuild TOC entries.
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  // Delete existing footnote entries in case we're reloading the footnodes.
  var i;
  var noteholder = document.getElementById("footnotes");
  if (!noteholder) {
    return;
  }
  var entriesToRemove = [];
  for (i = 0; i < noteholder.childNodes.length; i++) {
    var entry = noteholder.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
      entriesToRemove.push(entry);
  }
  for (i = 0; i < entriesToRemove.length; i++) {
    noteholder.removeChild(entriesToRemove[i]);
  }

  // Rebuild footnote entries.
  var cont = document.getElementById("content");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      var note = spans[i].getAttribute("data-note");
      if (!note) {
        // Use [\s\S] in place of . so multi-line matches work.
        // Because JavaScript has no s (dotall) regex flag.
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
        spans[i].innerHTML =
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
        spans[i].setAttribute("data-note", note);
      }
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
},

install: function(toclevels) {
  var timerId;

  function reinstall() {
    asciidoc.footnotes();
    if (toclevels) {
      asciidoc.toc(toclevels);
    }
  }

  function reinstallAndRemoveTimer() {
    clearInterval(timerId);
    reinstall();
  }

  timerId = setInterval(reinstall, 500);
  if (document.addEventListener)
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  else
    window.onload = reinstallAndRemoveTimer;
}

}
Philippe Gerum's avatar
Philippe Gerum committed
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
asciidoc.install(3);
/*]]>*/
</script>
</head>
<body class="article" style="max-width:55em">
<div id="header">
<h1>Installing Xenomai 3.x</h1>
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_introduction">1. Introduction</h2>
<div class="sectionbody">
Philippe Gerum's avatar
Philippe Gerum committed
744 745 746 747 748 749 750
<div class="paragraph"><p>Xenomai 3 is the new architecture of the Xenomai real-time framework,
which can run seamlessly side-by-side Linux as a co-kernel system like
Xenomai 2, or natively over mainline Linux kernels.  In the latter
case, the mainline kernel can be supplemented by the
<a href="https://www.kernel.org/pub/linux/kernel/projects/rt/">PREEMPT-RT patch</a>
to meet stricter response time requirements than standard kernel
preemption would bring.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
751 752 753 754 755 756
<div class="paragraph"><p>This new architecture therefore exhibits two real-time cores, selected
at build time. The dual kernel core nicknamed <em>Cobalt</em>, is a
significant rework of the Xenomai 2.x system. The native linux
version, an enhanced implementation of the experimental
<a href="http://www.osadl.org/Migration-Portability.migration-portability.0.html">Xenomai/SOLO</a>
work, is called <em>Mercury</em>.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
757
<div class="paragraph"><p>This magic works with the introduction of the <em>Copperplate</em> interface,
Philippe Gerum's avatar
Philippe Gerum committed
758 759
which mediates between the real-time API/emulator your application
uses, and the underlying real-time core. This way, applications are
Philippe Gerum's avatar
Philippe Gerum committed
760
able to run in either environments without visible code change.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
761 762 763 764 765 766 767 768 769
</div>
</div>
<div class="sect1">
<h2 id="_installation_steps">2. Installation steps</h2>
<div class="sectionbody">
<div class="paragraph"><p>Xenomai follows a split source model, decoupling the kernel space
support from the user-space libraries.</p></div>
<div class="paragraph"><p>To this end, kernel and user-space Xenomai components are respectively
available under the <code>kernel/</code> and <code>lib/</code> sub-trees. Other top-level
Philippe Gerum's avatar
Philippe Gerum committed
770
directories, such as <code>scripts/</code>, <code>testsuite/</code> and <code>utils/</code>, provide
Philippe Gerum's avatar
Philippe Gerum committed
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838
additional scripts and programs to be used on either the build host,
or the runtime target.</p></div>
<div class="paragraph"><p>The <code>kernel/</code> sub-tree which implements the in-kernel support code is
seen as a built-in extension of the Linux kernel.  Therefore, the
standard Linux kernel configuration process should be used to define
the various settings for the Xenomai kernel components. All of the
kernel code Xenomai currently introduces implements the <em>Cobalt</em> core
(i.e. dual kernel configuration). As of today, the <em>Mercury</em> core
needs no Xenomai-specific code in kernel space.</p></div>
<div class="paragraph"><p>The <code>lib/</code> sub-tree contains the various user-space libraries exported
by the Xenomai framework to the applications. This tree is built
separately from the kernel support. Libraries are built in order to
support the selected core, either <em>Cobalt</em> or <em>Mercury</em>.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="cobalt-core-install">3. Installing the <em>Cobalt</em> core</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_preparing_the_em_cobalt_em_kernel">3.1. Preparing the <em>Cobalt</em> kernel</h3>
<div class="paragraph"><p><em>Xenomai/cobalt</em> provides a real-time extension kernel seamlessly
integrated to Linux, therefore the first step is to build it as part
of the target kernel. To this end, <code>scripts/prepare-kernel.sh</code> is a
shell script which sets up the target kernel properly. The syntax is
as follows:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ scripts/prepare-kernel.sh [--linux=&lt;linux-srctree&gt;]
[--ipipe=&lt;ipipe-patch&gt;] [--arch=&lt;target-arch&gt;]</code></pre>
</div></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>--linux</code>
</dt>
<dd>
<p>
specifies the path of the target kernel source tree. Such
    kernel tree may be already configured or not, indifferently. This
    path defaults to $PWD.
</p>
</dd>
<dt class="hdlist1">
<code>--ipipe</code>
</dt>
<dd>
<p>
specifies the path of the interrupt pipeline (aka I-pipe)
    patch to apply against the kernel tree. Suitable patches are
    available with <em>Xenomai/cobalt</em> under
    <code>kernel/cobalt/arch/&lt;target-arch&gt;/patches</code>. This parameter can be
    omitted if the I-pipe has already been patched in, or the script
    shall suggest an appropriate one. The script will detect whether
    the interrupt pipeline code is already present into the kernel
    tree, and skip this operation if so.
</p>
</dd>
<dt class="hdlist1">
<code>--arch</code>
</dt>
<dd>
<p>
tells the script about the target architecture. If
    unspecified, the build host architecture suggested as a reasonable
    default.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>For instance, the following command would prepare the Linux tree
Philippe Gerum's avatar
Philippe Gerum committed
839
located at <code>/home/me/linux-3.10-ipipe</code> in order to patch the Xenomai
Philippe Gerum's avatar
Philippe Gerum committed
840 841 842
support in:</p></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
843
<pre><code>$ cd xenomai-3
Philippe Gerum's avatar
Philippe Gerum committed
844
$ scripts/prepare-kernel.sh --linux=/home/me/linux-3.10</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
845 846 847
</div></div>
<div class="paragraph"><p>Note: The script will infer the location of the Xenomai kernel code
from its own location within the Xenomai source tree. For instance, if
Philippe Gerum's avatar
Philippe Gerum committed
848
<code>/home/me/xenomai-3/scripts/prepare-kernel.sh</code> is executing, then
Philippe Gerum's avatar
Philippe Gerum committed
849
the Xenomai kernel code available from
Philippe Gerum's avatar
Philippe Gerum committed
850
<code>/home/me/xenomai-3/kernel/cobalt</code> will be patched in the target
Philippe Gerum's avatar
Philippe Gerum committed
851 852 853 854 855 856 857 858
Linux kernel.</p></div>
</div>
<div class="sect2">
<h3 id="_configuring_and_compiling_the_em_cobalt_em_kernel">3.2. Configuring and compiling the <em>Cobalt</em> kernel</h3>
<div class="paragraph"><p>Once prepared, the target kernel can be configured as usual. All
Xenomai configuration options are available from the "Xenomai"
toplevel Kconfig menu.</p></div>
<div class="paragraph"><p>There are several important kernel configuration options, documented
Philippe Gerum's avatar
Philippe Gerum committed
859 860
in the <a href="troubleshooting-a-dual-kernel-configuration#kconf">TROUBLESHOOTING</a>
guide.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
861 862 863 864 865 866 867 868 869 870 871 872 873
<div class="paragraph"><p>Once configured, the kernel can be compiled as usual.</p></div>
<div class="paragraph"><p>If you want several different configs/builds at hand, you may reuse
the same source by adding <code>O=../build-&lt;target&gt;</code> to each make
invocation.</p></div>
<div class="paragraph"><p>In order to cross-compile the Linux kernel, pass an ARCH and
CROSS_COMPILE variable on make command line. See sections
<a href="#cobalt-core-arm">"Building a <em>Cobalt/arm</em> kernel"</a>,
<a href="#cobalt-core-powerpc">"Building a <em>Cobalt/powerpc</em> kernel"</a>,
<a href="#cobalt-core-blackfin">"Building a <em>Cobalt/blackfin</em> kernel"</a>,
<a href="#cobalt-core-x86">"Building a <em>Cobalt/x86</em> kernel"</a>,
for examples.</p></div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955
<h3 id="cobalt-kernel-parameters">3.3. <em>Cobalt</em> kernel parameters</h3>
<div class="paragraph"><p>The Cobalt kernel accepts the following set of parameters, which
should be passed on the kernel command line by the boot loader.</p></div>
<div class="tableblock">
<table rules="cols"
width="100%"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="33%" />
<col width="50%" />
<col width="16%" />
<thead>
<tr>
<th align="center" valign="top">NAME              </th>
<th align="center" valign="top">DESCRIPTION                    </th>
<th align="center" valign="top">DEFAULT</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">xenomai.allowed_group=&lt;gid&gt;</p></td>
<td align="left" valign="top"><p class="table">Enable non-root access to Xenomai
services from user-space.  &lt;gid&gt; is the ID of the Linux user group
whose members should be allowed such access by the Cobalt core.</p></td>
<td align="left" valign="top"><p class="table">None</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.sysheap_size=&lt;kbytes&gt;</p></td>
<td align="left" valign="top"><p class="table">Set the size of the memory heap used
internally by the Cobalt core to allocate runtime objects.  This value
is expressed in kilo-bytes.</p></td>
<td align="left" valign="top"><p class="table">256</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.state=&lt;state&gt;</p></td>
<td align="left" valign="top"><p class="table">Set the initial state of the Cobalt core at
boot up, which may be <em>enabled</em>, <em>stopped</em> or <em>disabled</em>. See the
documentation about the
<a href="../documentation/xenomai-3/html/man1/corectl/index.html">corectl(1)</a>
utility for a description of these states.</p></td>
<td align="left" valign="top"><p class="table">enabled</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.clockfreq=&lt;hz-freq&gt;</p></td>
<td align="left" valign="top"><p class="table">Override the real-time clock frequency
used in measuring time intervals with the given value. The most
accurate value is normally determined by the Cobalt core automatically
when initializing. It is strongly recommended <strong>not</strong> to use this option
unless you really know what you are doing. This value is expressed in
HZ.</p></td>
<td align="left" valign="top"><p class="table">0 (=calibrated)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.timerfreq=&lt;hz-freq&gt;</p></td>
<td align="left" valign="top"><p class="table">Override the real-time timer frequency
used in programming timer shots with the given value. The most
accurate value is normally determined by the Cobalt core automatically
when initializing. It is strongly recommended <strong>not</strong> to use this option
unless you really know what you are doing. This value is expressed in
HZ.</p></td>
<td align="left" valign="top"><p class="table">0 (=calibrated)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.smi=&lt;state&gt;</p></td>
<td align="left" valign="top"><p class="table"><strong>x86-specific</strong>: Set the state of the SMI
workaround. The possible values are <em>disabled</em>, <em>detect</em> and
<em>enabled</em>. See the discussion about <a href="dealing-with-x86-SMI">SMIs</a>
for a description of these states.</p></td>
<td align="left" valign="top"><p class="table">detect</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">xenomai.smi_mask=&lt;source-mask&gt;</p></td>
<td align="left" valign="top"><p class="table"><strong>x86-specific</strong>: Set of bits to mask
in the SMI control register.</p></td>
<td align="left" valign="top"><p class="table">1 (=global disable)</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="cobalt-build-examples">3.4. Examples of building the <em>Cobalt</em> kernel</h3>
Philippe Gerum's avatar
Philippe Gerum committed
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
<div class="paragraph"><p>The examples in following sections use the following conventions:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>$linux_tree</code>
</dt>
<dd>
<p>
path to the target kernel sources
</p>
</dd>
<dt class="hdlist1">
<code>$xenomai_root</code>
</dt>
<dd>
<p>
path to the Xenomai sources
</p>
</dd>
</dl></div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
976
<h4 id="cobalt-core-x86">3.4.1. Building a <em>Cobalt/x86</em> kernel (32/64bit)</h4>
Philippe Gerum's avatar
Philippe Gerum committed
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991
<div class="paragraph"><p>Building <em>Xenomai/cobalt</em> for x86 is almost the same for 32bit and 64bit
platforms. You should note, however, that it is not possible to run
Xenomai libraries compiled for x86_32 on a kernel compiled for x86_64,
and conversely.</p></div>
<div class="paragraph"><p>Assuming that you want to build natively for a x86_64 system (x86_32
cross-build options from x86_64 appear between brackets), you would
typically run:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=x86 \
  --ipipe=$xenomai_root/kernel/cobalt/arch/x86/patches/ipipe-core-X.Y.Z-x86-NN.patch
$ make [ARCH=i386] xconfig/gconfig/menuconfig</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;configure the kernel (see also the recommended settings
Philippe Gerum's avatar
Philippe Gerum committed
992
<a href="configuring-for-x86-based-dual-kernels">here</a>).</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
<div class="paragraph"><p>Enable Xenomai options, then build with:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ make [ARCH=i386] bzImage modules</code></pre>
</div></div>
<div class="paragraph"><p>Now, let&#8217;s say that you really want to build Xenomai for a
Pentium-based x86 32bit platform, using the native host toolchain; the
typical steps would be as follows:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=i386 \
  --ipipe=$xenomai_root/kernel/cobalt/arch/x86/patches/ipipe-core-X.Y.Z-x86-NN.patch
$ make xconfig/gconfig/menuconfig</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;configure the kernel (see also the recommended settings
Philippe Gerum's avatar
Philippe Gerum committed
1009
<a href="configuring-for-x86-based-dual-kernels">here</a>).</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
<div class="paragraph"><p>Enable Xenomai options, then build with:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ make bzImage modules</code></pre>
</div></div>
<div class="paragraph"><p>Similarly, for a 64bit platform, you would use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=x86_64 \
  --ipipe=$xenomai_root/kernel/cobalt/arch/x86/patches/ipipe-core-X.Y.Z-x86-NN.patch
$ make xconfig/gconfig/menuconfig</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;configure the kernel (see also the recommended settings
Philippe Gerum's avatar
Philippe Gerum committed
1024
<a href="configuring-for-x86-based-dual-kernels">here</a>).</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
<div class="paragraph"><p>Enable Xenomai options, then build with:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ make bzImage modules</code></pre>
</div></div>
<div class="paragraph"><p>The remaining examples illustrate how to cross-compile a
<em>Cobalt</em>-enabled kernel for various architectures. Of course, you would
have to install the proper cross-compilation toolchain for the target
system first.</p></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1036
<h4 id="cobalt-core-powerpc">3.4.2. Building a <em>Cobalt/powerpc</em> kernel (32/64bit)</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1037
<div class="paragraph"><p>A typical cross-compilation setup, in order to build Xenomai for a
Philippe Gerum's avatar
Philippe Gerum committed
1038
ppc-6xx architecture running a 3.10.32 kernel. We use the DENX ELDK
Philippe Gerum's avatar
Philippe Gerum committed
1039 1040 1041 1042 1043
cross-compiler:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=powerpc \
Philippe Gerum's avatar
Philippe Gerum committed
1044
  --ipipe=$xenomai_root/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.10.32-powerpc-1.patch
Philippe Gerum's avatar
Philippe Gerum committed
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054
$ make ARCH=powerpc CROSS_COMPILE=ppc_6xx- xconfig/gconfig/menuconfig</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;select the kernel and Xenomai options, save the configuration</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux- uImage modules</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;manually install the kernel image and modules to the proper location</p></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1055
<h4 id="cobalt-core-blackfin">3.4.3. Building a <em>Cobalt/blackfin</em> kernel</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
<div class="paragraph"><p>The Blackfin is a MMU-less, DSP-type architecture running uClinux.</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=blackfin \
  --ipipe=$xenomai_root/kernel/cobalt/arch/blackfin/patches/ipipe-core-X.Y.Z-x86-NN.patch
$ make ARCH=blackfin CROSS_COMPILE=bfin-uclinux- xconfig/gconfig/menuconfig</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;select the kernel and Xenomai options, then compile with:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ make linux image</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;then install as needed</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cp images/linux /tftpboot/...</code></pre>
</div></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1076
<h4 id="cobalt-core-arm">3.4.4. Building  <em>Cobalt/arm</em> kernel</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
<div class="paragraph"><p>Using codesourcery toolchain named <code>arm-none-linux-gnueabi-gcc</code> and
compiling for a CSB637 board (AT91RM9200 based), a typical compilation
will look like:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=arm \
  --ipipe=$xenomai_root/kernel/cobalt/arch/arm/patches/ipipe-core-X.Y.Z-x86-NN.patch
$ mkdir -p $build_root/linux
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- O=$build_root/linux \
  csb637_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- O=$build_root/linux \
  bzImage modules</code></pre>
</div></div>
<div class="paragraph"><p>&#8230;manually install the kernel image, system map and modules to the proper location</p></div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="mercury-core-install">4. Installing the <em>Mercury</em> core</h2>
<div class="sectionbody">
<div class="paragraph"><p>For <em>Mercury</em>, you need no Xenomai-specific kernel support so far,
beyond what your host Linux kernel already provides. Your kernel
should at least provide high resolution timer support
(<code>CONFIG_HIGH_RES_TIMERS</code>), and likely complete preemption
(<em>PREEMPT_RT</em>) if your application requires short and bounded
latencies.</p></div>
<div class="paragraph"><p>Kernels with no real-time support can be used too, likely for basic
debugging tasks, and/or running applications which do not have strict
response time requirements.</p></div>
<div class="paragraph"><p>Therefore, unlike with <em>Cobalt</em>, there is no additional steps for
preparing and/or configuring the kernel for <em>Mercury</em>.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="library-install">5. Installing the Xenomai libraries and tools</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_prerequisites">5.1. Prerequisites</h3>
<div class="sect3">
<h4 id="_generic_requirements_both_cores">5.1.1. Generic requirements (both cores)</h4>
<div class="ulist"><ul>
<li>
<p>
GCC must have support for legacy atomic builtins (__sync form).
</p>
</li>
<li>
<p>
GCC should have a (sane/working) support for TLS preferably,
although this is not mandatory if building with <code>--disable-tls</code>.
</p>
</li>
Philippe Gerum's avatar
Philippe Gerum committed
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144
<li>
<p>
If you plan to enable the user-space registry support
  (i.e. <code>--enable-registry</code>), then CONFIG_FUSE_FS must be enabled in
  the target kernel running the real-time applications. In addition,
  the FUSE development libraries must be available from the toolchain.
</p>
</li>
<li>
<p>
If you plan to build from the sources available from the Xenomai GIT
  tree (git.xenomai.org), the autoconf (&gt;= 2.62), automake and libtool
  packages must be available on your build system. This is not
  required when building from a source tree extracted from a
Philippe Gerum's avatar
Philippe Gerum committed
1145
  <a href="/downloads/xenomai/">release tarball</a>.
Philippe Gerum's avatar
Philippe Gerum committed
1146 1147
</p>
</li>
Philippe Gerum's avatar
Philippe Gerum committed
1148 1149 1150 1151 1152 1153 1154
</ul></div>
</div>
<div class="sect3">
<h4 id="_em_cobalt_em_specific_requirements">5.1.2. <em>Cobalt</em>-specific requirements</h4>
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1155
The kernel version must be 3.10 or better.
Philippe Gerum's avatar
Philippe Gerum committed
1156 1157 1158 1159 1160 1161
</p>
</li>
<li>
<p>
An interrupt pipeline (I-pipe) patch must be available for your
  target kernel. You can find the official patches issued by the
Philippe Gerum's avatar
Philippe Gerum committed
1162
  Xenomai project <a href="/downloads/ipipe/">there</a>.
Philippe Gerum's avatar
Philippe Gerum committed
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180
  Only patches from the <strong>ipipe-core</strong> series are appropriate, legacy
  patches from the <strong>adeos-ipipe</strong> series are not.
</p>
</li>
<li>
<p>
A timestamp counter (TSC) is required from running on a x86_32
  hardware. Unlike with Xenomai 2.x, TSC-emulation using a PIT
  register is not available.
</p>
</li>
</ul></div>
</div>
<div class="sect3">
<h4 id="_em_mercury_em_specific_requirement">5.1.3. <em>Mercury</em>-specific requirement</h4>
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1181 1182
There is no particular requirement for Mercury setups, although
  using a NPTL-based glibc or uClibc is recommended.
Philippe Gerum's avatar
Philippe Gerum committed
1183 1184 1185 1186 1187 1188 1189
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect2">
<h3 id="_configuring">5.2. Configuring</h3>
Philippe Gerum's avatar
Philippe Gerum committed
1190 1191 1192 1193 1194 1195 1196 1197 1198
<div class="paragraph"><p>If building the source obtained from the Xenomai GIT tree
(git.xenomai.org), the <code>configure</code> script and Makefiles must be
generated in the Xenomai source tree. The recommended way is to run
the automatic reconfiguration script shipped, from the top of the
source tree:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ ./scripts/bootstrap</code></pre>
</div></div>
Philippe Gerum's avatar
Philippe Gerum committed
1199 1200 1201
<div class="paragraph"><p>If building from a <a href="/downloads/xenomai/">release tarball</a>, a set of
autoconf-generated file will be readily available from the extracted
source tree, and therefore reconfiguring will not be required.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1202 1203 1204 1205
<div class="paragraph"><p>When run, the generated <code>configure</code> script prepares for building the
libraries and programs, for both the <em>Cobalt</em> and <em>Mercury</em> cores. The
core-specific code which may be needed internally is automatically and
transparently selected at compilation-time by the build process.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308
<div class="paragraph"><p>The options listed below can be passed to this script.</p></div>
<div class="sect3">
<h4 id="_generic_configuration_options_both_cores">5.2.1. Generic configuration options (both cores)</h4>
<div class="hdlist"><table>
<tr>
<td class="hdlist1">
<strong>--with=core=&lt;type&gt;</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        Indicates which real-time core you want to build the support
        libraries for, namely <em>cobalt</em> or <em>mercury</em>. This option
        defaults to <em>cobalt</em>.
</p>
</td>
</tr>
<tr>
<td class="hdlist1">
<strong>--prefix=&lt;dir&gt;</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        Specifies the root installation path for libraries, include
        files, scripts and executables. Running <code>$ make install</code>
        installs these files to <code>$DESTDIR/&lt;dir&gt;</code>.  This directory
        defaults to /usr/xenomai.
</p>
</td>
</tr>
<tr>
<td class="hdlist1">
<strong>--enable-debug[=partial]</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        This switch controls the debug level. Three levels are
        available, with varying overhead:
</p>
<div class="ulist"><ul>
<li>
<p>
<em>symbols</em> enables debug symbols to be compiled in the
        libraries and executables, still turning on the optimizer
        (-O2). This option has no overhead, it is useful to get
        meaningful backtraces using gdb while running the application
        at nominal speed.
</p>
</li>
<li>
<p>
<em>partial</em> includes <em>symbols</em>, and also turns on internal
        consistency checks within the Xenomai code (mostly present in
        the Copperplate layer). The <code>CONFIG_XENO_DEBUG</code> macro is
        defined, for both the Xenomai libraries and the applications
        getting their C compilation flags from the <code>xeno-config</code>
        script (i.e. <code>xeno-config --cflags</code>). The partial debug mode
        implicitly turns on <code>--enable-assert</code>. A measurable overhead
        is introduced by this level.  This is the default level when
        <code>--enable-debug</code> is mentioned with no level specification.
</p>
</li>
<li>
<p>
<em>full</em> includes <em>partial</em> settings, but the optimizer is
        disabled (-O0), and even more consistency checks may be
        performed.  In addition to <code>__XENO_DEBUG__</code>, the macro
        <code>CONFIG_XENO_DEBUG_FULL</code> is defined. This level introduces the
        most overhead, which may triple the worst-case latency, or
        even more.
</p>
<div class="paragraph"><p>Over the <em>Mercury</em> core, enabling <em>partial</em> or <em>full</em> debug
modes also causes the standard malloc interface to be used
internally instead of a fast real-time allocator (TLSF). This
allows debugging memory-related issues with the help of
<em>Valgrind</em> or other dynamic memory analysers.</p></div>
</li>
</ul></div>
</td>
</tr>
<tr>
<td class="hdlist1">
<strong>--disable-debug</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
         Fully turns off all consistency checks and assertions, turns
         on the optimizer and disables debug symbol generation.
</p>
</td>
</tr>
<tr>
<td class="hdlist1">
<strong>--enable-assert</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        A number of debug assertion statements are present into the
        Xenomai libraries, checking the internal consistency of the
Philippe Gerum's avatar
Philippe Gerum committed
1309
        runtime system dynamically (see <em>man assert(3)</em>). Passing
Philippe Gerum's avatar
Philippe Gerum committed
1310
        <code>--disable-assert</code> to the <em>configure</em> script disables built-in
Philippe Gerum's avatar
Philippe Gerum committed
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330
        assertions unconditionally. By default, assertions are enabled
        in partial or full debug modes, disabled otherwise.
</p>
</td>
</tr>
<tr>
<td class="hdlist1">
<strong>--enable-pshared</strong>
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        Enable shared multi-processing. When enabled, this option
        allows multiple processes to share real-time objects
        (e.g. tasks, semaphores).
</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Philippe Gerum's avatar
Philippe Gerum committed
1331
<strong>--enable-registry[=/registry-root-path]</strong>
Philippe Gerum's avatar
Philippe Gerum committed
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342
<br />
</td>
<td class="hdlist2">
<p style="margin-top: 0;">
        Xenomai APIs can export their internal state through a
        pseudo-filesystem, which files may be read to obtain
        information about the existing real-time objects, such as
        tasks, semaphores, message queues and so on.  This feature is
        supported by <a href="http://fuse.sourceforge.net/">FUSE</a>, which must be
        available on the target system. Building the Xenomai libraries
        with the registry support requires the FUSE development
Philippe Gerum's avatar
Philippe Gerum committed
1343 1344
        libraries to available from the toolchain. In addition,
        CONFIG_FUSE_FS must be enabled in the target kernel.
Philippe Gerum's avatar
Philippe Gerum committed
1345 1346 1347 1348
</p>
</td>
</tr>
</table></div>
Philippe Gerum's avatar
Philippe Gerum committed
1349 1350 1351 1352 1353 1354 1355 1356
<div class="paragraph"><p>When this option is enabled, the system creates a file hierachy at
<code>&lt;user&gt;/&lt;session&gt;/&lt;pid&gt;</code> under the registry root path, where you
can access the internal state of the active real-time objects. The
session label is obtained from the --session runtime switch. If no
session name is specified, <code>anon@&lt;pid&gt;</code> will be used. E.g. looking at
the properties of a VxWorks task could be done as follows:</p></div>
<div class="paragraph"><p>If not specified in the configuration switch, the registry root path
will be <code>/var/run/xenomai</code>.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1357 1358
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1359 1360 1361 1362 1363 1364
<pre><code>$ cat /var/run/xenomai/root/anon@12656/12656/vxworks/tasks/windTask
name       = windTask
errno      = 0
status     = ready
priority   = 70
lock_depth = 0</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
1365
</div></div>
Philippe Gerum's avatar
Philippe Gerum committed
1366 1367 1368 1369 1370
<div class="paragraph"><p>You may override the default root of the registry hierarchy
either statically at build time by passing the desired root
path to the --enable-registry configuration switch, or
dynamically by using the <code>--registry-root</code> runtime option
passed to the application.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1371 1372 1373 1374 1375
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
Philippe Gerum's avatar
Philippe Gerum committed
1376 1377
<td class="content">When running over <em>Xenomai/cobalt</em>, the <code>/proc/xenomai</code> interface is
also available for inspecting the core system state.</td>
Philippe Gerum's avatar
Philippe Gerum committed
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
</tr></table>
</div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--enable-lores-clock</strong>
</dt>
<dd>
<p>
        Enables support for low resolution clocks. By default,
        libraries are built with no support for tick-based timing. If
        you need such support (e.g. for pSOS &#8482; or VxWorks &#8482;
        APIs), then you can turn it on using this option.
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
Philippe Gerum's avatar
Philippe Gerum committed
1398 1399
<td class="content">The POSIX API does not support tick-based timing. Alchemy may use it
optionally.</td>
Philippe Gerum's avatar
Philippe Gerum committed
1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
</tr></table>
</div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--enable-clock-monotonic-raw</strong>
</dt>
<dd>
<p>
        The Xenomai libraries requires a monotonic clock to be
        available from the underlying POSIX interface. When
        <code>CLOCK_MONOTONIC_RAW</code> is available on your system, you may
        want to pass this switch, otherwise <code>CLOCK_MONOTONIC</code> will be
        used by default.
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
Philippe Gerum's avatar
Philippe Gerum committed
1421 1422 1423 1424
<td class="content">The <em>Cobalt</em> core implements <code>CLOCK_MONOTONIC_RAW</code>, so this switch is
turned on by default when building with <code>--with-core=cobalt</code>. On the
contrary, this option is turned off by default when building for the
<em>Mercury</em> core, since we don&#8217;t know in advance whether this feature
Philippe Gerum's avatar
Philippe Gerum committed
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443
does exist on the target kernel.</td>
</tr></table>
</div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--enable-tls</strong>
</dt>
<dd>
<p>
        Xenomai can use GCC&#8217;s thread local storage extension (TLS) to
        speed up the retrieval of the per-thread information it uses
        internally. This switch enables TLS, use the converse
        <code>--disable-tls</code> to prevent this.
</p>
<div class="paragraph"><p>Due to GCC bugs regarding this feature with some
release,architecture combinations, whether TLS is turned on by
default is a per-architecture decision. Currently, this
feature is enabled for x86 and powerpc by default, other
architectures will require <code>--enable-tls</code> to be passed to the
Philippe Gerum's avatar
Philippe Gerum committed
1444
<em>configure</em> script explicitly.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470
<div class="paragraph"><p>Unless <code>--enable-dlopen-libs</code> is present, the <em>initial-exec</em>
TLS model is selected.</p></div>
<div class="paragraph"><p>When TLS is disabled, POSIX&#8217;s thread-specific data management
services are used internally (i.e. pthread_set/getspecific()).</p></div>
</dd>
<dt class="hdlist1">
<strong>--enable-dlopen-libs</strong>
</dt>
<dd>
<p>
        This switch allows programs to load Xenomai-based libraries
        dynamically, using the <code>dlopen(3)</code> routine. Enabling dynamic
        loading introduces some overhead in TLS accesses when enabled
        (see <code>--enable-tls</code>), which might be noticeable depending on
        the architecture.
</p>
<div class="paragraph"><p>To support dynamic loading when <code>--enable-tls</code> is turned on,
the <em>global-dynamic</em> TLS model is automatically selected.</p></div>
<div class="paragraph"><p>Dynamic loading of Xenomai-based libraries is disabled by
default.</p></div>
</dd>
<dt class="hdlist1">
<strong>--enable-async-cancel</strong>
</dt>
<dd>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1471 1472 1473
        Enables fully asynchronous cancellation of Xenomai threads
        created by the real-time APIs, making provision to protect the
        Xenomai implementation code accordingly.
Philippe Gerum's avatar
Philippe Gerum committed
1474 1475 1476
</p>
<div class="paragraph"><p>When disabled, Xenomai assumes that threads may exit due to
cancellation requests only when they reach cancellation points
Philippe Gerum's avatar
Philippe Gerum committed
1477 1478
(like system calls). Asynchronous cancellation is disabled
by default.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1479
</dd>
Philippe Gerum's avatar
Philippe Gerum committed
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/caution.png" alt="Caution" />
</td>
<td class="content">Fully asynchronous cancellation can easily lead to resource leakage,
silent corruption, safety issues and all sorts of rampant bugs. The
only reason to turn this feature on would be aimed at cancelling
threads which run significantly long, syscall-less busy loops with no
explicit exit condition, which should probably be revisited anyway.</td>
</tr></table>
</div>
<div class="dlist"><dl>
Philippe Gerum's avatar
Philippe Gerum committed
1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
<dt class="hdlist1">
<strong>--enable-smp</strong>
</dt>
<dd>
<p>
        Turns on SMP support for Xenomai libraries.
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/caution.png" alt="Caution" />
</td>
<td class="content">SMP support must be enabled in Xenomai libraries when the
client applications are running over a SMP-capable kernel.</td>
</tr></table>
</div>
<div class="dlist"><dl>
<dt class="hdlist1">
Philippe Gerum's avatar
Philippe Gerum committed
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
<strong>--disable-sanity</strong>
</dt>
<dd>
<p>
        Turns off the sanity checks performed at application startup
        by the Xenomai libraries. This option sets a default, which
        can later be overriden using the --[no-]sanity options passed
        to a Copperplate-based Xenomai application. Sanity checks are
        enabled by default when configuring.
</p>
</dd>
<dt class="hdlist1">
Philippe Gerum's avatar
Philippe Gerum committed
1526 1527 1528 1529
<strong>--enable-fortify</strong>
</dt>
<dd>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1530 1531 1532
        Enables <code>_FORTIFY_SOURCE</code> when building the Xenomai code
        unless --enable-debug=full is also given on the command line,
        in which case --enable-fortify is silently ignored.
Philippe Gerum's avatar
Philippe Gerum committed
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544
</p>
</dd>
<dt class="hdlist1">
<strong>--disable-valgrind-client</strong>
</dt>
<dd>
<p>
        Turns off the Valgrind client support, forcing
        <code>CONFIG_XENO_VALGRIND_API</code> off in the Xenomai configuration
        header.
</p>
</dd>
Philippe Gerum's avatar
Philippe Gerum committed
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567
<dt class="hdlist1">
<strong>--enable-doc-build</strong>
</dt>
<dd>
<p>
        Causes the inline Xenomai documentation based on the
        <a href="http://doxygen.org">Doxygen markup language</a> to be produced as
        PDF and HTML documents. Additional documentation like manpages
        based on the <a href="http://asciidoc.org/">Asciidoc markup language</a> is
        produced too.
</p>
<div class="paragraph"><p>A pre-built copy of the documentation is present in the source
tree, under the <code>doc/generated/</code> file hierarchy.</p></div>
</dd>
<dt class="hdlist1">
<strong>--disable-doc-install</strong>
</dt>
<dd>
<p>
        Disables the copying of the pre-built documentation to the
        installation directory.
</p>
</dd>
Philippe Gerum's avatar
Philippe Gerum committed
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583
</dl></div>
</div>
<div class="sect3">
<h4 id="_em_cobalt_em_specific_configuration_options">5.2.2. <em>Cobalt</em>-specific configuration options</h4>
<div class="tableblock">
<table rules="cols"
width="100%"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="33%" />
<col width="33%" />
<col width="33%" />
<thead>
<tr>
<th align="center" valign="top">NAME              </th>
<th align="center" valign="top">DESCRIPTION                    </th>
Philippe Gerum's avatar
Philippe Gerum committed
1584
<th align="center" valign="top">DEFAULT</th>
Philippe Gerum's avatar
Philippe Gerum committed
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table"><code>--enable-x86-vsyscall</code></p></td>
<td align="left" valign="top"><p class="table">Use the x86/vsyscall interface
                        for issuing syscalls. If disabled,
                        the legacy 0x80 vector will be used.
                        Turning on this option requires NPTL.</p></td>
<td align="left" valign="top"><p class="table">enabled</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>--enable-arm-tsc</code></p></td>
<td align="left" valign="top"><p class="table">Enable ARM TSC emulation.
                        <span class="footnote"><br />[In the unusual
                        situation where Xenomai
                        does not support the kuser generic
                        emulation for the target SOC, use
                        this option to specify another tsc
                        emulation method.
                        See <code>--help</code> for a list of valid
                        values.]<br /></span></p></td>
<td align="left" valign="top"><p class="table">kuser</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>--enable-arm-quirks</code></p></td>
<td align="left" valign="top"><p class="table">Enable quirks for specific ARM
                        SOCs Currently sa1100 and
                        xscale3 are supported.</p></td>
<td align="left" valign="top"><p class="table">disabled</p></td>
</tr>
</tbody>
</table>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647
</div>
<div class="sect3">
<h4 id="_em_mercury_em_specific_configuration_options">5.2.3. <em>Mercury</em>-specific configuration options</h4>
<div class="tableblock">
<table rules="cols"
width="100%"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="33%" />
<col width="33%" />
<col width="33%" />
<thead>
<tr>
<th align="center" valign="top">NAME              </th>
<th align="center" valign="top">DESCRIPTION                    </th>
<th align="center" valign="top">DEFAULT</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table"><code>--enable-condvar-workaround</code></p></td>
<td align="left" valign="top"><p class="table">Enable workaround for broken priority
        inheritance with condition variables in glibc. This option
        adds some overhead to RTOS API emulators.</p></td>
<td align="left" valign="top"><p class="table">disabled</p></td>
</tr>
</tbody>
</table>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1648
<div class="paragraph"><p><span class="footnote" id="_footnote_disable"><br />[Each option enabled by default can be forcibly disabled by passing <code>--disable-&lt;option&gt;</code> to the <em>configure</em> script]<br /></span></p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1649 1650 1651 1652 1653
</div>
</div>
<div class="sect2">
<h3 id="_cross_compilation">5.3. Cross-compilation</h3>
<div class="paragraph"><p>In order to cross-compile the Xenomai libraries and programs, you will
Philippe Gerum's avatar
Philippe Gerum committed
1654
need to pass a <code>--host</code> and <code>--build</code> option to the <em>configure</em>
Philippe Gerum's avatar
Philippe Gerum committed
1655 1656 1657
script. The <code>--host</code> option allow to select the architecture for which
the libraries and programs are built. The <code>--build</code> option allows to
choose the architecture on which the compilation tools are run,
Philippe Gerum's avatar
Philippe Gerum committed
1658
i.e. the system running the <em>configure</em> script.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725
<div class="paragraph"><p>Since cross-compiling requires specific tools, such tools are
generally prefixed with the host architecture name; for example, a
compiler for the PowerPC architecture may be named
<code>powerpc-linux-gcc</code>.</p></div>
<div class="paragraph"><p>When passing <code>--host=powerpc-linux</code> to configure, it will
automatically use <code>powerpc-linux-</code> as a prefix to all
compilation tools names and infer the host architecture name from this
prefix. If configure is unable to infer the architecture name from the
cross-compilation tools prefix, you will have to manually pass the
name of all compilation tools using at least the CC and LD, variables
on configure command line.</p></div>
<div class="paragraph"><p>The easiest way to build a GNU cross-compiler might involve using
crosstool-ng, available <a href="http://crosstool-ng.org/">here</a>.</p></div>
<div class="paragraph"><p>If you want to avoid to build your own cross compiler, you might if
find easier to use the ELDK. It includes the GNU cross development
tools, such as the compilers, binutils, gdb, etc., and a number of
pre-built target tools and libraries required on the target
system. See <a href="http://www.denx.de/wiki/DULG/ELDK">here</a> for further
details.</p></div>
<div class="paragraph"><p>Some other pre-built toolchains:</p></div>
<div class="ulist"><ul>
<li>
<p>
Mentor Sourcery CodeBench Lite Edition, available
<a href="http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/">here</a>;
</p>
</li>
<li>
<p>
Linaro toolchain (for the ARM architecture), available
<a href="https://launchpad.net/linaro-toolchain-binaries">here</a>.
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="library-install-examples">6. Examples of building the Xenomai libraries and tools</h2>
<div class="sectionbody">
<div class="paragraph"><p>The examples in following sections use the following conventions:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>$xenomai_root</code>
</dt>
<dd>
<p>
path to the Xenomai sources
</p>
</dd>
<dt class="hdlist1">
<code>$build_root</code>
</dt>
<dd>
<p>
path to a clean build directory
</p>
</dd>
<dt class="hdlist1">
<code>$staging_dir</code>
</dt>
<dd>
<p>
path to a directory that will hold the installed file
 temporarily before they are moved to their final location; when used
 in a cross-compilation setup, it is usually a NFS mount point from
 the target&#8217;s root directory to the local build host, as a
Philippe Gerum's avatar
Philippe Gerum committed
1726
 consequence of which running <code>make{nbsp}DESTDIR=$staging_dir{nbsp}install</code> on
Philippe Gerum's avatar
Philippe Gerum committed
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737
 the host immediately updates the target system with the installed
 programs and libraries.
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/caution.png" alt="Caution" />
</td>
<td class="content">In the examples below, make sure to add <code>--enable-smp</code> to the
Philippe Gerum's avatar
Philippe Gerum committed
1738
<em>configure</em> script options if building for a SMP-enabled kernel.</td>
Philippe Gerum's avatar
Philippe Gerum committed
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811
</tr></table>
</div>
<div class="sect2">
<h3 id="_building_the_x86_libraries_32_64bit">6.1. Building the x86 libraries (32/64bit)</h3>
<div class="paragraph"><p>Assuming that you want to build the <em>Mercury</em> libraries natively for a
x86_64/SMP system, enabling shared multi-processing support. You would
typically run:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ mkdir $build_root &amp;&amp; cd $build_root
$ $xenomai_root/configure --with-core=mercury --enable-smp --enable-pshared
$ make install</code></pre>
</div></div>
<div class="paragraph"><p>Conversely, cross-building the <em>Cobalt</em> libraries from x86_64 with the
same feature set, for running on x86_32 could be:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ mkdir $build_root &amp;&amp; cd $build_root
$ $xenomai_root/configure --with-core=cobalt --enable-smp --enable-pshared \
  --host=i686-linux CFLAGS="-m32 -O2" LDFLAGS="-m32"
$ make install</code></pre>
</div></div>
<div class="paragraph"><p>After installing the build tree (i.e. using "make install"), the
installation root should be populated with the librairies, programs
and header files you can use to build Xenomai-based real-time
applications.  This directory path defaults to <code>/usr/xenomai</code>.</p></div>
<div class="paragraph"><p>The remaining examples illustrate how to cross-compile Xenomai for
various architectures. Of course, you would have to install the proper
cross-compilation toolchain for the target system first.</p></div>
</div>
<div class="sect2">
<h3 id="_building_the_ppc32_libraries">6.2. Building the PPC32 libraries</h3>
<div class="paragraph"><p>A typical cross-compilation setup, in order to build the <em>Cobalt</em>
libraries for a ppc-6xx architecture. In that example, we want the
debug symbols to be generated for the executable, with no runtime
overhead though. We use the DENX ELDK cross-compiler:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $build_root
$ $xenomai_root/configure --host=powerpc-linux --with-core=cobalt \
  --enable-debug=symbols
$ make DESTDIR=$staging_dir install</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_building_the_ppc64_libraries">6.3. Building the PPC64 libraries</h3>
<div class="paragraph"><p>Same process than for a 32bit PowerPC target, using a crosstool-built
toolchain for ppc64/SMP.</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ cd $build_root
$ $xenomai_root/configure --host=powerpc64-unknown-linux-gnu \
  --with-core=cobalt --enable-smp
$ make DESTDIR=$staging_dir install</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_building_the_blackfin_libraries">6.4. Building the Blackfin libraries</h3>
<div class="paragraph"><p>Another cross-compilation setup, in order to build the <em>Cobalt</em>
libraries for the Blackfin architecture. We use
<a href="http://blackfin.uclinux.org/doku.php?id=toolchain:installing">ADI&#8217;s
toolchain</a> for this purpose:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ mkdir $build_root &amp;&amp; cd $build_root
$ $xenomai_root/configure --host=bfin-linux-uclibc --with-core=cobalt
$ make DESTDIR=$staging_dir install</code></pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
Philippe Gerum's avatar
Philippe Gerum committed
1812 1813 1814 1815
<td class="content">Xenomai uses the FDPIC shared library format on this architecture. In
case of problem running the testsuite, try restarting the last two
build steps, passing the <code>--disable-shared</code> option to the "configure"
script.</td>
Philippe Gerum's avatar
Philippe Gerum committed
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
</tr></table>
</div>
</div>
<div class="sect2">
<h3 id="_building_the_arm_libraries">6.5. Building the ARM libraries</h3>
<div class="paragraph"><p>Using codesourcery toolchain named <code>arm-none-linux-gnueabi-gcc</code> and
compiling for a CSB637 board (AT91RM9200 based), a typical cross-compilation
from a x86_32 desktop would look like:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ mkdir $build_root/xenomai &amp;&amp; cd $build_root/xenomai
$ $xenomai_root/configure CFLAGS="-march=armv4t" LDFLAGS="-march=armv4t" \
  --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi- --with-core=cobalt
$ make DESTDIR=$staging_dir install</code></pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/important.png" alt="Important" />
</td>
<td class="content">Unlike previous releases, Xenomai no longer passes any arm
architecture specific flags, or FPU flags to gcc, so, users are
expected to pass them using the CFLAGS and LDFLAGS variables as
demonstrated above, where the AT91RM9200 is based on the ARM920T core,
implementing the <code>armv4</code> architecture. The following table summarizes
the CFLAGS and options which were automatically passed in previous
revisions and which now need to be explicitely passed to configure,
for the supported SOCs:</td>
</tr></table>
</div>
<div class="tableblock">
<table rules="cols"
width="100%"
frame="hsides"
cellspacing="0" cellpadding="4">
<caption class="title">Table 1. ARM configure options and compilation flags</caption>
<col width="33%" />
<col width="33%" />
<col width="33%" />
<thead>
<tr>
<th align="center" valign="top">SOC       </th>
<th align="center" valign="top"> CFLAGS                           </th>
<th align="center" valign="top"> configure options</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">at91rm9200</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv4t -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">at91sam9x</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">imx1</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv4t -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">imx21</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">imx31</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv6 -mfpu=vfp</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">imx51/imx53</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv7-a -mfpu=vfp3</code>
                <span class="footnote" id="_footnote_armv7"><br />[Depending on the                 gcc versions the flag for armv7                 may be <code>-march=armv7-a</code> or                 <code>-march=armv7a</code>]<br /></span></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">imx6q</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv7-a -mfpu=vfp3</code> <span class="footnoteref"><br /><a href="#_footnote_armv7">[armv7]</a><br /></span></p></td>
<td align="left" valign="top"><p class="table"><code>--enable-smp</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">ixp4xx</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code><code>--enable-arm-tsc=ixp4xx</code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">omap3</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv7-a -mfpu=vfp3</code> <span class="footnoteref"><br /><a href="#_footnote_armv7">[armv7]</a><br /></span></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">omap4</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv7-a -mfpu=vfp3</code> <span class="footnoteref"><br /><a href="#_footnote_armv7">[armv7]</a><br /></span></p></td>
<td align="left" valign="top"><p class="table"><code>--enable-smp</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">orion</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -mfpu=vfp</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">pxa</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">pxa3xx</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv5 -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code>--enable-arm-quirks=xscale3</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">s3c24xx</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv4t -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">sa1100</p></td>
<td align="left" valign="top"><p class="table"><code>-march=armv4t -msoft-float</code></p></td>
<td align="left" valign="top"><p class="table"><code>--enable-arm-quirks=sa1100</code></p></td>
</tr>
</tbody>
</table>
</div>
<div class="paragraph"><p>It is possible to build for an older architecture version (v6 instead
of v7, or v4 instead of v5), if your toolchain does not support the
target architecture, the only restriction being that if SMP is
enabled, the architecture should not be less than v6.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_testing_the_installation">7. Testing the installation</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_booting_the_em_cobalt_em_kernel">7.1. Booting the <em>Cobalt</em> kernel</h3>
<div class="paragraph"><p>In order to test the Xenomai installation over <em>Cobalt</em>, you should
first try to boot the patched kernel. Check the kernel boot log for
messages like these:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ dmesg | grep -i xenomai
I-pipe: head domain Xenomai registered.
[Xenomai] Cobalt vX.Y.Z enabled</code></pre>
</div></div>
<div class="paragraph"><p>If the kernel fails booting, or the log messages indicates an error
status instead, see the
Philippe Gerum's avatar
Philippe Gerum committed
1965 1966
<a href="troubleshooting-a-dual-kernel-configuration#Kernel_log_displays_Xenomai_or_I-pipe_error_messages">TROUBLESHOOTING</a>
guide.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
</div>
<div class="sect2">
<h3 id="_testing_the_real_time_system_both_cores">7.2. Testing the real-time system (both cores)</h3>
<div class="paragraph"><p>First, run the latency test:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ /usr/xenomai/bin/latency</code></pre>
</div></div>
<div class="paragraph"><p>The latency test should display a message every second with minimum,
maximum and average latency values. If this test displays an error
message, hangs, or displays unexpected values, see the
Philippe Gerum's avatar
Philippe Gerum committed
1978 1979
<a href="troubleshooting-a-dual-kernel-configuration#the_latency_test_shows_high_latencies">TROUBLESHOOTING</a>
guide.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1980 1981 1982 1983 1984 1985 1986 1987
<div class="paragraph"><p>If the latency test succeeds, you should try next to run the
<code>xeno-test</code> test in order to assess the worst-case latency of your
system. Try:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ xeno-test --help</code></pre>
</div></div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998
<div class="sect2">
<h3 id="_calibrating_the_em_cobalt_em_core_timer">7.3. Calibrating the <em>Cobalt</em> core timer</h3>
<div class="paragraph"><p>The accuracy of the Cobalt timing services depends on proper
calibration of its core timer. Sound factory-default calibration
values are defined for each platform Xenomai supports, but it is
recommended to calibrate the core timer specifically for the target
system.</p></div>
<div class="paragraph"><p>See the documentation about the
<a href="../documentation/xenomai-3/html/man1/autotune/index.html">autotune(1)</a>
utility.</p></div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1999 2000
</div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
2001 2002 2003 2004 2005 2006 2007 2008
<div class="sect1">
<h2 id="_building_and_running_xenomai_3_applications">8. Building and running Xenomai 3 applications</h2>
<div class="sectionbody">
<div class="paragraph"><p>Once the latency test behaves as expected on your target system, it is
deemed ready to run real-time applications.</p></div>
<div class="paragraph"><p>You may want to have a look at
<a href="building-applications-with-xenomai-3.x/">this
document</a> for details about the application build process.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
2009 2010 2011
<div class="paragraph"><p>In addition, you may refer to
<a href="running-applications-with-xenomai-3.x/">this document</a> to learn
about the command line options available with Xenomai 3 applications.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
2012 2013 2014 2015 2016 2017 2018 2019 2020 2021
</div>
</div>
<div class="sect1">
<h2 id="_migrating_applications_to_xenomai_3">9. Migrating applications to Xenomai 3</h2>
<div class="sectionbody">
<div class="paragraph"><p>If you plan to port an existing application based on Xenomai 2.x to
Xenomai 3.x, you should have a look at
<a href="migrating-from-xenomai-2.x-to-3.x/">this migration guide</a>.</p></div>
</div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
2022 2023 2024 2025
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Philippe Gerum's avatar
Philippe Gerum committed
2026
Last updated 2015-08-15 16:32:54 CEST
Philippe Gerum's avatar
Philippe Gerum committed
2027 2028 2029 2030
</div>
</div>
</body>
</html>