Linux-3.10.15-rt11-retas-reserve download

Distribution: Ubuntu 14.04.2 LTS(ubuntu-14.04.2-desktop-amd64.iso)
Patch: PREMMPT_RT rt11
Main feature: Implements the S-EKG,NPS-F and Carousel-EDF scheduling algorithms.

The most important step before beginning the instalation is to get the proper Linux distribution installed in a machine. Virtual machines wont do the job unless the objective is to train the installation process, for it is that the scheduling results obtained will be distorted due to the existence of virtual hardware. We have used the desktop version of Ubuntu 14.04.2 LTS for x64 machines in our testing sessions. Download it and install it accordingly. Visit this link to obtain installation instructions. Once the distribution is up and running follow the next steps:

A - Compilation & Instalation

1 - Get the software required before doing kernel manipulations.

$ sudo apt-get install fakeroot
$ sudo apt-get install kernel-wedge
$ sudo apt-get install build-essential
$ sudo apt-get install makedumpfile
$ sudo apt-get install kernel-package
$ sudo apt-get install libncurses5-dev

2 - Enable the GRUB menu.

Before compiling the Linux kernel, we must change the /etc/default/grub file to show the grub menu. So, for that purpose type in your terminal:
$ sudo gedit /etc/default/grub
and comment the GRUB_HIDDEN_TIMEOUT option with a # like in the example:
# If you change this file, run 'update-grub' afterwards to update 
# /boot/grub/grub.cfg. 

GRUB_DEFAULT=0 
#GRUB_HIDDEN_TIMEOUT=0 
GRUB_HIDDEN_TIMEOUT_QUIET=true 
GRUB_TIMEOUT=10 
GRUB_DISTRIBUTOR='lsb_release -i -s 2> /dev/null || echo Debian'
                        

3 - Get Linux kernel source code

The next step is to get the source code from http://kernel.org/. Type in the terminal:
$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.10.15.tar.bz2
Extract tar (.tar.bz2) file:
$ tar -xjvf linux-3.10.15.tar.bz2
and rename directory from linux-3.10.15 to linux-3.10.15-rt11-retas-reserve
$ mv linux-3.10.15 linux-3.10.15-rt11-retas-reserve
download the linux-3.10.15-rt11-retas-reserve patch and change to the linux-3.10.15-rt11-retas-reserve directory:
$ cd linux-3.10.15-rt11-retas-reserve
apply the patch:
$ patch -p1 < ../linux-3.10.15-rt11-retas-reserve.patch

4 - Compiling & Installing the newly modified Linux kernel

The first step to compile the kernel is to choose the compilation options. To make this process easier we provide a configuration file with some modifications to make the compilation process quicker.
Copy it to linux-3.10.15-rt11-retas-reserve directory changing the file name to .config:
$ cp ../Downloads/linux-3.10.15-rt11-retas-reserve/config linux-3.10.15-rt11-retas-reserve/.config
When this is done navigate to the modified kernel and type:
$ cd linux-3.10.15-rt11-retas-reserve
$ make menuconfig
Exit the menuconfig app and save the .config file. We are ready to compile. In order to finish this step we provide you with a shell script that automates the compilation process, this is optional.
Copy the script file to our linux kernel parent folder and type the following in the terminal:
$ cd ..
$ sudo ./kcompile.sh
Everything should be done at this moment, there will be a new option in your GRUB menu(check the advanced options section) that will allow you to boot to the modified kernel.

B - Testing

Compiling user space programs

The first thing to do, is to download this user-space application. Why? Because it allows one to feed it with a configuration file containing the scheduling information that will be used during the scheduling phase.
It is of utmost importance that in order to use the ReTAS framework properly, one understands the contents of a valid file of this nature, for that purpose we provide an explanation in how to construct one by yourself so that one may create their own experiments.
Nevertheless, we provide several configuration files as examples in the archive provided. Uncompress the file:
$ unzip linux-3.10.15-rt11-retas-reserve.zip
Change to the application directory, and compile the application as follows:
$ cd linux-3.10.15-rt11-retas-reserve/tasks
$ ./compile.sh
$ cd ..

Running experiments

To perform an experiment all you need to do is to execute a simple script file(run_exp) that is present in the extracted folder. Again, we already provide you with some configuration files. They are named config# (ex: config1, config2, etc...). Lets change some files permissions. There is also another script file(log.sh), that performs some logging activities, still, the run_exp script automatically uses it, so there is no need to execute it directly.
$ chmod 755 log.sh
$ chmod 755 run_exp.sh
$ ./sudo run_exp.sh
And that is it! You should start to get results.

Understanding the results.

Okay that was probably to fast, one way to understand what is happening is to study the script files provided. Simply put, the first thing to conduct an experiment is to have at least a configuration file in place named "config#" where the # is a number from 1 to whatever you want, like the ones already available. Lets open the config1 file available then, and see what is inside, we have added some comments in bold to ease this process:
Sets to 20 the priority value in which the tasks will be spawned.
20,PRIO,    
This value is used in order to compute the number of jobs.
30,DURATION (sec),
Enables the tracing mechanism, 0 to disable.  
1,TRACE,    
Enables the statistics mechanism, 0 to disable.
1,STATS,    
The number of servers. Each line that follows corresponds to a server specific information.
3,NR_SERVERS,   
Separated by commas we have the following in order: identification number, uniprocessor scheduling policy, type, first allowed processor, second allowed processor.
0,0,1,0,-1,     
1,0,2,0,1,
2,0,1,1,-1,
The number of processors. Each line that follows corresponds to a processor specific information along with the time reserves.
2, NR_CPUS,     
Separated by commas we have the following in order: identification number, timeslot and offset.
Then we have each reserve assigned to this processor, each entry has the following information: server identification number, alternate server identification number and reserve length
0,50000000,0,0,-1,45458980,1,-1,4541020,    
1,50000000,0,1,-1,35903270,2,-1,14096730,
Finally we have the taskset, each line contains the vital information for each one of them. The data is organized in the following fashion:
Server identification number, task identification number, minimum execution time, maximum execution time, minimum inter arrival(period), maximum inter arrival, deadline, minimum offset and maximum offset.
0,1,143338820,143338820,170000000,170000000,170000000,34000000000,34000000000,
1,2,33129630,33129630,50000000,50000000,50000000,34000000000,34000000000,
                        
Hopefully, now it will be easier to understand what is happening, remember that the configuration files must be in the application parent directory.
Once there are configuration files correctly constructed, one may perform an experiment by running the already mentioned scripts. Once the process finishes, this is how to get some information of what is happening:
There is a folder created for each configuration file found, named: ts_X_d, where the X is the number provided in the configuration file name, so for example, for config1 a directory named ts_1_d would be created. Entering in this folder, will allow you to read all the information generated.

Drawing the scheduling information.

We have an application that when provided with the files inside the this folder, generates a graphical representation of the scheduling phase. First you should check if you have the proper software to run this application, since it is a java based one you should have a virtual machine installed.
$ sudo apt-get default-jdk
When the process is finished you are ready to enter in the application. Extract the archive containing it and enter the folder:
$ unzip visual-retas-v0.1-dist.zip
$ cd visual-retas-v0.1-dist/
Once inside the app you may choose a folder containing any trace files generated during the scheduling phase, we provide and example in the application's folder. To execute the piece of software provided, do as follows:
$ sudo java -jar Visual_ReTAS.jar