User Tools

Site Tools


code:work:pi:rtpreempt:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
code:work:pi:rtpreempt:start [2017/03/06 16:03] – [Xenomai Pi Compiled] davidcode:work:pi:rtpreempt:start [2017/03/09 01:06] (current) – [Xenomai Pi 3 Compile HOWTO] david
Line 301: Line 301:
 <code> <code>
 cd ~/work/pi cd ~/work/pi
-tar xf download/linux-3.18.20.tar.xz +tar xf download/linux-4.4.43.tar.xz 
-mv linux-3.18.20 linux-3.18.20-ipipe+mv linux-4.4.43 linux-4.4.43-ipipe
 cd xenomai-3.0.3 cd xenomai-3.0.3
-scripts/prepare-kernel.sh --arch=arm --linux=~/work/pi/linux-3.18.20-ipipe +scripts/prepare-kernel.sh --arch=arm --linux=~/work/pi/linux-4.4.43-ipipe 
-cd ~/work/pi/linux-3.18.20-ipipe +cd ~/work/pi/linux-4.4.43-ipipe 
-KERNEL=kernel7+export KERNEL=kernel7
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2835_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2835_defconfig
Line 315: Line 315:
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs -j `getconf _NPROCESSORS_ONLN` make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs -j `getconf _NPROCESSORS_ONLN`
 +
 +cd /mnt
 +sudo mkdir pisdcard
 +sudo mkdir pisdcard/fat32
 +sudo mkdir pisdcard/ext4
 +sudo mount /dev/sdb1 /mnt/pisdcard/fat32
 +sudo mount /dev/sdb2 /mnt/pisdcard/ext4
 +
 +# go where the kernel is that you want to install
 +cd ~/work/pi/linux-4.4.43-ipipe
 +sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/mnt/pisdcard/ext4 modules_install
 +
 +# and the rest
 +sudo cp /mnt/pisdcard/fat32/$KERNEL.img /mnt/pisdcard/fat32/$KERNEL-backup.img
 +sudo scripts/mkknlimg arch/arm/boot/zImage /mnt/pisdcard/fat32/$KERNEL.img
 +sudo cp arch/arm/boot/dts/*.dtb /mnt/pisdcard/fat32/
 +sudo cp arch/arm/boot/dts/overlays/*.dtb* /mnt/pisdcard/fat32/overlays/
 +sudo cp arch/arm/boot/dts/overlays/README /mnt/pisdcard/fat32/overlays/
 </code> </code>
  
Line 332: Line 350:
   * This is an excellent example that has a real time thread and a non-real time thread that communicate.   * This is an excellent example that has a real time thread and a non-real time thread that communicate.
  
 +
 +===== Xenomai Pi 3 Compile HOWTO =====
 +
 +Using this as the basis:
 +
 +[[https://www.blaess.fr/christophe/2016/05/22/xenomai-3-sur-raspberry-pi-2/]]
 +
 +
 +  - Grab Xenomai <code>
 +cd ~/work/pi/download
 +wget <<FILES>>
 +</code>
 +  - What patches do we have? <code>
 +cd ~/work/pi/
 +tar xf download/xenomai-3.0.3.tar.bz2
 +ls xenomai-3.0.3/kernel/cobalt/arch/arm/patches/
 +#
 +# results
 +ipipe-core-3.10.32-arm-13.patch  ipipe-core-3.18.20-arm-11.patch  ipipe-core-4.1.18-arm-9.patch  README
 +ipipe-core-3.14.44-arm-16.patch  ipipe-core-4.1.18-arm-8.patch    ipipe-core-4.4.43-arm-7.patch
 +</code>
 +  - Grab the source code from the **git** repository <code>
 +git clone https://github.com/raspberrypi/linux
 +cd linux
 +git checkout rpi-4.4.y
 +</code>
 +  - Create a new Xenomai branch <code>
 +git checkout -b xenomai-3.0.3
 +</code>
 +  - Dry run the patch <code>
 +patch --dry-run -p1 <../xenomai-3.0.3/kernel/cobalt/arch/arm/patches/ipipe-core-4.4.43-arm-7.patch
 +</code>
 +  - Patch the kennel assuming you saw no FAILS in the dry run test <code>
 +cd ..
 +xenomai-3.0.3/scripts/prepare-kernel.sh --linux=linux --arch=arm --ipipe=xenomai-3.0.3/kernel/cobalt/arch/arm/patches/ipipe-core-4.4.43-arm-7.patch
 +</code>
 +  - Build the default configuration <code>
 +KERNEL=kernel7
 +cd linux
 +make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
 +make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2835_defconfig
 +</code>
 +  - Configure the kernel <code>
 +make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
 +</code>
 +    - Make these changes
 +      - Kernel Features  --->
 +        - Preemptible Kernel (Low-Latency Desktop)
 +        - DISBLE Allow for memory compaction
 +        - DISABLE Contiguous Memory Allocator
 +      - CPU Power Management  ---> OFF everything
 +      - Kernel hacking
 +        - DISABLE KGDB: kernel debugger
 +  - Compile! <code>
 +make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs -j 6
 +</code>
 +  - Ran this with the 3.1.18 kernel... seems like that might work.
code/work/pi/rtpreempt/start.1488816232.txt.gz · Last modified: 2017/03/06 16:03 by david