Logo RTAI & LTT Choi Sung Chul. What is the RTAI ?  Realtime Application Interface  A patch to the Linux kernel which introduces a hardware abstraction.

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
Lecture 101 Lecture 10: Kernel Modules and Device Drivers ECE 412: Microcomputer Laboratory.
RT_FIFO, Device driver.
4 Oracle Data Integrator First Project – Simple Transformations: One source, one target 3-1.
Tutorial 3 - Linux Interrupt Handling -
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Operating-System Structures
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
1 Last Time: OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Embedded Real-time Systems The Linux kernel. The Operating System Kernel Resident in memory, privileged mode System calls offer general purpose services.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 1 Introduction to Managing the SUSE Linux Enterprise Server.
Cyclic Scheduling –Advantages Simple implementation (no real-time operating system is required). Low run-time overhead. It allows jitter control. –Disadvantages.
OMNET++. Outline Introduction Overview The NED Language Simple Modules.
Hands-On Microsoft Windows Server 2008
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Final Year Project Electronic & Computer Engineering Student: Andrew Sweeney Supervisor: Dr. Peter Corcoran Design and Realisation of Experiments for an.
HyunJun Choi Aug 27, 2004 OPNET Simulator HyunJun Choi Aug 27, 2004 Informational Communication University.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
1 Haptic Systems Mohsen Mahvash Lecture 4 12/1/06.
Chapter 3 Process Description and Control
Xenomai’s Porting on processor NIOS II Professor : P. Kadionik Authors : Bassi Vincent Louati Azza Mirault Raphael Polette Simon.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Final Project Alexander Popp. Outline AbstractBackgroundPurposeExperimentalResultsConclusionSummary.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Version How to Use Packet Tracer MarinaMD.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
BridgePoint Integration John Wolfe / Robert Day Accelerated Technology.
The Performance of μ-Kernel-Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presenter: Sunita Marathe.
K ERNEL D EVELOPMENT CSC585 Class Project Dawn Nelson December 2009.
1 Pthread Programming CIS450 Winter 2003 Professor Jinhua Guo.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Field Programmable Port Extender (FPX) 1 NCHARGE: Remote Management of the Field Programmable Port Extender (FPX) Todd Sproull Washington University, Applied.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
Chapter 2. System Structures
Linux Kernel Programming (LKP). LKP New sub-course New sub-course We will learn together We will learn together Evaluation of this part of course will.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
LonWorks Introduction Hwayoung Chae.
© 2013 MontaVista Software, LLC. MontaVista Confidential and Proprietary. CGE7 Flight Recoder Demo Nawneet Anand.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
WORKING OF SCHEDULER IN OS
Current Generation Hypervisor Type 1 Type 2.
Simulation of Distributed Application and Protocols using TOSSIM
CS 6560: Operating Systems Design
Mechanism: Limited Direct Execution
Chapter 2: System Structures
Process Management Presented By Aditya Gupta Assistant Professor
Threads and Locks.
Threads and Cooperation
Structure of Processes
Mid Term review CSC345.
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Chapter 3: Processes.
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Process Description and Control in Unix
Process Description and Control in Unix
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Logo RTAI & LTT Choi Sung Chul

What is the RTAI ?  Realtime Application Interface  A patch to the Linux kernel which introduces a hardware abstraction layer  A broad variety of services which make realtime programmers' lifes easier  Working with POSIX compliant or native RTAI realtime tasks  Linux application is able to execute without any modification

What kind of functions does RTAI support?  real time scheduler module - Task functions - Timing functions - Semaphore functions - Mailbox functions - Intertask communication functions  Fifo services  Shared memory  Posix pthread and pqueue(msg queue)

How to make a RTAI program  It is a similar to make linux kernel module  Use several functions for RTAI program  Example RTAI program int init_module(void) { RTIME tick_period; rt_set_periodic_mode(); rt_task_init(&rt_task, fun, 1, STACK_SIZE, TASK_PRIORITY, 1, 0); rtf_create(FIFO, 8000); tick_period = start_rt_timer(nano2count(TICK_PERIOD)); rt_task_make_periodic(&rt_task, rt_get_time() + tick_period, tick_period); return 0; } void cleanup_module(void) { stop_rt_timer(); rtf_destroy(FIFO); rt_task_delete(&rt_task); return; }

What is the LTT?  Linux Trace Toolkit  Linux kernel tracing capabilities with 48 unique Trace Points  Variable-length events minimizing overall trace size  Minimal performance overhead (< 2.5 %).  Micro-second event time-stamps  graphical user interface with event graph, system and per-process analysis, and raw event descriptions.  Support for the Real-Time Application Interface

Why LTT?  It is too hard to debug kernel like Real Time program  It isn’t able to be checked transmitting and receiving message or signal accuracy  We can see the kernel event and message transferring easily to use LTT  LTT can make user defined event(custom event)  it needs not use “printk”!!  LTT can dump selected event and message. So, we can save it and analysis anytime

Install RTAI & LTT (1)  Need files - TraceToolkit 0.95a  - linux kernel  - RTAI   Compiler - gcc version

Install RTAI & LTT (2)  Linux Kenel Patch & Compile Patch from LTT patchs directory - #~/linux>patch -p1 < ~/TraceToolkit-0.9.5a/Patches/patch-ltt-linux rthal5f  Modify kernel source (2 files) - linux/arch/i386/kernel/irq.c,linux/include/asm-i386/system.h  Kernel setting & compile - NO : Set version information on all module symbols - YES : Real-Time Hardware Abstraction Layer - Module : Kernel event tracing support - YES : RTAI event tracing support - APM : disable  Make boot image & Reboot - Add boot image to lilo or grub

Install RTAI & LTT (3)  Install RTAI - #> Configure –menu  Menu Setting  Modify sources (2 files) - arch/i386/rtai.c, upscheduler/rtai_sched.c  Make & make install  Load modules $> modprobe -v rtai /sbin/insmod /lib/modules/ rthal5trace/rtai/rtai_tracer.o Using /lib/modules/ rthal5-trace/rtai/rtai_tracer.o Symbol version prefix 'smp_' /sbin/insmod /lib/modules/ rthal5-trace/rtai/rtai.o Using /lib/modules/ rthal5-trace/rtai/rtai.o $>lsmod Module Size Used by Tainted: P rtai (unused) rtai_tracer [rtai] binfmt_misc ….

Install RTAI & LTT (3)  Configire –with-rtai & make install  Execute createdev.sh (make node /dev/tracer) - $>./createdev.sh Deleting old tracer nodes: /dev/tracer and /dev/tracerU Found tracer device with major number: 253 Creating new tracer nodes: /dev/tracer and /dev/tracerU  Trace time(sec) - this records data(kernel and app trace event) for require time  Traceview - graphic tool for event graph, system and per-process analysis, and raw event descriptions

LTT & Traceview Screenshot

Example1 for using LTT in a RTAI program  Offered ex - /rtai /examples/msgsw  This example features NTASKS(8) real-time tasks running periodically  On each period a server task is messaged to set/reset a bit on the parallel port  By choosing an appropriate timing one can produce a rectangular wave which can be watched on an oscilloscope plugged into it

Block diagram for example1

Flow diagram for example1

Traceview of example1

Zoom function of Traceview

Example2 for using LTT in a RTAI program  Simple wave actived generator simulation  Let’s wave factor = sin(t)  A sensor for wave height  Its pen of Turbine changes direction when height reaches max or min value  Turbine always rotate one side direction.

Simplify model for wave actived generator

Simple SDL for example2 program

User defined custom event  When it can’t be used printk and must be checked variable  LTT support user define event int trace_create_event ( char* /* String describing event type */, char* /* String to format standard event description */, int /* Type of formatting used to log event data */, char* /* Data specific to format */); int trace_destroy_event( int /* The event ID given by trace_create_event() */); int trace_user_event( int /* The event ID given by trace_create_event() */, int/* The size of the raw data */, void* /* Pointer to the raw event data */);

Custom event of example1  Make event traceId = trace_create_event("WaveActivedGen", "%s", CUSTOM_EVENT_FORMAT_TYPE_STR, NULL); trace_std_formatted_event(traceId, "Trace init_module");  Wave height value sprintf(dbgMsg, "height:%d", (int)wave_height); trace_std_formatted_event(traceId, dbgMsg);  Recv turn event trace_std_formatted_event(traceId, "Do Pen Turn Right!"); trace_std_formatted_event(traceId, "Do Pen Turn Left!");

Dump event and message  Traceview -> menu -> file ->dump file  Select dump message or event  Example2 custom message dump Trace start time: ( , ) Trace end time: ( , ) Trace duration: (2, ) Number of occurences of: Events: Scheduling changes: 821 Kernel timer tics: 228 System call entries: 3006 System call exits: 3005 Trap entries: 0 Trap exits: 0 IRQ entries: 337 IRQ exits: 337 Bottom halves: 228 Timer expiries: 73 Page allocations: 417 Page frees: 415 Packets Out: 0 Packets In: 112

#################################################################### EventTimePIDLengthDescription #################################################################### Event creation 1,097,134,998,633,204 N/A 391 NEW EVENT TYPE : WaveActivedGen; CUSTOM EVENT ID : 24 RT-Timer 1,097,134,998,633,860 N/A 16 TIMER EXPIRY WaveActivedGen 1,097,134,998,633,866 N/A 30 height:183 RT-Task 1,097,134,998,633,866 N/A 28 WAIT PERIOD RT-Timer 1,097,134,998,640, TIMER EXPIRY RT-Task 1,097,134,998,640, WAIT PERIOD WaveActivedGen 1,097,134,998,640, height:185 RT-Task 1,097,134,998,640, WAIT PERIOD RT-Timer 1,097,134,998,647, TIMER EXPIRY WaveActivedGen 1,097,134,998,647, height:187 RT-Task 1,097,134,998,647, WAIT PERIOD RT-Timer 1,097,134,998,653, TIMER EXPIRY RT-Task 1,097,134,998,653, WAIT PERIOD WaveActivedGen 1,097,134,998,653, height:189 RT-Task 1,097,134,998,653, WAIT PERIOD RT-Timer 1,097,134,998,660, TIMER EXPIRY WaveActivedGen 1,097,134,998,660, height:190 RT-Task 1,097,134,998,660, WAIT PERIOD RT-Timer 1,097,134,998,667, TIMER EXPIRY RT-Task 1,097,134,998,667, WAIT PERIOD WaveActivedGen 1,097,134,998,667, height:192 RT-Task 1,097,134,998,667, WAIT PERIOD RT-Timer 1,097,134,998,673, TIMER EXPIRY WaveActivedGen 1,097,134,998,673, height:193 RT-Task 1,097,134,998,673, WAIT PERIOD RT-Timer 1,097,134,998,680, TIMER EXPIRY RT-Task 1,097,134,998,680, WAIT PERIOD WaveActivedGen 1,097,134,998,680, height:194 RT-Task 1,097,134,998,680, WAIT PERIOD RT-Timer 1,097,134,998,687, TIMER EXPIRY WaveActivedGen 1,097,134,998,687, height:195 RT-Task 1,097,134,998,687, WAIT PERIOD RT-Timer 1,097,134,998,694, TIMER EXPIRY RT-Task 1,097,134,998,694, WAIT PERIOD WaveActivedGen 1,097,134,998,694, height:196 RT-Task 1,097,134,998,694, WAIT PERIOD RT-Timer 1,097,134,998,700, TIMER EXPIRY WaveActivedGen 1,097,134,998,700, height:197

WaveActivedGen 1,097,134,998,754, height:199 RT-Task 1,097,134,998,754, WAIT PERIOD RT-Timer 1,097,134,998,760, TIMER EXPIRY RT-Message 1,097,134,998,760, SEND => TASK : 1; MSG : 1d WaveActivedGen 1,097,134,998,760, Do Pen Turn Right! RT-Message 1,097,134,998,760, RECEIVE => TASK : 2 RT-Task 1,097,134,998,760, WAIT PERIOD WaveActivedGen 1,097,134,998,760, height:199 RT-Task 1,097,134,998,760, WAIT PERIOD RT-Timer 1,097,134,998,767, TIMER EXPIRY WaveActivedGen 1,097,134,998,767, height:199 RT-Task 1,097,134,998,767, WAIT PERIOD RT-Timer 1,097,134,998,774, TIMER EXPIRY RT-Task 1,097,134,998,774, WAIT PERIOD WaveActivedGen 1,097,134,998,774, height:198