Difference between revisions of "EBC Xenomai"

From eLinux.org
Jump to: navigation, search
m (Setting up the Bone: Added)
m (bone$ -> host$)
Line 10: Line 10:
 
* Download the current version of Xenomai.  Browse to [http://download.gna.org/xenomai/stable/latest/ http://download.gna.org/xenomai/stable/latest/] to see what the latest version is, then
 
* Download the current version of Xenomai.  Browse to [http://download.gna.org/xenomai/stable/latest/ http://download.gna.org/xenomai/stable/latest/] to see what the latest version is, then
  
  bone$ '''wget http://download.gna.org/xenomai/stable/latest/xenomai-2.6.4.tar.bz2'''
+
  host$ '''wget http://download.gna.org/xenomai/stable/latest/xenomai-2.6.4.tar.bz2'''
bone$ '''tar xvjf xenomai-2.6.4.tar.bz2'''
+
host
 
 
 
* Checkout the the latest kernel
 
* Checkout the the latest kernel
  
  bone$ '''cd bb-kernel'''
+
  host$ '''cd bb-kernel'''
  bone$ '''uname -a'''
+
  host$ '''uname -a'''
  bone$ '''git tags | sort | less'''
+
  host$ '''git tags | sort | less'''
 
Pick the tag that is close to your current version of the kernel.
 
Pick the tag that is close to your current version of the kernel.
  bone$ '''get checkout 3.8.13-bone67 -v xenomai'''
+
  host$ '''get checkout 3.8.13-bone67 -v xenomai'''
  
 
* Patch the kernel. This assumes '''b-kernel''' and '''xenomai-2.6.4''' are at the same directory level.
 
* Patch the kernel. This assumes '''b-kernel''' and '''xenomai-2.6.4''' are at the same directory level.
  bone$ '''cd bb-kernel'''
+
  host$ '''cd bb-kernel'''
  bone$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-pre.patch
+
  host$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-pre.patch
  bone$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/ipipe-core-3.8.13-arm-4.patch'''
+
  host$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/ipipe-core-3.8.13-arm-4.patch'''
  bone$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-post.patch'''
+
  host$ '''patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-post.patch'''
 
* Then one more patch from [http://www.xenomai.org/pipermail/xenomai/2014-January/029937.html], which is shown here.
 
* Then one more patch from [http://www.xenomai.org/pipermail/xenomai/2014-January/029937.html], which is shown here.
  bone$ '''cat > thumb.patch
+
  host$ '''cat > thumb.patch
 
  diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
 
  diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
 
  index e2bc263..6f4d9f0 100644
 
  index e2bc263..6f4d9f0 100644
Line 48: Line 47:
 
   #endif /* CONFIG_IPIPE */
 
   #endif /* CONFIG_IPIPE */
 
   get_thread_info tsk
 
   get_thread_info tsk
  bone$ '''patch -p1 < thumb.patch'''
+
  host$ '''patch -p1 < thumb.patch'''
  
 
* Prepare the kernel
 
* Prepare the kernel
  bone$ '''cd ../../xenomai-2.6.4/scripts'''
+
  host$ '''cd ../../xenomai-2.6.4/scripts'''
  bone$ '''./prepare-kernel.sh --arch=arm --linux=../../beagle-kernel/kernel'''
+
  host$ '''./prepare-kernel.sh --arch=arm --linux=../../beagle-kernel/kernel'''
  
 
== Compile the Kernel ==
 
== Compile the Kernel ==
  bone$ '''cd ../../bb-kernel'''
+
  host$ '''cd ../../bb-kernel'''
 
Make sure '''AUTO_BUILD''' is turned off.
 
Make sure '''AUTO_BUILD''' is turned off.
  bone$ '''vi system.sh'''
+
  host$ '''vi system.sh'''
 
Be sure the last line commented out.
 
Be sure the last line commented out.
 
  #AUTO_BUILD=1
 
  #AUTO_BUILD=1
 
* Build the kernel
 
* Build the kernel
  bone$ '''./build_kernel.sh'''
+
  host$ '''./build_kernel.sh'''
 
* When the configuration menu comes up
 
* When the configuration menu comes up
 
** Under  CPU Power Management --->  CPU Frequency scaling, disable  [ ] CPU Frequency scaling.
 
** Under  CPU Power Management --->  CPU Frequency scaling, disable  [ ] CPU Frequency scaling.

Revision as of 11:40, 9 October 2014

thumb‎ Embedded Linux Class by Mark A. Yoder


Xenomai is a set of patches for the kernel that allow it to run real-time tasks. This is an adaptation of Bruno Martins' Xenomai on the Beaglebone Black in 14 easy steps that works with the kernel installed in EBC Installing Kernel Source.

Patching the Kernel

host$ wget http://download.gna.org/xenomai/stable/latest/xenomai-2.6.4.tar.bz2

host

  • Checkout the the latest kernel
host$ cd bb-kernel
host$ uname -a
host$ git tags | sort | less

Pick the tag that is close to your current version of the kernel.

host$ get checkout 3.8.13-bone67 -v xenomai
  • Patch the kernel. This assumes b-kernel and xenomai-2.6.4 are at the same directory level.
host$ cd bb-kernel
host$ patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-pre.patch
host$ patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/ipipe-core-3.8.13-arm-4.patch
host$ patch -p1 < ../../xenomai-2.6.4/ksrc/arch/arm/patches/beaglebone/ipipe-core-3.8.13-beaglebone-post.patch
  • Then one more patch from [1], which is shown here.
host$ cat > thumb.patch
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index e2bc263..6f4d9f0 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -469,6 +469,7 @@ __irq_usr:
 	kuser_cmpxchg_check
 	irq_handler
 #ifdef CONFIG_IPIPE
+THUMB(	it	ne )
 	bne	__ipipe_ret_to_user_irqs_disabled
 #endif	/* CONFIG_IPIPE */
 	get_thread_info tsk
@@ -767,6 +768,7 @@ ENTRY(ret_from_exception)
 	disable_irq
 	bl	__ipipe_check_root
 	cmp     r0, #1
+THUMB(	it	ne )
 	bne	__ipipe_ret_to_user_irqs_disabled  @ Fast exit path over non-root domains
 #endif /* CONFIG_IPIPE */
 	get_thread_info tsk
host$ patch -p1 < thumb.patch
  • Prepare the kernel
host$ cd ../../xenomai-2.6.4/scripts
host$ ./prepare-kernel.sh --arch=arm --linux=../../beagle-kernel/kernel

Compile the Kernel

host$ cd ../../bb-kernel

Make sure AUTO_BUILD is turned off.

host$ vi system.sh

Be sure the last line commented out.

#AUTO_BUILD=1
  • Build the kernel
host$ ./build_kernel.sh
  • When the configuration menu comes up
    • Under CPU Power Management ---> CPU Frequency scaling, disable [ ] CPU Frequency scaling.
    • Under Real-time sub-system ---> Drivers ---> Testing drivers, enable everything

Then sit back an wait.

Setting up the Bone

While you are waiting for the compile to finish, you can set up the Bone.




thumb‎ Embedded Linux Class by Mark A. Yoder