gpos to rtos conversion

3
Lab1 - Patching Linux Kernel to Convert it to a Real-Time Operating System -------------------------------------------------------------------------- Lab Goal -------- In this lab we will convert the general purpose Linux operating system to hard real time operating system using CONFIG_PREEMPT_RT patch Preamble -------- We have tested this lab on a Fedora 13, 64 bit system. Download Linux Kernel and Real-Time Patch ------------------------------------------ Download latest Linux kernel form which RT patch is available from http://www.kernel.org Download RT patch from http://www.kernel.org/pub/linux/kernel/projects/rt/. Make sure that patch is for same kernel that is downloaded You can also use Linux Kernel 2.6.33.7 and its related real-time patch, which is included with this lab material for easy access. Patch the Linux Kernel ---------------------- Place kernel and patch in a same directory. We have test the following steps on Linux kernel 2.6.33.7 and corresponding real-time patch. They are expected to work the same for other versions as well. Our Kernel and patch are compressed as a bzip2 file. (1) Unpack the Linux kernel using following command tar vxfj linux-2.6.33.7.tar.bz2 (2) Move to the kernel folder linux-2.6.33.7 cd linux-2.6.33.7 (3) Lets dry run the real-time patch before applying it. bzcat ../patch-2.6.33.7-rt29.bz2 | patch --dry-run -p1 Make sure no error is reported in the dry-run. If so, it implies that patch will apply correctly. (4) To apply the patch, use the following command. bzcat ../patch-2.6.33.7-rt29.bz2 | patch -p1 This step completes patching the Linux kernel.

Upload: coolmirza143

Post on 29-Jan-2018

1.212 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: GPOS to RTOS conversion

Lab1 - Patching Linux Kernel to Convert it to a Real-Time Operating System--------------------------------------------------------------------------

Lab Goal--------In this lab we will convert the general purpose Linux operating system to hard real time operating system using CONFIG_PREEMPT_RT patch

Preamble--------We have tested this lab on a Fedora 13, 64 bit system.

Download Linux Kernel and Real-Time Patch------------------------------------------Download latest Linux kernel form which RT patch is available from http://www.kernel.orgDownload RT patch from http://www.kernel.org/pub/linux/kernel/projects/rt/. Make sure that patch is for same kernel that is downloaded

You can also use Linux Kernel 2.6.33.7 and its related real-time patch, whichis included with this lab material for easy access.

Patch the Linux Kernel----------------------Place kernel and patch in a same directory.

We have test the following steps on Linux kernel 2.6.33.7 and corresponding real-time patch. They are expected to work the same for other versions aswell. Our Kernel and patch are compressed as a bzip2 file.

(1) Unpack the Linux kernel using following command

tar vxfj linux-2.6.33.7.tar.bz2

(2) Move to the kernel folder linux-2.6.33.7

cd linux-2.6.33.7

(3) Lets dry run the real-time patch before applying it.

bzcat ../patch-2.6.33.7-rt29.bz2 | patch --dry-run -p1

Make sure no error is reported in the dry-run. If so, itimplies that patch will apply correctly.

(4) To apply the patch, use the following command.

bzcat ../patch-2.6.33.7-rt29.bz2 | patch -p1

This step completes patching the Linux kernel.

Page 2: GPOS to RTOS conversion

Reading the Patched Files-------------------------You are highly encouraged to see at least a few of patchedfiles and to compare them with un-patched original file tounderstand the changes made. All of these changes will fallinto one of the reasons or classes mentioned in this coursewrite up.

Configuration of Linux Kernel-----------------------------

Start configuration dialog by issuing the following command

make menuconfig

(1) Enable real time option for kernel (Processor type and features ---> Preemption mode ---> Complete Preemption )

(2) Activate High Resolution Timer (Processor type and features ---> High Resolution Timer)

(3) Apply power management settings according to your specific hardware. Power management settings are hardware dependent. Read Help for each and every option in "Power management and ACPI options" section and perform appropriate setting

After completing configuration, exit the configuration dialog and save you configuration by selecting "yes" to the exiting message.

Building the Linux Kernel-------------------------

Once the kernel has been configured, it is time to build it. It is done by following command.

make

Since our test system has 8 cores, we used make -j8 so that all coresare used in parallel to complete the work quickly.

Make sure the building process does not report any error.

It will take some time to compile the kernel. After compiling issue following command. make modules

And finally issue the following commands from a privileged access e.g. becoming a root orusing sudo, one after the other.

make modules_installmake install

Page 3: GPOS to RTOS conversion

Running the System-------------------Now boot the system with the newly built kernel. Make sure by running

uname -a

command that system is up with the real time kernel. Now originalLinux has been changed to real time Linux and server your real timeapplications.