Installation Guide

From ChronOS Linux

(Difference between revisions)
Jump to: navigation, search
(add link to old Installation Guide)
 
(4 intermediate revisions not shown)
Line 1: Line 1:
-
This guide assumes you have already followed the [[Downloading ChronOS Linux 3.0 | download instructions]] and have a recent Linux distribution installed.
+
This guide assumes you have already followed the [[Downloading ChronOS Linux | download instructions]] and have a recent Linux distribution installed.
This documentation is current as of ChronOS 3.0. ([[Installation Guide 2.8|Installation Guide for ChronOS 2.8]])
This documentation is current as of ChronOS 3.0. ([[Installation Guide 2.8|Installation Guide for ChronOS 2.8]])
Line 20: Line 20:
* Extract the downloaded kernel tarball.  
* Extract the downloaded kernel tarball.  
-
  <code> '''tar''' xjvf linux-3.0.17.tar.bz2 </code>
+
  <code> '''tar''' xjvf linux-3.0.24.tar.bz2 </code>
* Rename the extracted folder
* Rename the extracted folder
-
  <code> '''mv''' linux-3.0.17 linux-3.0.17-chronos </code>
+
  <code> '''mv''' linux-3.0.24 linux-3.0.24-chronos </code>
* Navigate into the renamed kernel folder and apply the patches in order. (Note: these patch files should have been placed in the chronos/ folder by the <code>mv ChronOS_3.0/* chronos/</code> command you executed at the end of the [[Downloading ChronOS Linux 3.0 | download instructions]]).
* Navigate into the renamed kernel folder and apply the patches in order. (Note: these patch files should have been placed in the chronos/ folder by the <code>mv ChronOS_3.0/* chronos/</code> command you executed at the end of the [[Downloading ChronOS Linux 3.0 | download instructions]]).
-
  <code> '''cd''' linux-3.0.17-chronos </code>  
+
  <code> '''cd''' linux-3.0.24-chronos </code>  
-
  <code> '''bzcat''' ../patch-3.0.17-rt33.patch.bz2 | '''patch''' -p1 </code>
+
  <code> '''bzcat''' ../patch-3.0.24-rt33.patch.bz2 | '''patch''' -p1 </code>
-
  <code> '''bzcat''' ../patch-3.0.17-chronos.patch.bz2 | '''patch''' -p1 </code>
+
  <code> '''bzcat''' ../patch-3.0.24-chronos.patch.bz2 | '''patch''' -p1 </code>
=== Configuring the Kernel ===
=== Configuring the Kernel ===
Line 36: Line 36:
First, navigate into the kernel directory (if you're not already there):
First, navigate into the kernel directory (if you're not already there):
-
  <code>'''cd''' linux-3.0.17-chronos </code>
+
  <code>'''cd''' linux-3.0.24-chronos </code>
-
You may wish to copy over your previous configuration, since the default kernel config may not have the correct options selected for your distribution or hardware. You should copy the most recent config for your distribution to a <tt>.config</tt> file in this <tt>linux-3.0.17-chronos</tt> directory. For Ubuntu 10.04, this configuration is located at <code>/boot/config-2.6.32-37-generic</code>, and you may copy it to <code>.config</code> in the kernel directory, like so:
+
You may wish to copy over your previous configuration, since the default kernel config may not have the correct options selected for your distribution or hardware. You should copy the most recent config for your distribution to a <tt>.config</tt> file in this <tt>linux-3.0.24-chronos</tt> directory. For Ubuntu 10.04, this configuration is located at <code>/boot/config-2.6.32-37-generic</code>, and you may copy it to <code>.config</code> in the kernel directory, like so:
  <code>'''cp''' /boot/config-2.6.32-37-generic .config </code>
  <code>'''cp''' /boot/config-2.6.32-37-generic .config </code>
-
'''Note''': other distributions probably have kernel config files available as well, try <tt>/boot</tt>, or consult your distribution's documentation.
+
'''Note''': other distributions ought to have kernel config files available as well; try the <tt>/boot</tt> directory, check if <tt>/proc/config.gz</tt> exists, and if all else fails, consult your distribution's documentation.
You should now update this <tt>.config</tt> file to work with the ChronOS kernel version. To update it with the defaults for every option which has been added between your distribution's kernel's release and the ChronOS kernel's release, run the following (omit the <tt>yes "" |</tt> portion to pick the value of each option by hand. Beware: this can be time consuming):
You should now update this <tt>.config</tt> file to work with the ChronOS kernel version. To update it with the defaults for every option which has been added between your distribution's kernel's release and the ChronOS kernel's release, run the following (omit the <tt>yes "" |</tt> portion to pick the value of each option by hand. Beware: this can be time consuming):
Line 70: Line 70:
* Compile the kernel and the modules and then install the modules.
* Compile the kernel and the modules and then install the modules.
-
  <code>'''cd''' linux-3.0.17-chronos
+
  <code>'''cd''' linux-3.0.24-chronos
  '''make''' bzImage
  '''make''' bzImage
  '''make''' modules
  '''make''' modules
Line 76: Line 76:
* Install the kernel image to the <code>/boot</code>, create an <code>initramfs</code> image for the kernel and update <code> grub </code>
* Install the kernel image to the <code>/boot</code>, create an <code>initramfs</code> image for the kernel and update <code> grub </code>
-
  <code>'''sudo cp''' arch/x86/boot/bzImage /boot/vmlinuz-3.0.17-chronos
+
  <code>'''sudo cp''' arch/x86/boot/bzImage /boot/vmlinuz-3.0.24-chronos
-
  '''sudo cp''' .config /boot/config-3.0.17-chronos
+
  '''sudo cp''' .config /boot/config-3.0.24-chronos
-
  '''sudo cp''' System.map /boot/System.map-3.0.17-chronos
+
  '''sudo cp''' System.map /boot/System.map-3.0.24-chronos
-
  '''sudo update-initramfs''' -c -k 3.0.17-chronos
+
  '''sudo update-initramfs''' -c -k 3.0.24-chronos
  '''sudo update-grub''' </code>
  '''sudo update-grub''' </code>
In order to make the compilation and installing processor simpler on the x86 architecture, we have provided a bash script called <code>'''kinst'''</code> in the kernel folder. You will have to <code>'''chmod''' </code> this script before running it.
In order to make the compilation and installing processor simpler on the x86 architecture, we have provided a bash script called <code>'''kinst'''</code> in the kernel folder. You will have to <code>'''chmod''' </code> this script before running it.
-
  <code>'''cd''' linux-3.0.17-chronos
+
  <code>'''cd''' linux-3.0.24-chronos
  '''chmod''' +x kinst
  '''chmod''' +x kinst
  '''sudo''' ./kinst </code>
  '''sudo''' ./kinst </code>

Current revision as of 13:01, 17 April 2014

This guide assumes you have already followed the download instructions and have a recent Linux distribution installed.

This documentation is current as of ChronOS 3.0. (Installation Guide for ChronOS 2.8)

Contents

Install Required packages

In order to compile the kernel, the build tools need to be installed. On Ubuntu, these can be installed from the package manager with the following command:

 sudo apt-get install build-essential libncurses5-dev 

Installing the Kernel

Applying Patches

The first step is to apply the two patches -- CONFIG_PREEMPT_RT and ChronOS.

  • Navigate to your ChronOS directory (created as part of the download instructions)
 cd chronos 
  • Extract the downloaded kernel tarball.
 tar xjvf linux-3.0.24.tar.bz2 
  • Rename the extracted folder
 mv linux-3.0.24 linux-3.0.24-chronos 
  • Navigate into the renamed kernel folder and apply the patches in order. (Note: these patch files should have been placed in the chronos/ folder by the mv ChronOS_3.0/* chronos/ command you executed at the end of the download instructions).
 cd linux-3.0.24-chronos  
 bzcat ../patch-3.0.24-rt33.patch.bz2 | patch -p1 
 bzcat ../patch-3.0.24-chronos.patch.bz2 | patch -p1 

Configuring the Kernel

First, navigate into the kernel directory (if you're not already there):

cd linux-3.0.24-chronos 

You may wish to copy over your previous configuration, since the default kernel config may not have the correct options selected for your distribution or hardware. You should copy the most recent config for your distribution to a .config file in this linux-3.0.24-chronos directory. For Ubuntu 10.04, this configuration is located at /boot/config-2.6.32-37-generic, and you may copy it to .config in the kernel directory, like so:

cp /boot/config-2.6.32-37-generic .config 

Note: other distributions ought to have kernel config files available as well; try the /boot directory, check if /proc/config.gz exists, and if all else fails, consult your distribution's documentation.

You should now update this .config file to work with the ChronOS kernel version. To update it with the defaults for every option which has been added between your distribution's kernel's release and the ChronOS kernel's release, run the following (omit the yes "" | portion to pick the value of each option by hand. Beware: this can be time consuming):

 yes "" | make oldconfig 

The next step is to configure the kernel. To do this, run

make menuconfig 


This should bring up a set of menus. You need to mark/unmark the following options:

General Setup > Control Group support > Group CPU scheduler > Group scheduling for SCHED_RR/FIFO: [n]
Processor Types and Features > Tickless System (Dynamic Ticks): [*]
Processor Types and Features > High Resolution Timer Support: [*]
Processor Types and Features > Symmetric multi-processing support: [*]
Processor Types and Features > Preemption Model > Fully Preemptible Kernel (RT) (X)
General setup > RCU Subsystem > RCU Implementation > Preemptible tree-based hierarchical RCU (X)
Power Management Options > CPU Frequency Scaling > CPU Frequency Scaling: [n]
ChronOS Real-time Scheduling > ChronOS real-time scheduling: [*]
ChronOS Real-time Scheduling > Scheduling statistics for real-time schedulers: [*]
ChronOS Real-time Scheduling > Locking statistics for scheduler-managed locks: [*]

Compiling and Installing the Kernel

  • Compile the kernel and the modules and then install the modules.
cd linux-3.0.24-chronos
make bzImage
make modules
sudo make modules_install 
  • Install the kernel image to the /boot, create an initramfs image for the kernel and update grub
sudo cp arch/x86/boot/bzImage /boot/vmlinuz-3.0.24-chronos
sudo cp .config /boot/config-3.0.24-chronos
sudo cp System.map /boot/System.map-3.0.24-chronos
sudo update-initramfs -c -k 3.0.24-chronos
sudo update-grub 

In order to make the compilation and installing processor simpler on the x86 architecture, we have provided a bash script called kinst in the kernel folder. You will have to chmod this script before running it.

cd linux-3.0.24-chronos
chmod +x kinst
sudo ./kinst 

The script compiles the bzImage (kernel image), the kernel modules, and then installs the modules. It then copies the kernel image, system map, and kernel config to the /boot directory, generates the initramfs, and updates the grub menu. If you are on a non-x86 architecture, you'll have to change the directory to copy the kernel image from.

Note that if you run into an error building one of the modules, you may need to go back to make menuconfig and unselect the module causing the build error.

Installing Libraries and Utilities

Installing Libchronos

Libchronos is the shared userspace library which provides the hooks and headers files to interface with the ChronOS kernel.

Then you need to install libchronos before installing any other userspace components. To install, simply run a make all followed by a sudo make install in the libchronos folder inside the chronos directory.

If you are using a version of ChronOS before Beta 2.1, there is no libchronos, since the userspace APIs were provided by C/C++ headers.

The most recent version of libchronos is included in the main ChronOS archive, which you extracted as part of the download instructions.

Installing Sched_Test_App

sched_test_app is a userspace application written in C designed to provide an interface for testing real-time schedulers.

To compile it, simply run make. To install it, run sudo make install script. More details can be found in the README file.

The most recent version of Sched_Test_App is included in the main ChronOS archive, which you extracted as part of the download instructions.

Installing Libjchronos

Libjchronos is the shared userspace library which provides the hooks and class files to interface with the ChronOS kernel from Java.

Then you need to install libjchronos before installing Sched_Test_App_Java, or exercising the ChronOS scheduler through Java. To install, simply run a make followed by a sudo make install in the libjchronos folder inside the chronos directory.

Libjchronos was not a part of ChronOS before Beta 2.6, so to use it, you just download 2.6 or a later version.

The most recent version of libjchronos is included in the main ChronOS archive, which you extracted as part of the download instructions.

Installing Sched_Test_App_Java

Sched_Test_App_Java is a userspace application written in Java/SWT designed to provide an interface for testing real-time schedulers in Java.

To compile it, run make. To install it, run sudo make install.

Sched_Test_App_Java was not a part of ChronOS before Beta 2.6, so to use it, you just download 2.6 or a later version.

The most recent version of Sched_Test_App_Java is included in the main ChronOS archive, which you extracted as part of the download instructions.

Installing Test Cases

The ChronOS test cases provide an easy way to verify that a ChronOS Linux system is functioning correctly. Note that you will need to install Sched_Test_App and libchronos before running the test cases, since the slope computed during the installation of Sched_Test_App is used by the test cases.

Compile the test cases with make and run them with sudo ./all_test_cases.sh. Use the -v flag for a detailed output.

The most recent version of the test cases is included in the main ChronOS archive, which you extracted as part of the download instructions.

Installing Benchmarks

Several benchmarking programs are included with ChronOS to provide measurements of ChronOS specific calls and comparisons with standard Linux calls.

Compile the test cases with make and run them with sudo ./all_benchmarks.sh.

The most recent version of the benchmarks is included in the main ChronOS archive, which you extracted as part of the download instructions.


Back to main page

Personal tools