SlideShare a Scribd company logo
J.SUDARSHANREDDY
RTLinux Lab – Introduction
Cpre 558
J.SUDARSHANREDDY
01/25/15
J.SUDARSHANREDDY
Contents
• Real-Time Operating System (RTOS) Vs. General Purpose OS
(GPOS)
• Can Linux provide real-time guarantees?
• Commercial RTOSs
• RTLinux Vs. Linux: Architectural comparison
• RTLinux Vs. Linux: Code perspective
• Get the RTLinux setup ready
• Things to Issue and Handling the hard disk
• Lab #1: Detailed discussion
01/25/15
J.SUDARSHANREDDY
RTOS Vs. GPOS
• RTOS
– needs deterministic timing behavior
– Works under worst case assumptions
• GPOS
– high throughput and fairness
– Optimizes for the average case
• Hence, the design objectives of the OSs are different
01/25/15
J.SUDARSHANREDDY
Can Linux provide real-time guarantees?
-- No!!
• Linux
– non-preemptible kernel
• A system call might take long time to complete
– Coarse timer resolution
• Tasks can be released only with 10ms precision
– Virtual memory
• Introduces unpredictable amount of delays
– Variable priority
• Each task is assigned a priority which varies over the time;
this is to achieve fairness
01/25/15
J.SUDARSHANREDDY
Can Linux provide real-time guarantees?
-- No!! (contd..)
• Linux
– Linux will batch several operations for efficient use of H/W delaying
all tasks
– Linux also reorders requests from multiple processes for H/W
efficiency
– Linux does not preempt low priority task in a system call, instead
queues the high priority task
– Linux makes high priority tasks to wait for low priority tasks to release
resources
Therefore, Linux cannot provide real-time guarantees
01/25/15
J.SUDARSHANREDDY
Commercial RTOS
• RTLinux – Monolithic kernel with loadable modules
• QNX – Microkernel approach
• VxWorks – Monolithic kernel
• LynxOS – Microkernel
• ARTS, Spring, KURT, RTAI, etc….
01/25/15
J.SUDARSHANREDDY
• Open source Linux project
• Supports x86, PowerPC, Alpha
• Available as a patch to the regular Linux kernel
• Provides an RT API for developers
• Runs Linux kernel as lowest priority process
RTLinux: Overview
01/25/15
J.SUDARSHANREDDY
Linux Kernel
System libraries
Device drivers Linux kernel
Hardware
I/O Hardware Interrupts
User Processes
01/25/15
J.SUDARSHANREDDY
RTLinux Kernel
Hardware
System libraries
Device drivers Linux kernel
I/O Software Interrupts
User Processes
RTLinux Plug-in
Real Time Tasks
RT-Scheduler
I/O Hardware Interrupts
Linux is executed in the background
Direct
h/w
access
01/25/15
J.SUDARSHANREDDY
Linux Kernel: code perspective
Linux Monolithic kernel core
M1
M2
M3
M4
KernelLoadableModules
RAM DISK
Module M2 service
(system call)
User
Process
M2
THE
controller
01/25/15
J.SUDARSHANREDDY
RTLinux Kernel: code perspective
Linux Monolithic kernel core
RTM2
RTM3
M1
M2
KernelLoadableModules
RAM
DISK
Load RT core
RT Load
command
RT-Core Module
RT core
M3
THE
controller
01/25/15
J.SUDARSHANREDDY
Getting RTLinux ready
• Configure and compile a fresh Linux kernel (2.4.29)
– Download the kernel from
http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4
• Patch the RTLinux to the Linux kernel
• Recompile the kernel and reboot the system into the
new kernel
• Configure the RTLinux kernel and compile it
01/25/15
J.SUDARSHANREDDY
So, How do we run a RT-application program ?
• Step 1: Write the RT-application program as a kernel
module
– (You are still in Linux)
• Step 2: Compile the module and check for errors
– (You are still in Linux)
• Step 3: Load the RT-Core (or RT Scheduler, etc..) and
the RT-application program module
– (After this we will be in RTLinux)
• Step 4: Now you are in RTLinux!!!!
01/25/15
J.SUDARSHANREDDY
Homework
• Submission 1:
– Give a ten line write-up comparing RTLinux with
Linux with at least five differences along with the
references.
• Submission 2:
– Give a ten line write-up comparing RTLinux with
two other commercial RTOSs with at least five
differences for each of them along with the
references.
01/25/15
J.SUDARSHANREDDY
Lab Policies
• Six assignments in total
• First three assignments are mandatory
• One of the last three assignments is
mandatory
• You will be working with a removable
hard disk which can be issued from CSG
01/25/15
J.SUDARSHANREDDY
Things to Issue
• Issue the following from the CSG
– Hard disk (one per group)
– Key (one per group)
– RHEL – WS3 installation DVD (one per group)
• You need to download the lab01 tar file
(lab01.tgz) from the course website.
• The RTLinux lab is in Coover - 1331C
01/25/15
J.SUDARSHANREDDY
Handling the hard disk (1)
• Shutdown the PC
• After the power is off, unlock the existing hard
disk and take it out
• Insert the hard disk given to you and lock it
• Restart the comp
• Follow the manual you have downloaded from
the course website
01/25/15
J.SUDARSHANREDDY
Handling the hard disk (2)
• After you are done with the lab:
– Shutdown the PC
– After the power is off, unlock the hard disk
and remove it
– Insert the original hard disk and lock it
– Leave the Lab
01/25/15
J.SUDARSHANREDDY
Lab 1: Objectives
• Part 1:
– Getting the RTLinux lab setup ready
• Part 2:
– Run a few simple hello-world modules
01/25/15
J.SUDARSHANREDDY
Part 1
• Install the RHEL-WS3 using the DVD given to you
– Go for the auto-partitioning option
– Rest everything is straightforward
• Configure and compile fresh Linux kernel (2.4.29)
• Patch the RTLinux to the Linux kernel
• Recompile the kernel and reboot the system into the
new kernel
• Load RT-modules
• Instructions are provided in the Lab manual
01/25/15
J.SUDARSHANREDDY
Part 2
• Boot into the RTLinux kernel compiled in part-1
• The objectives of the part 2 are:
– Understanding a simple RTLinux kernel module
• With one thread (hello-1) and two threads (hello-2)
– Printing from a RTLinux module
• rtl_printf (hello-3)
• Using rtf_put (RT-FIFO) (hello-4)
01/25/15
J.SUDARSHANREDDY
A kernel module Vs. Program
• All RT-Tasks are kernel modules. Therefore, we write kernel
modules in this lab.
• A user program runs in user space and the kernel module runs in
the kernel space
• A user program starts running at its “main” function
• A kernel module starts running at the “init_module” function and
exits via “cleanup_module” function
• Therefore, for a kernel module “init_module” and
‘cleanup_module” are as necessary as “main” is
necessary for a C program
01/25/15
J.SUDARSHANREDDY
A typical kernel module
Init_module()
{
…….
Perform your module initiation stuff etc..
}
Cleanup_module()
{
…….
Perform cleanup stuff like destroying the threads, freeing
memory, etc..
}
01/25/15
J.SUDARSHANREDDY
Hello world Module
• Go through the hello world module
• Realize the importance of init_module and
cleanup_module
• Notice the way the thread is created and how
it is made periodic
• Understand the “pthread_make_periodic” and
“pthread_wait” and other interfacing functions
01/25/15
J.SUDARSHANREDDY
A typical RTLinux module
Init_module() {
For each thread:
Choose the priority function
//pthread_set_priority(..);
Assign the “task_function” to
the thread
Create the thread
//pthread_create(..,
task_function,..); }
Task_function()
{
Pthread_make_periodic_np(
p);
while(1)
{
Pthread_wait_np();
//perform the task function
//for this instance
}
}
Cleanup_module()
{
…….
Delete the thread
//pthread_delete_np(..);
}
This function tells
the scheduler that
I am a periodic
task with period
“p”
This function tells
the scheduler that
I am done for this
instance and
schedule me after
“p” units of time
01/25/15
J.SUDARSHANREDDY
Hello World 2
• This module creates two threads using a nice
“thread_struct” structure to make the
initialization easy and compact.
• Once again go through the interfacing
funcitons
• This time put more “rtl_printf” statements and
open “/var/log/messages” file to find your
output
01/25/15
J.SUDARSHANREDDY
RTL_PRINTF: how does it work?
Rtl_printf printk
Printk buffer
Kernel ring
buffer
syslodgconsole
Might overflow!!
Might overflow!!
Log file
01/25/15
J.SUDARSHANREDDY
Other ways of printing: RTL-FIFO
• RTLinux FIFO provides communication
mechanisms between RTL threads and
Linux task.
• A linux process creates the RTL-FIFO
buffer which the RTL threads access
and write and read from them
01/25/15
J.SUDARSHANREDDY
RTL-FIFO
• Creating and destroying FIFOS:
– Using functions: rtf_create and rtf_destroy
– These functions are called from linux
process: open(), read(), write();
• Accessing FIFOs from RTL threads
– using functions: rtf_put and rtf_get
01/25/15
J.SUDARSHANREDDY
Using RTL_FIFO
RT Task:
my_put task
Linux Task:
my_read task
RTL FIFO
rtf_create()
Time
rtf_put()
open()
read()
rtf_destroy()
01/25/15
J.SUDARSHANREDDY
Submissions
• Submission 1:
– Submit a five line write-up explaining the working of
the two RTL interfacing functions including:
• Pthread_make_periodic_np
• Pthread_wait_np
• Rtf_create,rtf_destroy, rtf_put, rtf_get
• Submission 2:
– Submit a five line write-up giving at least five
differences between a kernel module and a user
program.
01/25/15
J.SUDARSHANREDDY
Thank You!!
01/25/15

More Related Content

What's hot

Open shift 4-update
Open shift 4-updateOpen shift 4-update
Open shift 4-update
SaeidVarmazyar
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
nishantsri
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
Liran Ben Haim
 
RT linux
RT linuxRT linux
RT linux
SARITHA REDDY
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
Emertxe Information Technologies Pvt Ltd
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools
Brendan Gregg
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
Gary Bisson
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
National Cheng Kung University
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
Linaro
 
BlueStore, A New Storage Backend for Ceph, One Year In
BlueStore, A New Storage Backend for Ceph, One Year InBlueStore, A New Storage Backend for Ceph, One Year In
BlueStore, A New Storage Backend for Ceph, One Year In
Sage Weil
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
 
Hands on OpenCL
Hands on OpenCLHands on OpenCL
Hands on OpenCL
Vladimir Starostenkov
 
Embedded Linux Quick Start Guide v1.5
Embedded Linux Quick Start Guide v1.5Embedded Linux Quick Start Guide v1.5
Embedded Linux Quick Start Guide v1.5
Chris Simmonds
 
Embedded Linux
Embedded LinuxEmbedded Linux
Embedded Linux
Quotient Technology Inc.
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Naiyan Noor
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
Kernel TLV
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
Emertxe Information Technologies Pvt Ltd
 

What's hot (20)

Open shift 4-update
Open shift 4-updateOpen shift 4-update
Open shift 4-update
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
QNX Software Systems
QNX Software SystemsQNX Software Systems
QNX Software Systems
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
RT linux
RT linuxRT linux
RT linux
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
BlueStore, A New Storage Backend for Ceph, One Year In
BlueStore, A New Storage Backend for Ceph, One Year InBlueStore, A New Storage Backend for Ceph, One Year In
BlueStore, A New Storage Backend for Ceph, One Year In
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Hands on OpenCL
Hands on OpenCLHands on OpenCL
Hands on OpenCL
 
Embedded Linux Quick Start Guide v1.5
Embedded Linux Quick Start Guide v1.5Embedded Linux Quick Start Guide v1.5
Embedded Linux Quick Start Guide v1.5
 
Embedded Linux
Embedded LinuxEmbedded Linux
Embedded Linux
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 

Viewers also liked

Rtlinux tutorial
Rtlinux tutorialRtlinux tutorial
Rtlinux tutorialKevin Paz
 
Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)
Ramola Dhande
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat Linux
Apo
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
Omi Vichare
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 

Viewers also liked (9)

Rtlinux tutorial
Rtlinux tutorialRtlinux tutorial
Rtlinux tutorial
 
Rtos
RtosRtos
Rtos
 
2013 ufsc rt_grad_class
2013 ufsc rt_grad_class2013 ufsc rt_grad_class
2013 ufsc rt_grad_class
 
Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat Linux
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 

Similar to Rt linux-lab1

embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
twtester
 
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theoryEmbedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
EmbeddedFest
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
GlobalLogic Ukraine
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embedded
Alison Chaiken
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernelMahendra M
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)
Peter Martin
 
The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)
plarsen67
 
Systemd for developers
Systemd for developersSystemd for developers
Systemd for developers
Alison Chaiken
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
All Things Open
 
Android and Hard Real Time
Android and Hard Real TimeAndroid and Hard Real Time
Android and Hard Real TimeAkshar Desai
 
Diagnostics of a Linux System
Diagnostics of a Linux SystemDiagnostics of a Linux System
Diagnostics of a Linux System
Novell
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
Ahmed El-Arabawy
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗Macpaul Lin
 
Embedded system - embedded system programming
Embedded system - embedded system programmingEmbedded system - embedded system programming
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
Flexible DevOps Deployment of Enterprise Test Environments in the Cloud
Flexible DevOps Deployment of Enterprise Test Environments in the CloudFlexible DevOps Deployment of Enterprise Test Environments in the Cloud
Flexible DevOps Deployment of Enterprise Test Environments in the Cloud
DevOps for Enterprise Systems
 
Thinking inside the box (shared)
Thinking inside the box (shared)Thinking inside the box (shared)
Thinking inside the box (shared)
Joe Brockmeier
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Marco Cavallini
 
12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction
andrewmurraympc
 
Embedded systems introduction
Embedded systems introductionEmbedded systems introduction
Embedded systems introduction
Sagar Adroja
 
Embedded Systems Introduction
Embedded Systems IntroductionEmbedded Systems Introduction
Embedded Systems Introduction
Sagar Adroja
 

Similar to Rt linux-lab1 (20)

embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
 
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theoryEmbedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embedded
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernel
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)
 
The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)
 
Systemd for developers
Systemd for developersSystemd for developers
Systemd for developers
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
 
Android and Hard Real Time
Android and Hard Real TimeAndroid and Hard Real Time
Android and Hard Real Time
 
Diagnostics of a Linux System
Diagnostics of a Linux SystemDiagnostics of a Linux System
Diagnostics of a Linux System
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
 
Embedded system - embedded system programming
Embedded system - embedded system programmingEmbedded system - embedded system programming
Embedded system - embedded system programming
 
Flexible DevOps Deployment of Enterprise Test Environments in the Cloud
Flexible DevOps Deployment of Enterprise Test Environments in the CloudFlexible DevOps Deployment of Enterprise Test Environments in the Cloud
Flexible DevOps Deployment of Enterprise Test Environments in the Cloud
 
Thinking inside the box (shared)
Thinking inside the box (shared)Thinking inside the box (shared)
Thinking inside the box (shared)
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
 
12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction
 
Embedded systems introduction
Embedded systems introductionEmbedded systems introduction
Embedded systems introduction
 
Embedded Systems Introduction
Embedded Systems IntroductionEmbedded Systems Introduction
Embedded Systems Introduction
 

More from JOLLUSUDARSHANREDDY

RTOS CASE STUDY OF CODING FOR SENDING APPLIC...
                                RTOS  CASE STUDY OF CODING FOR SENDING APPLIC...                                RTOS  CASE STUDY OF CODING FOR SENDING APPLIC...
RTOS CASE STUDY OF CODING FOR SENDING APPLIC...
JOLLUSUDARSHANREDDY
 
MEMORY MANAGEMENT
MEMORY MANAGEMENTMEMORY MANAGEMENT
MEMORY MANAGEMENT
JOLLUSUDARSHANREDDY
 
Os security issues
Os security issuesOs security issues
Os security issues
JOLLUSUDARSHANREDDY
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ES
JOLLUSUDARSHANREDDY
 
RTOS LINUX2.6.X & LINUX2.6.24
 RTOS    LINUX2.6.X & LINUX2.6.24 RTOS    LINUX2.6.X & LINUX2.6.24
RTOS LINUX2.6.X & LINUX2.6.24
JOLLUSUDARSHANREDDY
 
OSEK / VDX
OSEK / VDXOSEK / VDX
OSEK / VDX
JOLLUSUDARSHANREDDY
 
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENTDEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
JOLLUSUDARSHANREDDY
 
INTERRUPT LATENCY AND RESPONSE OF THE TASK
INTERRUPT LATENCY AND RESPONSE OF THE TASKINTERRUPT LATENCY AND RESPONSE OF THE TASK
INTERRUPT LATENCY AND RESPONSE OF THE TASK
JOLLUSUDARSHANREDDY
 
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
JOLLUSUDARSHANREDDY
 
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
JOLLUSUDARSHANREDDY
 
WINDOWS-CE
WINDOWS-CEWINDOWS-CE
Automated system for fault analysis in industries using
Automated system for fault analysis  in industries usingAutomated system for fault analysis  in industries using
Automated system for fault analysis in industries using
JOLLUSUDARSHANREDDY
 
CASE STUDY OF DIGITAL CAMERA HARDWARE AND SOFT WARE ARCHITECTURECASE STUDY OF...
CASE STUDY OF DIGITAL CAMERAHARDWARE AND SOFT WAREARCHITECTURECASE STUDY OF...CASE STUDY OF DIGITAL CAMERAHARDWARE AND SOFT WAREARCHITECTURECASE STUDY OF...
CASE STUDY OF DIGITAL CAMERA HARDWARE AND SOFT WARE ARCHITECTURECASE STUDY OF...
JOLLUSUDARSHANREDDY
 
SOLAR TRACKING SYSTEM BY USING MICROCONTROLLER
 SOLAR  TRACKING  SYSTEM  BY  USING  MICROCONTROLLER SOLAR  TRACKING  SYSTEM  BY  USING  MICROCONTROLLER
SOLAR TRACKING SYSTEM BY USING MICROCONTROLLER
JOLLUSUDARSHANREDDY
 
Zigbee Based Solar Light System By Using LDR
Zigbee Based Solar Light System By Using LDRZigbee Based Solar Light System By Using LDR
Zigbee Based Solar Light System By Using LDR
JOLLUSUDARSHANREDDY
 
Design of smart nodes for wireless sensor network ...
Design of smart nodes for wireless sensor network                            ...Design of smart nodes for wireless sensor network                            ...
Design of smart nodes for wireless sensor network ...
JOLLUSUDARSHANREDDY
 
ATM USER ACCOUNT SECURE BY USING GSM TECHNOLOGY
ATM USER ACCOUNTSECURE BYUSING GSM TECHNOLOGYATM USER ACCOUNTSECURE BYUSING GSM TECHNOLOGY
ATM USER ACCOUNT SECURE BY USING GSM TECHNOLOGY
JOLLUSUDARSHANREDDY
 
BOMB DETECTION ROBOT BY USING GSM & GPS
BOMB DETECTION ROBOT BY USING GSM & GPSBOMB DETECTION ROBOT BY USING GSM & GPS
BOMB DETECTION ROBOT BY USING GSM & GPS
JOLLUSUDARSHANREDDY
 
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFIDSTUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
JOLLUSUDARSHANREDDY
 
SOLAR BASED MOBILE CHARGER IN RURAL AREAS
SOLAR BASED MOBILE CHARGER IN RURAL AREASSOLAR BASED MOBILE CHARGER IN RURAL AREAS
SOLAR BASED MOBILE CHARGER IN RURAL AREAS
JOLLUSUDARSHANREDDY
 

More from JOLLUSUDARSHANREDDY (20)

RTOS CASE STUDY OF CODING FOR SENDING APPLIC...
                                RTOS  CASE STUDY OF CODING FOR SENDING APPLIC...                                RTOS  CASE STUDY OF CODING FOR SENDING APPLIC...
RTOS CASE STUDY OF CODING FOR SENDING APPLIC...
 
MEMORY MANAGEMENT
MEMORY MANAGEMENTMEMORY MANAGEMENT
MEMORY MANAGEMENT
 
Os security issues
Os security issuesOs security issues
Os security issues
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ES
 
RTOS LINUX2.6.X & LINUX2.6.24
 RTOS    LINUX2.6.X & LINUX2.6.24 RTOS    LINUX2.6.X & LINUX2.6.24
RTOS LINUX2.6.X & LINUX2.6.24
 
OSEK / VDX
OSEK / VDXOSEK / VDX
OSEK / VDX
 
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENTDEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
 
INTERRUPT LATENCY AND RESPONSE OF THE TASK
INTERRUPT LATENCY AND RESPONSE OF THE TASKINTERRUPT LATENCY AND RESPONSE OF THE TASK
INTERRUPT LATENCY AND RESPONSE OF THE TASK
 
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
 
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
 
WINDOWS-CE
WINDOWS-CEWINDOWS-CE
WINDOWS-CE
 
Automated system for fault analysis in industries using
Automated system for fault analysis  in industries usingAutomated system for fault analysis  in industries using
Automated system for fault analysis in industries using
 
CASE STUDY OF DIGITAL CAMERA HARDWARE AND SOFT WARE ARCHITECTURECASE STUDY OF...
CASE STUDY OF DIGITAL CAMERAHARDWARE AND SOFT WAREARCHITECTURECASE STUDY OF...CASE STUDY OF DIGITAL CAMERAHARDWARE AND SOFT WAREARCHITECTURECASE STUDY OF...
CASE STUDY OF DIGITAL CAMERA HARDWARE AND SOFT WARE ARCHITECTURECASE STUDY OF...
 
SOLAR TRACKING SYSTEM BY USING MICROCONTROLLER
 SOLAR  TRACKING  SYSTEM  BY  USING  MICROCONTROLLER SOLAR  TRACKING  SYSTEM  BY  USING  MICROCONTROLLER
SOLAR TRACKING SYSTEM BY USING MICROCONTROLLER
 
Zigbee Based Solar Light System By Using LDR
Zigbee Based Solar Light System By Using LDRZigbee Based Solar Light System By Using LDR
Zigbee Based Solar Light System By Using LDR
 
Design of smart nodes for wireless sensor network ...
Design of smart nodes for wireless sensor network                            ...Design of smart nodes for wireless sensor network                            ...
Design of smart nodes for wireless sensor network ...
 
ATM USER ACCOUNT SECURE BY USING GSM TECHNOLOGY
ATM USER ACCOUNTSECURE BYUSING GSM TECHNOLOGYATM USER ACCOUNTSECURE BYUSING GSM TECHNOLOGY
ATM USER ACCOUNT SECURE BY USING GSM TECHNOLOGY
 
BOMB DETECTION ROBOT BY USING GSM & GPS
BOMB DETECTION ROBOT BY USING GSM & GPSBOMB DETECTION ROBOT BY USING GSM & GPS
BOMB DETECTION ROBOT BY USING GSM & GPS
 
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFIDSTUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
STUDENT DATA LOGGING SYSTEM INTO COLLEGE WEBSITE BASED ON RFID
 
SOLAR BASED MOBILE CHARGER IN RURAL AREAS
SOLAR BASED MOBILE CHARGER IN RURAL AREASSOLAR BASED MOBILE CHARGER IN RURAL AREAS
SOLAR BASED MOBILE CHARGER IN RURAL AREAS
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Rt linux-lab1

  • 1. J.SUDARSHANREDDY RTLinux Lab – Introduction Cpre 558 J.SUDARSHANREDDY 01/25/15
  • 2. J.SUDARSHANREDDY Contents • Real-Time Operating System (RTOS) Vs. General Purpose OS (GPOS) • Can Linux provide real-time guarantees? • Commercial RTOSs • RTLinux Vs. Linux: Architectural comparison • RTLinux Vs. Linux: Code perspective • Get the RTLinux setup ready • Things to Issue and Handling the hard disk • Lab #1: Detailed discussion 01/25/15
  • 3. J.SUDARSHANREDDY RTOS Vs. GPOS • RTOS – needs deterministic timing behavior – Works under worst case assumptions • GPOS – high throughput and fairness – Optimizes for the average case • Hence, the design objectives of the OSs are different 01/25/15
  • 4. J.SUDARSHANREDDY Can Linux provide real-time guarantees? -- No!! • Linux – non-preemptible kernel • A system call might take long time to complete – Coarse timer resolution • Tasks can be released only with 10ms precision – Virtual memory • Introduces unpredictable amount of delays – Variable priority • Each task is assigned a priority which varies over the time; this is to achieve fairness 01/25/15
  • 5. J.SUDARSHANREDDY Can Linux provide real-time guarantees? -- No!! (contd..) • Linux – Linux will batch several operations for efficient use of H/W delaying all tasks – Linux also reorders requests from multiple processes for H/W efficiency – Linux does not preempt low priority task in a system call, instead queues the high priority task – Linux makes high priority tasks to wait for low priority tasks to release resources Therefore, Linux cannot provide real-time guarantees 01/25/15
  • 6. J.SUDARSHANREDDY Commercial RTOS • RTLinux – Monolithic kernel with loadable modules • QNX – Microkernel approach • VxWorks – Monolithic kernel • LynxOS – Microkernel • ARTS, Spring, KURT, RTAI, etc…. 01/25/15
  • 7. J.SUDARSHANREDDY • Open source Linux project • Supports x86, PowerPC, Alpha • Available as a patch to the regular Linux kernel • Provides an RT API for developers • Runs Linux kernel as lowest priority process RTLinux: Overview 01/25/15
  • 8. J.SUDARSHANREDDY Linux Kernel System libraries Device drivers Linux kernel Hardware I/O Hardware Interrupts User Processes 01/25/15
  • 9. J.SUDARSHANREDDY RTLinux Kernel Hardware System libraries Device drivers Linux kernel I/O Software Interrupts User Processes RTLinux Plug-in Real Time Tasks RT-Scheduler I/O Hardware Interrupts Linux is executed in the background Direct h/w access 01/25/15
  • 10. J.SUDARSHANREDDY Linux Kernel: code perspective Linux Monolithic kernel core M1 M2 M3 M4 KernelLoadableModules RAM DISK Module M2 service (system call) User Process M2 THE controller 01/25/15
  • 11. J.SUDARSHANREDDY RTLinux Kernel: code perspective Linux Monolithic kernel core RTM2 RTM3 M1 M2 KernelLoadableModules RAM DISK Load RT core RT Load command RT-Core Module RT core M3 THE controller 01/25/15
  • 12. J.SUDARSHANREDDY Getting RTLinux ready • Configure and compile a fresh Linux kernel (2.4.29) – Download the kernel from http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4 • Patch the RTLinux to the Linux kernel • Recompile the kernel and reboot the system into the new kernel • Configure the RTLinux kernel and compile it 01/25/15
  • 13. J.SUDARSHANREDDY So, How do we run a RT-application program ? • Step 1: Write the RT-application program as a kernel module – (You are still in Linux) • Step 2: Compile the module and check for errors – (You are still in Linux) • Step 3: Load the RT-Core (or RT Scheduler, etc..) and the RT-application program module – (After this we will be in RTLinux) • Step 4: Now you are in RTLinux!!!! 01/25/15
  • 14. J.SUDARSHANREDDY Homework • Submission 1: – Give a ten line write-up comparing RTLinux with Linux with at least five differences along with the references. • Submission 2: – Give a ten line write-up comparing RTLinux with two other commercial RTOSs with at least five differences for each of them along with the references. 01/25/15
  • 15. J.SUDARSHANREDDY Lab Policies • Six assignments in total • First three assignments are mandatory • One of the last three assignments is mandatory • You will be working with a removable hard disk which can be issued from CSG 01/25/15
  • 16. J.SUDARSHANREDDY Things to Issue • Issue the following from the CSG – Hard disk (one per group) – Key (one per group) – RHEL – WS3 installation DVD (one per group) • You need to download the lab01 tar file (lab01.tgz) from the course website. • The RTLinux lab is in Coover - 1331C 01/25/15
  • 17. J.SUDARSHANREDDY Handling the hard disk (1) • Shutdown the PC • After the power is off, unlock the existing hard disk and take it out • Insert the hard disk given to you and lock it • Restart the comp • Follow the manual you have downloaded from the course website 01/25/15
  • 18. J.SUDARSHANREDDY Handling the hard disk (2) • After you are done with the lab: – Shutdown the PC – After the power is off, unlock the hard disk and remove it – Insert the original hard disk and lock it – Leave the Lab 01/25/15
  • 19. J.SUDARSHANREDDY Lab 1: Objectives • Part 1: – Getting the RTLinux lab setup ready • Part 2: – Run a few simple hello-world modules 01/25/15
  • 20. J.SUDARSHANREDDY Part 1 • Install the RHEL-WS3 using the DVD given to you – Go for the auto-partitioning option – Rest everything is straightforward • Configure and compile fresh Linux kernel (2.4.29) • Patch the RTLinux to the Linux kernel • Recompile the kernel and reboot the system into the new kernel • Load RT-modules • Instructions are provided in the Lab manual 01/25/15
  • 21. J.SUDARSHANREDDY Part 2 • Boot into the RTLinux kernel compiled in part-1 • The objectives of the part 2 are: – Understanding a simple RTLinux kernel module • With one thread (hello-1) and two threads (hello-2) – Printing from a RTLinux module • rtl_printf (hello-3) • Using rtf_put (RT-FIFO) (hello-4) 01/25/15
  • 22. J.SUDARSHANREDDY A kernel module Vs. Program • All RT-Tasks are kernel modules. Therefore, we write kernel modules in this lab. • A user program runs in user space and the kernel module runs in the kernel space • A user program starts running at its “main” function • A kernel module starts running at the “init_module” function and exits via “cleanup_module” function • Therefore, for a kernel module “init_module” and ‘cleanup_module” are as necessary as “main” is necessary for a C program 01/25/15
  • 23. J.SUDARSHANREDDY A typical kernel module Init_module() { ……. Perform your module initiation stuff etc.. } Cleanup_module() { ……. Perform cleanup stuff like destroying the threads, freeing memory, etc.. } 01/25/15
  • 24. J.SUDARSHANREDDY Hello world Module • Go through the hello world module • Realize the importance of init_module and cleanup_module • Notice the way the thread is created and how it is made periodic • Understand the “pthread_make_periodic” and “pthread_wait” and other interfacing functions 01/25/15
  • 25. J.SUDARSHANREDDY A typical RTLinux module Init_module() { For each thread: Choose the priority function //pthread_set_priority(..); Assign the “task_function” to the thread Create the thread //pthread_create(.., task_function,..); } Task_function() { Pthread_make_periodic_np( p); while(1) { Pthread_wait_np(); //perform the task function //for this instance } } Cleanup_module() { ……. Delete the thread //pthread_delete_np(..); } This function tells the scheduler that I am a periodic task with period “p” This function tells the scheduler that I am done for this instance and schedule me after “p” units of time 01/25/15
  • 26. J.SUDARSHANREDDY Hello World 2 • This module creates two threads using a nice “thread_struct” structure to make the initialization easy and compact. • Once again go through the interfacing funcitons • This time put more “rtl_printf” statements and open “/var/log/messages” file to find your output 01/25/15
  • 27. J.SUDARSHANREDDY RTL_PRINTF: how does it work? Rtl_printf printk Printk buffer Kernel ring buffer syslodgconsole Might overflow!! Might overflow!! Log file 01/25/15
  • 28. J.SUDARSHANREDDY Other ways of printing: RTL-FIFO • RTLinux FIFO provides communication mechanisms between RTL threads and Linux task. • A linux process creates the RTL-FIFO buffer which the RTL threads access and write and read from them 01/25/15
  • 29. J.SUDARSHANREDDY RTL-FIFO • Creating and destroying FIFOS: – Using functions: rtf_create and rtf_destroy – These functions are called from linux process: open(), read(), write(); • Accessing FIFOs from RTL threads – using functions: rtf_put and rtf_get 01/25/15
  • 30. J.SUDARSHANREDDY Using RTL_FIFO RT Task: my_put task Linux Task: my_read task RTL FIFO rtf_create() Time rtf_put() open() read() rtf_destroy() 01/25/15
  • 31. J.SUDARSHANREDDY Submissions • Submission 1: – Submit a five line write-up explaining the working of the two RTL interfacing functions including: • Pthread_make_periodic_np • Pthread_wait_np • Rtf_create,rtf_destroy, rtf_put, rtf_get • Submission 2: – Submit a five line write-up giving at least five differences between a kernel module and a user program. 01/25/15