Implementation Of Real-time Network Extension On Embedded .

3y ago
19 Views
3 Downloads
613.55 KB
5 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Milena Petrie
Transcription

2009 International Conference on Communication Software and NetworksImplementation of Real-time Network Extension on Embedded LinuxYuan Tian1,2Guoqiang RenQinzhang Wu1. Institute of Optics and Electronics,Chinese Academy of Science2. Graduate University of the ChineseAcademy of ScienceChengdu , Chinaioecas@gmail.comInstitute of Optics and Electronics,Chinese Academy of ScienceChengdu , Chinaioeren@163.comInstitute of Optics and Electronics,Chinese Academy of ScienceChengdu , Chinaioeren@163.comAbstract—Linux over the past few years has gained inpopularity as the operating system for embedded networkingequipment. Its reliability, low cost and undisputed networkingcapabilities made it one of the most popular choices for thenetworking devices. But traditional software networkinterfaces in Linux do not deliver satisfactory real-timeperformance. Hence alternative efficient real-time interfacesare required in network monitoring, distributed systems, realtime networking and remote data acquisition applications. Soit is necessary to modify the original Linux to meet the realtime requirement. This paper describes the implementation ofreal-time network extension based on embedded Linux.Compared with different solution of achieving real-tine abilityon Linux system, Xenomai and Rtnet have been chosen in oursystem. Finally, the real-time performance test has beencarried out on embedded Linux network system. The testresults indicate that, through applying Xenomai and Rtnet onembedded Linux, the hard real-time requirement can be met inour system.Keywords: Xenomai;Rtnet;Embedded Linux;Real-timeI.INTRODUCTIONPowerPC440 embedded processor was used to controland manage the entire system in hardware system.PowerPC440 is designed specifically to address high-endembedded applications and provides a high-performance,low-power solution which is able to interface to a wide rangeof peripherals. With on-chip power management features andintrinsically lower power dissipation, this embeddedprocessor is suitable for embedded applications. This chipcontains a high-performance RISC processor core, DDRSDRAM controller, PCI-X bus interface, Ethernet interface,control for external ROM and peripherals, DMA withscatter-gather support, serial ports, IIC interface, and generalpurpose I/O. Figure 1 illustrates the architecture of thehardware system based on PowerPC440[1].Today, the use of Linux in embedded systems becomemore popular, because of its proven networking capabilitiesand well suiting for networking applications and services thatrequire high reliability and high availability [2]. So Linuxwas chosen as operating system in our designing. However,Linux is not a real-time operating system. There are usuallytwo approaches to make Linux real-time. The one is using asecond kernel to schedule real-time tasks: solutions include978-0-7695-3522-7/09 25.00 2009 IEEEDOI 10.1109/ICCSN.2009.119Figure 1. Architecture of the hardware systemXenomai/ADEOS, RTLinux and RTAI, etc. The other isimproving Linux kernel itself with regards to preemption,low latency, etc. In order to implement hard real-timenetwork, Xenomai/ADEOS was chosen as real-timeoperating system mentioned in first method. Xenomai is areal-time development framework cooperating with theLinux kernel. It implements a micro-kernel with real-timescheduler. Xenomai's real-time nucleus and Linux kernel arein two ADEOS domains. Xenomai runs in a higher prioritydomain than Linux kernel. It also implements different APIsproviding real-time services, like creating real-time tasks,timers, semaphores [3].RTnet is an open source hard real-time network protocolstack for Xenomai and RTAI (real-time Linux extensions).Itmakes use of standard Ethernet hardware and supportsseveral popular card chip sets, including Gigabit Ethernet.RTnet implements UDP/IP, ICMP and ARP in adeterministic way. It provides a POSIX socket API to realtime user space processes and kernel modules. Access to163Authorized licensed use limited to: University of North Carolina at Charlotte. Downloaded on January 15, 2010 at 00:31 from IEEE Xplore. Restrictions apply.

nondeterministic media is managed by the pluggable RTmaclayer and the actual control discipline. As default forEthernet, a Time Division Multiple Access (TDMA)discipline is provided.In this paper, we describe the implementation of realtime network extension based on embedded Linux. Theremainder of this paper is organized as follows. In section 2,the procedure of setting up bootloader and Linux kernel ispresent. Section 3 describes the architecture of Xenomai andhow to use it to realize real-time kernel. Then RTnet basedon Xenomai is introduced in section 4. Finally, we concludein section 5.II.very important characteristics for devices that rely on flashstorage. The creation of a JFFS2 image is fairly simple:mkfs.jffs2 -r rootfs/ -o images/rootfs-jffs2.imgOnce you create the JFFS2 image, you can write it to itsdesignated MTD device. But you first need to erase theMTD device where the image will be placed:eraseall /dev/mtd0With the MTD device erased, copy the JFFS2 image tothe MTD partition:cat images/rootfs-jffs2.img /dev/mtd0Now, mount the copied file system to take a look at it. Ifyour target had previously been using an nfs-mounted rootfile system, you are now ready to boot it using the JFFS2 filesystem as its root file system. Thus the entire system set upautomatically and successfully.SETTING UP BOOTLOADER AND LINUX KERNELThough the bootloader runs for a very short time duringthe system's startup and is mainly responsible for loading thekernel, it is a very important system component. It is aspecial task for embedded Linux systems, because thebootloaders used in such systems are either completelydifferent from those used in common systems or, even whenthey are the same, are configured and operated in verydifferent ways.U-Boot, the universal bootloader, is arguably the richest,most flexible, and most actively developed open sourcebootloader available. U-Boot is based on the PPCBoot andARMBoot projects. The version of U-Boot we used is 1.1.4[4].There are a lot of examples of evaluation board in UBoot, but our hardware system is different from them. Sosome codes in U-Boot should be changed to adapt oursystem. Three main aspects of code should be modified. First,some addresses of peripheral hardware are needed to change.Second, the parameters to initialize SDRAM are adjusted.Finally, some device drivers should be rewrite. Afterfinishing the three steps, U-Boot commands can be used tocheck system information, for example printenv, flinfo etc.As the same with U-Boot, there are also lots of examplesfor different evaluation board in Linux source. The codes ofan evaluation board which is similar with our hardwaresystem are chosen. Then make some modification in Linuxkernel source which is similar in U-Boot. After compilingthe kernel, a uImage in the kernel source can be gained. NowU-Boot is used to download the uImage and startup system.One of the last operations conducted by the Linux kernelduring system startup is mounting the root file system. Theroot file system has been an essential component of Linuxsystems from the start. At the stage of test, network filesystem is used as root file system. The host nfs server isenabled and export a directory as root file system to targetsystem. Then the target can mount this directory and sharethe file with host. After finishing testing, U-Boot, kernel andfile system should be put into flash in three differentpartitions. In order to implement flash partition, Linux’sMTD subsystem is used. JFFS2 is chosen as root file system.Though JFFS2 doesn't achieve compression ratios as high asCRAMFS, it has to maintain space for garbage collectionand metadata structures that allow file system writing. JFFS2provide power-down reliability and wear-leveling, which areIII.XENOMAI EVALUATIONXenomai is a new real-time operating system emulationframework based on Linux. It aims at providing a consistentframework that helps implementing real-time interfaces anddebugging real-time software on Linux. Xenomai comeswith a growing set of emulators of traditional RTOS APIs,which ease the migration of applications from these systemsto a Linux-based real-time environment.It was designed with the goal to help applicationdesigners using traditional and proprietary real-timeoperating systems to move as smoothly as possible to aLinux based execution environment. Xenomai relies on thecommon features and behaviors found between manyembedded traditional RTOS, especially from the threadscheduling and synchronization standpoints. Thesesimilarities are exploited to implement a nucleus exporting aset of generic services. These services grouped in a highlevel interface can be used in turn to implement emulationmodules of real-time application programming interfaces,which mimic the corresponding real-time kernel APIs [5].A. Architecture of XenomaiTo make Xenomai’s tasks hard real-time in Linux a RealTime Application Interface co-kernel is used. It allowsrunning real-time tasks seamlessly aside of the hosting Linuxsystem while the tasks of the regular Linux kernel can beseen as running in a low-priority mode. The Real-TimeApplication Interface co-kernel shares hardware interruptsand system-originated events like traps and faults with theLinux kernel using the Adaptive Domain Environment forOperating Systems (Adeos) layer, which in turn ensuresReal-Time Application Interface low interrupt latencies. Theentire architecture of Xenomai is shown in Figure 2. Adeosis an event pipe line. The purpose of Adeos is to provide aflexible environment for sharing hardware resources amongmultiple operating systems, or among multiple instances of asingle operating system. It has been ported to PowerPC.ADEOS is also known as “I-pipe”, it delivers system events(interrupts, exceptions, system calls) in a timely andprioritized manner, along a “pipe line” of domains.164Authorized licensed use limited to: University of North Carolina at Charlotte. Downloaded on January 15, 2010 at 00:31 from IEEE Xplore. Restrictions apply.

TABLE II.Min-4.211LATENCY WITH HEAVY LOADAvg-3.521Max13.935Overrun0Two tables show that the maximum latency is 13.935useven though in heavy load situation, which doesn’t overrunthe real-time demand.IV.Figure 2. Architecture of XenomaiA. RTnet StackRTnet implements a real-time capable IP-Protocol stack.Thus was done by porting the robust UDP/IP stack of theLinux kernel to RTAI. Furthermore the Address ResolutionProtocol (ARP) that is normally dynamic is replaced by astatic solution. The Media Access Control (MAC) sublayerfrom standard Ethernet (which is nondeterministic becauseof the stochastic media access mechanism CSMA/CD) isreplaced by:(1) a token based MAC variant or a (2) TimeDivision Multiple Access (TDMA) approach. Because of themodularity of Rtnet and the available source code it ispossible to implement a different mechanism for mediaaccess. A wide difference to the above-described Powerlinkprotocol is, that no dedicated protocol controller is needed.The RT capabilities are based on the real-time functionalityof RTAI. Rtnet has been designed to lend real-timenetworking functionality to both the RTAI and Xenomaienvironments. It provides a customizable and extensibleframework for hard real-time communication over Ethernetand other transport media.The design of the RTnet stack as depicted in Figure 3was inspired by the modulised structure of the Linuxnetwork subsystem. It aims at scalability and extensibility inorder to comply with the different requirements ofapplication as well as research scenarios. RTnet’s softwareapproach addresses both the independence of specifichardware for supporting hard real-time communication andthe possibility to use such hardware nevertheless when it isavailable. Furthermore, it enables the integration of variousother communication media beyond Ethernet [8].B. Apply Adeos and Xenomai Kernel Patch to the LinuxKernelRun the Xenomai configuration script to apply the kernelpatch [6].xenomai-root/scripts/prepare-kernel.sh--arch ppc--adeos adeos-patch-dir/adeos-ipipe2.6.19.patch --linux linux-treeConfigure and build kernel:make menuconfigmakeBuild Xenomai applications and install the applications toLinux file system directory. This will build Xenomai inFDPIC format.Xenomai-root/configure --host ppcmake installC. Performance of XenomaiAfter finishing installation of Xenomai, now we can usethe tools in Xenomai to test the system latency. This latencyexample program features a periodic real-time threadmeasuring its scheduling latency over periods of 100 us.Each second, results are posted by the sampling thread to adisplay thread, which in turn outputs the latency figures tothe screen using standard Linux services. This illustrates theseamless migration of Xenomai's real-time threads betweenthe Xenomai and Linux schedulers, in order to performevery system call issued by xeno-enabled Linux tasks fromthe proper execution context. The latency involves handling timer interrupt and current thread scheduled to run. Testresults are shown in two different situations. One is withoutsystem load in table 1, the other is in heavy load in table 2.All results are in microseconds.TABLE I.Min-4.226Avg-3.574B. Installation of RTnet and Driver PortingNow the installation of RTnet will be explained and thetest result of it will also be shown later. Firstly, RTnet sourcecode should be downloaded [9]. The instructions are givenbelow.cd to a preferred directory (e.g. /usr/src)tar xvjf /usr/src/rtnet-0.9.10.tar.bz2cd rtnetLATENCY WITHOUT LOADMax6.385RTNET EVALUATIONWith the goal to provide a widely hardware independentand flexible real-time communication platform, RTnetproject has been founded in 2001 at the University ofHannover, based on ideas and source code of a previouseffort to provide deterministic networking. RTnet is a purelysoftware-based framework for exchanging arbitrary dataunder hard real-time constraints. The availableimplementation is founded on Linux with the hard real-timeextension RTAI [7].Overrun0165Authorized licensed use limited to: University of North Carolina at Charlotte. Downloaded on January 15, 2010 at 00:31 from IEEE Xplore. Restrictions apply.

make menuconfig (run "make help" for further information)TDMA SLAVES. Run /sbin/rtnet start. Run rtping remote-host or load an application module.Round Trip Time (RTT) is used to check theperformance of RTnet. The command of rtping is executedto compute RTT. The test results with different data size areshown in table 3. All results are in microseconds.TABLE 44RTT WITH 64The information from the table above shows that realtime network requirement can be satisfied with RTnet.Figure 3. RTnet StackV.Set at least the real-time extension installation path andthe path RTnet is to be installed to. You could also checkother options if they fit your requirements. Help is availablefor each feature.makemake installBecause Ethernet media access controllers in PowerPCaren’t supported by RTnet currently. So EMAC drivershould be ported from Linux to RTnet. A list is shown belowabout porting Ethernet device driver to RTnet. Add the following fields to private data:struct rtskb queue skb pool;rtdm irq t irq handle; Initialize skb pool in probe or init function: Replace struct net device with struct rtnet device Replace netif stop queue with rtnetif stop queue Replace struct sk buff with struct rtskb Replace netif rx with rtnetif rx Revise the xmit routine Modify interrupt handler Replace alloc etherdev with the following lines Replace dev alloc skb(size) with dev alloc rtskb(size, & priv - skb pool)Ten point just be shown about porting, but they are notenough. It is recommended to take a look at existing driversin RTnet source if some steps remain unclear.CONCLUSIONSIn this paper Xenomai and RTnet based on embeddedLinux are introduced. They are adaptable and extensibleframeworks for real-time network over standard Ethernet.We extensively evaluated the performance of them. The testresults show that this scheme can completely satisfy therequirement of real-time network. We believe this work isimportant to the implementation of distributed real-timesystems, fieldbus coupling devices, low-cost real-timenetwork analysers, etc [10]. Future work will furtheroptimize network performance using advanced interrupthandling techniques.REFERENCES[1][2][3][4][5]C. RTnet TestingAfter installations of RTnet, there are still several stepsshould be taken before testing. First, shutdown the networkdevice which shall become part of the RT-network andremove its driver module (this also means that it must not becompiled into the kernel!). Second, Load required real-timemodules (xeno hal, xeno nucleus, xeno rtdm). Third,Check /etc/rtnet.conf and adapt at least the followingparameters: RT DRIVER, IPADDR, TDMA MODE,[6][7][8]AMCC Applied Micro Circuits Corporation, “PPC440GX EmbeddedProcessor User’s Manual”, Revision 1.04-October 3, 2005Apostolos N. Meliones, Stergios D. Spanos, “Performance Analysisof Embedded Linux ATM for MPC8260 and Derivatives”,Computers and Communications, in: Proceedings 11th IEEESymposium, 26-29 June 2006 , pp.101 – 108A. Barbalace, A. Luchetta, G. Manduchi, M. Moro, A. Soppelsa, C.Taliercio, “Performance comparison of VxWorks, Linux, RTAI andXenomai in a hard real-time application”, IEEE-Trans. Nucl. Sc.,submitted for publication.Karim Yaghmour, Building Embedded Linux Systems, O'Reilly &Associates, Inc, Sebastopol, 2003Philipper Gerum, “The Xenomai Project-Implementing a RTOSemulation framework on GNU/-Linux”, White Paper, France, April2004Philipper Gerum, “The Xenomai Project-Implementing a RTOSemulation framework on GNU/-Linux”, White Paper, France, April2004Hanssen, F, Jansen, P.G, Scholten, H, and Mullender, S, “RTnet: adistributed real-time protocol for broadcast-capable networks”,Autonomic and Autonomous Systems and International Conferenceon Networking and Services, Joint International Conference, 23-28Oct. 2005 , pp.18J. Kiszka, B.Wagner, Y. Zhang, J.F. Broenink, “RTnet—a flexiblehard real-time networking framework”, in: Proceedings of the 10th166Authorized licensed use limited to: University of North Carolina at Charlotte. Downloaded on January 15, 2010 at 00:31 from IEEE Xplore. Restrictions apply.

IEEE International Conference on Emerging Technologies andFactory Automation, Catania, Italy, 2005.[9] RTnet Home Page [Online], http://www.rtnet.org.[10] R. Felton, K. Blackler, S. Dorling, O. Hemming, “Real-time plasmacontrol at JET using an ATM Network”, in: Proceedings of the 11thIEEE-NPSS Real Time Conference, Santa Fe NM, USA, 1999.167Authorized licensed use limited to: University of North Carolina at Charlotte. Downloaded on January 15, 2010 at 00:31 from IEEE Xplore. Restrictions apply.

This paper describes the implementation of real-time network extension based on embedded Linux. Compared with different solution of achieving real-tine ability on Linux system, Xenomai and Rtnet have been chosen in our system. Finally, the real-time performance test has been

Related Documents:

1.1 Hard Real Time vs. Soft Real Time Hard real time systems and soft real time systems are both used in industry for different tasks [15]. The primary difference between hard real time systems and soft real time systems is that their consequences of missing a deadline dif-fer from each other. For instance, performance (e.g. stability) of a hard real time system such as an avionic control .

Real-Time Analysis 1EF77_3e Rohde & Schwarz Implementation of Real -Time Spectrum Analysis 3 1 Real-Time Analysis 1.1 What “Real-Time” Stands for in R&S Real-Time Analyzers The measurement speed available in today's spectrum analyzers is the result of a long

asics of real-time PCR 1 1.1 Introduction 2 1.2 Overview of real-time PCR 3 1.3 Overview of real-time PCR components 4 1.4 Real-time PCR analysis technology 6 1.5 Real-time PCR fluorescence detection systems 10 1.6 Melting curve analysis 14 1.7 Passive reference dyes 15 1.8 Contamination prevention 16 1.9 Multiplex real-time PCR 16 1.10 Internal controls and reference genes 18

Introduction to Real-Time Systems Real-Time Systems, Lecture 1 Martina Maggio and Karl-Erik Arze n 21 January 2020 Lund University, Department of Automatic Control Content [Real-Time Control System: Chapter 1, 2] 1. Real-Time Systems: De nitions 2. Real-Time Systems: Characteristics 3. Real-Time Systems: Paradigms

network.edgecount Return the Number of Edges in a Network Object network.edgelabel Plots a label corresponding to an edge in a network plot. network.extraction Extraction and Replacement Operators for Network Objects network.indicators Indicator Functions for Network Properties network.initialize Initialize a Network Class Object

Real-Time Analysis 1EF77_0e Rohde & Schwarz Implementation of Real-Time Spectrum Analysis 3 1 Real-Time Analysis 1.1 What Real-Time stands for in the R&S FSVR The measurement speed available in today's spectrum analyzers is the result of a long

Real -time Real -life O riented DSP Lab Modules Abstract: In this p aper , we present a sequence of engaging lab exercises that implement real -time real -life signal/data acquisition, analysis, and processing using MatL ab , LabV iew, and NI myDAQ. Examples of these signals include real -time human voice and music signals.

accounting purposes, and are rarely designed to have a voting equity class possessing the power to direct the activities of the entity, they are generally VIEs. The investments or other interests that will absorb portions of a VIE’s expected losses or receive portions of its expected residual returns are called variable interests. In February 2015, the Financial Accounting Standards Board .