Building a Xenomai kernel

Hello,

I would like to compile the kernel for BeagleBoard then apply Xenomai patches to it for real-time processing.

I have downloaded the 3.6.2 from kernel.org and tried to compile it using standard gcc toolchain in www.kernel.org/pub/tools/crosstool. The cross compiling worked once I get rid of the -Werror option in the Makefile. I copied the uImage in the /boot directory to the BeagleBoard-XM boot directory and the system would not boot. So here is the first two questions.

  1. Should I modify my MLO and u-boot files as well? If so, how?
  2. There is a reference to Trey Weaver’s blog in the e-linux Wiki. http://treyweaver.blogspot.com/2010/10/installing-angstrom-on-beagleboard-xm.html
    This blog suggests that it is possible to retrieve MLO et al from the Narcissus website download and then copy them into the sdcard. In my case, there was only a pair of uImage files in the /boot directory. There was no MLO and no u-boot.bin to be seen. This information isn’t up-to-date, is it? What should I do?
    tar --wildcards -xvf test-image-beagleboard.tar.gz ./boot/*
    ./boot/uImage-2.6.32
    ./boot/uImage

Then I found something else, at the e-linux Wiki https://github.com/RobertCNelson/stable-kernel. The next questions,

  1. There is no kernel source here, is there? Should I merge this directory with a kernel source (any specific version of the kernel?) from kernel.org?
  2. What exactly should I do with the system.sh file? ıt is almost entirely comments. My toolchain is the one loaded from kernel.org and seems to work. Should I use that or the one from code sourcery?

My objective is to compile the most recent kernel for BeagleBoard-XM (or another if there is a reason to prefer an older kernel), install it with MLO and U-Boot, see that it works with my Leopard Imaging camera. After that, I want to add the patches for Xenomai and install that. Please, does anybody know how to proceed?

Ahmet

Hello,

I would like to compile the kernel for BeagleBoard then apply Xenomai
patches to it for real-time processing.

I have downloaded the 3.6.2 from kernel.org and tried to compile it using
standard gcc toolchain in www.kernel.org/pub/tools/crosstool. The cross
compiling worked once I get rid of the -Werror option in the Makefile. I
copied the uImage in the /boot directory to the BeagleBoard-XM boot
directory and the system would not boot. So here is the first two questions.

1. Should I modify my MLO and u-boot files as well? If so, how?
2. There is a reference to Trey Weaver's blog in the e-linux Wiki.
http://treyweaver.blogspot.com/2010/10/installing-angstrom-on-beagleboard-xm.html
This blog suggests that it is possible to retrieve MLO et al from the
Narcissus website download and then copy them into the sdcard. In my case,
there was only a pair of uImage files in the /boot directory. There was no
MLO and no u-boot.bin to be seen. This information isn't up-to-date, is it?
What should I do?
tar --wildcards -xvf test-image-beagleboard.tar.gz ./boot/*
./boot/uImage-2.6.32
./boot/uImage

Then I found something else, at the e-linux Wiki
https://github.com/RobertCNelson/stable-kernel. The next questions,

3. There is no kernel source here, is there? Should I merge this directory
with a kernel source (any specific version of the kernel?) from kernel.org?

It's a git repo of scripts/patches.. It needs access to an external
git repo for the actual linux source code... If you don't provide a
location by modifing the "LINUX_GIT" variable in system.sh it'll just
clone a tree of it's own...

4. What exactly should I do with the system.sh file? ıt is almost entirely
comments. My toolchain is the one loaded from kernel.org and seems to work.
Should I use that or the one from code sourcery?

So did you read any of the comments? It's setup to not care which
toolchain you use, as long as you specify at-least one with the CC
variable..

My objective is to compile the most recent kernel for BeagleBoard-XM (or
another if there is a reason to prefer an older kernel), install it with MLO
and U-Boot, see that it works with my Leopard Imaging camera. After that, I
want to add the patches for Xenomai and install that. Please, does anybody
know how to proceed?

Regards,

Hello,

I recommend download Xenomai from Xenomai website (www.xenomai.org)
and follow the instructions inside the package.

In Beagleboard case, it is support by mainstream kernel and you could
follow the procedures as it is.

There is some information in Xenomai website. But, the mailing list is
very active and the people there very helpful. If you search into
Xenomai's mailing list archives, I believe that you will find answers
there.

It not, post here again that those who got Xenomai on Beagle (such as
I) will help you.

Best regards,

Flavio

Thank you, Robert.

I succeeded in upgrading from 3.2.30-something to 3.2.32-x15 so I must have followed your instructions correctly. The camera seems to be online, too:
[ 4.183929] Beagle camera: MT9P031 init
[ 4.255401] mt9p031 2-0048: MT9P031 detected at address 0x48

So, is this how you generate your own pre-compiled Ubuntu for BeagleBoard? Did you have to modify anything to make Linux run on BeagleBoard-XM? Aside from the setup shells, that is?

Best regards,

Ahmet

And one more thing. Why did I end up with 3.2.32 instead of 3.6.2 version of the kernel?

Thank you, Robert.

I succeeded in upgrading from 3.2.30-something to 3.2.32-x15 so I must have
followed your instructions correctly. The camera seems to be online, too:
[ 4.183929] Beagle camera: MT9P031 init
[ 4.255401] mt9p031 2-0048: MT9P031 detected at address 0x48

So, is this how you generate your own pre-compiled Ubuntu for BeagleBoard?

Patches on this list -> pushed to github repos (personal:
stable-kernel & github.com/beagleboard/kernel) -> monthly
ubuntu/debian images..

Did you have to modify anything to make Linux run on BeagleBoard-XM? Aside
from the setup shells, that is?

Well, others did that many years ago.. When they first booted linux on arm..

Regards,

You ended up with 3.2.32 because you chose it... As that is currently
the default of the 'origin/master' branch, if you wanted to get 3.6.2
you would done "git checkout origin/v3.6.x" to get it.. (as i have one
unstable-board holdout, so i haven't merged v3.6.x to master yet)

Regards,

But in that case, the git repository that I downloaded from wasn’t identical to kernel.org, is it? Surely you are doing something with it, if only setting up the dot-config file? I am asking because I would like to be able to compile a streamlined kernel, add the Leopard Imaging device driver to it and then patch it up for Xenomai, too. Then I will have to write kernel modules for reading data from sensors and sending data to the devices real-time. That is why I need to know how to put it together. Is there a step-by-step guide explaining the procedure anywhere?

I have acquired a disconnected set of skills which still do not enable me to do what I want. In Angstroem’s version of the kernel, I can install the webcam as a module (as intended) and take pictures. In your version of the kernel, the device driver is part of the kernel itself but I wasn’t able to access it from an application yet. I can load and install your rootfs and kernel images. As of yesterday, I can also compile from your git repos and install a later kernel but not the latest one because there is a compatibility problem. I didn’t understand what problem you are working on if you are using a source code identical to the one at kernel.org. So, I am confused.

I found that there is more than one set of MLO, u-boot and uEnv.txt circulating. I remember in particular that enabling the Leopard Imaging camera was not the same in the uEnv.txt files of Angstroem version and your version of uEnv.txt. On one occasion, I compiled from kernel.org but it didn’t load presumably because it wasn’t comaptible with the MLO or u_boot that I had. Is that possible?

Here are the three sets of MLO, u-Boot and uEnv.txt that I have found so far.
ahmet@T520:~/BB/sdcard$ ls -la Angstroem/
total 316
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:17 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 …
-rw-r–r-- 1 ahmet ahmet 22232 Apr 19 2011 MLO
-rw-r–r-- 1 ahmet ahmet 284788 Apr 19 2011 U-BOOT.BIN
-rw-r–r-- 1 ahmet ahmet 150 Oct 8 13:26 uEnv.txt
ahmet@T520:~/BB/sdcard$ ls -la RobertCNelson/
total 396
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:15 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 …
-rw-r–r-- 1 ahmet ahmet 46500 Oct 18 17:06 MLO
-rw-r–r-- 1 ahmet ahmet 342436 Oct 18 17:06 u-boot.img
-rw-r–r-- 1 ahmet ahmet 1065 Oct 18 17:09 uEnv.txt
ahmet@T520:~/BB/sdcard$ ls -la sabayon/
total 396
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:26 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 …
-rw-rw-r-- 1 ahmet ahmet 43040 Oct 19 11:27 MLO
-rw-rw-r-- 1 ahmet ahmet 10583 Oct 19 11:24 README.txt
-rw-rw-r-- 1 ahmet ahmet 330836 Oct 19 11:28 u-boot.img
-rw-rw-r-- 1 ahmet ahmet 111 Oct 19 11:26 uEnv.txt
-rw-rw-r-- 1 ahmet ahmet 66 Oct 19 11:24 URL.txt

But in that case, the git repository that I downloaded from wasn't identical
to kernel.org, is it?

huh? the script use kernel.org git repo as a "base" for everything..

Surely you are doing something with it, if only
setting up the dot-config file?

If all we were doing was setting up a dot-config, I wouldn't be
wasting my time maintaining a script.. Instead every reply on this
list would say "use kernel.org" but that isn't the case..

I am asking because I would like to be able
to compile a streamlined kernel, add the Leopard Imaging device driver to it
and then patch it up for Xenomai, too.

Everything but the "Xenomai" patch is already done for you... So I am
now expecting an "Xenomai" patchset from you in the next few days...

Then I will have to write kernel
modules for reading data from sensors and sending data to the devices
real-time. That is why I need to know how to put it together. Is there a
step-by-step guide explaining the procedure anywhere?

Instead of just running "./build_kernel.sh" blindly, actually take a
look at "patch.sh" and "version.sh" in my repo.. Your answers are
there..

I have acquired a disconnected set of skills which still do not enable me to
do what I want. In Angstroem's version of the kernel, I can install the
webcam as a module (as intended) and take pictures. In your version of the
kernel, the device driver is part of the kernel itself but I wasn't able to
access it from an application yet.

Well, the camera driver didn't properly load when it was built as a
module.. (patches welcome)

I can load and install your rootfs and
kernel images. As of yesterday, I can also compile from your git repos and
install a later kernel but not the latest one because there is a
compatibility problem.

What "compatibility" problem? The v3.6.x branch works perfectly fine
on all Beagle's and the Panda es..

I didn't understand what problem you are working on
if you are using a source code identical to the one at kernel.org. So, I am
confused.

Your questions are confusing... yes i'm using kernel.org as a base..
Yes, we deal with problems on a daily basis, if we didn't then
kernel.org would be "done" as no new fixes/changes would be needed..

I found that there is more than one set of MLO, u-boot and uEnv.txt
circulating. I remember in particular that enabling the Leopard Imaging
camera was not the same in the uEnv.txt files of Angstroem version and your
version of uEnv.txt.

Well then run "Angstrom" if you don't like what i changed in uEnv.txt
to enable the camera..

On one occasion, I compiled from kernel.org but it
didn't load presumably because it wasn't comaptible with the MLO or u_boot
that I had. Is that possible?

The last time it was "incompatiable" was back in 2.6.29 and it was
related to ehci and u-boot 1.3.x on the Beagle Cx.. More then likely
when you built your new kernel.org release, you didn't release you
enabled something, which required a one character change in your
uEnv.txt..

Here are the three sets of MLO, u-Boot and uEnv.txt that I have found so
far.
ahmet@T520:~/BB/sdcard$ ls -la Angstroem/
total 316
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:17 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 ..
-rw-r--r-- 1 ahmet ahmet 22232 Apr 19 2011 MLO
-rw-r--r-- 1 ahmet ahmet 284788 Apr 19 2011 U-BOOT.BIN
-rw-r--r-- 1 ahmet ahmet 150 Oct 8 13:26 uEnv.txt
ahmet@T520:~/BB/sdcard$ ls -la RobertCNelson/
total 396
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:15 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 ..
-rw-r--r-- 1 ahmet ahmet 46500 Oct 18 17:06 MLO
-rw-r--r-- 1 ahmet ahmet 342436 Oct 18 17:06 u-boot.img
-rw-r--r-- 1 ahmet ahmet 1065 Oct 18 17:09 uEnv.txt
ahmet@T520:~/BB/sdcard$ ls -la sabayon/
total 396
drwxrwxr-x 2 ahmet ahmet 4096 Oct 19 11:26 .
drwxrwxr-x 5 ahmet ahmet 4096 Oct 19 11:24 ..
-rw-rw-r-- 1 ahmet ahmet 43040 Oct 19 11:27 MLO
-rw-rw-r-- 1 ahmet ahmet 10583 Oct 19 11:24 README.txt
-rw-rw-r-- 1 ahmet ahmet 330836 Oct 19 11:28 u-boot.img
-rw-rw-r-- 1 ahmet ahmet 111 Oct 19 11:26 uEnv.txt
-rw-rw-r-- 1 ahmet ahmet 66 Oct 19 11:24 URL.txt

This is a total useless comparisons... IF "MLO" and "u-boot.*" came
from a once in a while closed source project, that had a release
whenever someone felt like it, then (and only then) would that
comparison make sense.. Instead they come from the the u-boot project
(1), which is very active with a stable release every 3-4 months.. So
actually boot the processor up with those files and look at the
"version"... The differences in uEnv.txt of course would match
changes in u-boot from version to version..

1: http://git.denx.de/?p=u-boot.git;a=summary

Regards,

Hi Robert, It wasn’t my intention to waste your time or to complain about freely given help at all. Sorry about that misunderstanding. I was hoping for a comment along the lines of “kernel.org supplies the kernel but it doesn’t work on BeagleBoard without patches for such and such reasons, to make it run on BeagleBoard I add such and such to it but the Angstroem people do this and that in a different way and see the tutorial at such and such URL to find out where MLO comes from.” In other words, I was hoping for a paragraph long introduction so that I could place who is who and what is what. If the answers are in the shells, then I’ll take a look there. Thanks again. If I can work out how to install Xenomai, of course I will share it.

Ahmet

Hi Robert, It wasn't my intention to waste your time or to complain about
freely given help at all. Sorry about that misunderstanding. I was hoping

What misunderstanding? :wink: if you ask 20 questions, you'll probably
get 20 answers, there's no sugar coating...

for a comment along the lines of "kernel.org supplies the kernel but it
doesn't work on BeagleBoard without patches for such and such reasons, to

Well the thing is, the mainline kernel.org runs perfectly fine on the
Beagle with no external patches.. :wink:

But then you want leopard imaging support... Well that is currently
not mainline, and since the Beagle is "board file" based, it will
never go mainline.. (Well till we convert it to "device tree" then we
could push the support mainline...)

make it run on BeagleBoard I add such and such to it but the Angstroem
people do this and that in a different way and see the tutorial at such and
such URL to find out where MLO comes from."

MLO, comes from u-boot...

In other words, I was hoping for
a paragraph long introduction so that I could place who is who and what is
what. If the answers are in the shells, then I'll take a look there. Thanks
again. If I can work out how to install Xenomai, of course I will share it.

Regards,