1 / 56

Open Resources of RTOS for Embedded Systems Beibei Shao Tsinghua University Conference on Nuclear Electronics &

Open Resources of RTOS for Embedded Systems Beibei Shao Tsinghua University Conference on Nuclear Electronics & Detection Dec. 2/4, 2002 in XiaMen. Why RTOS?. Learn RTOS: Fill the gap between Computer Science Experts and Application Engineers

milek
Télécharger la présentation

Open Resources of RTOS for Embedded Systems Beibei Shao Tsinghua University Conference on Nuclear Electronics &

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Open Resources of RTOS for Embedded SystemsBeibei Shao Tsinghua UniversityConference on Nuclear Electronics & Detection Dec. 2/4, 2002 in XiaMen

  2. Why RTOS? • Learn RTOS: • Fill thegap between Computer Science Experts and Application Engineers • Understanding Computer more theoretically • Using RTOS: • Simplify the Application Programming • Higher the Real TimePerformance and Reliability

  3. RTOS Kernel Real Time Kernel Dormant Waiting Running Pending ISR

  4. VxWorks Wind RiverSystem $40k/s & royalty wrs.com pSOS Wind RiverSystem wrs.com VRTX Microtec $20K/seat LynxOS $10K/s, Bulue Cat Linux$2.5k/seatlynuxworks.com QNX QNX qnx.com OS-9 Microware Microware.com Nucleus Accelerated Tech. $20K/s with source code CMX 8051Tools Tasking$1.29k Tasking.com RT/Studio IDE Precise $30K psti.com Embedded LinuxGreen Hill$7.9KRoyalty free ghs.com Embedex LinuxLineo $5k/seat lineo.com Redice Linux Redsonic redsonic.com Yellow Dog linux, Hard Hat Linux, Turb LinuxMontavista.com Other: Linuxnews.com LinuxDevices.com Embed.com Commercial RTOS Products

  5. Goodfor Learning and training Easy to Get Support from Web Easy Common Language & Standard Good Performances and reliabilities Lowerthe System Cost Why Open Source?

  6. Free RTOS Kernel Source Code • “µC/OS The Real Time Kernel”(1992) • “MicroC/OS-II The Real-time Kernel”(1998) • “MicroC/OS-II The Real-time Kernel”2nd Edit (2002) • Jean J.Labrosse • R & D Publications, Inc www.cmpbooks.com • Priority based preemptive kernel (looking up table algorithm) • Up to 60 tasks • Above 90% is written in C easy for porting • Scalable and ROM able • Source code for PC environment attached with a floppy or CD • Very detail explanation in excellent programming style

  7. The μC/OS Book1992 Licensing: You do not need a license to use this code in your application, if your application is distributed in object format.You should however, indicate in your product literature that you are using μC/OS, the Real Time Kernel.If you distribute μC/OS in source code, you must obtain a license. 

  8. The µC/OS-II Book1998 Licensing No licensing is required if µC/OS-II is used for education You must obtain an Object Code Distribution License to embedded µC/OS-II in commercial product hat is sold with the intent to make profit

  9. TheµC/OS-IIBook in Chinese2001.7.

  10. The 2nd edit of µC/OS-II From 498 pages to 606 pages Delete 150 pages source code list 250 new pages more From 12 Chapters to 18 Chapters Meet Requirement for Safety-Critical System

  11. µC/OS (V1.08) vs. µC/OS-II(V2.00)266 page to 498 pages • Add more important functions: • Memory manager • stack usage check • CPU load check

  12. “MicroC/OS-II The Real-time Kernel” µC/OS-II (V2.00 1998)vs. µC/OS-II(V2.52 2002) The Second Edit (2002) Add 250 pages more • Meet Requirement for Safety-Critical System Certified by FAA • Add more important functions: • Mutax Semaphore, Event Flag …… • Add more explanations • Add price from $69.95 to $74.95 ,

  13. Embedded Real Time System Concept • Foreground/background system (super loop+events) • Non-preemptive kernel (Multi Tasks latency=longest ) • Preemptive Kernel • Races in tasks • Died lock, priority inversion • Reentrancy • Task scheduling algorithm • Task priority based • Round robin scheduling • Inter tasks communication, synchronization • Semaphore • Mail box • message queue • ……

  14. Real Time System ConceptTask Scheduling Algorithm • Priority based (Real Time scheduling) • Priority schedulinglike µC/OS-II and most commercial RTOS • Time slot based (Unix, Linux…..) • Round robin scheduling • Guaranteed Scheduling • Shortest job first • Lottery Scheduling • Multiple queues • Two levels scheduling • Scheduling mechanism and Scheduling policy • Refer to Minix, Linux

  15. RTOS Kernel Source Code µC/OS-II Service RTOS Kernel Enter_Critical() Exit_Critical() Schedule_lock() ScheduleUnlock() TaskChangePrio() …... OSSemPost() OSMBoxPost() OSQpost() OSTimetick() OSTaskCreat() OSTaskDell() Dormant Waiting OS_Task_SW() OSInit() OSStart() Running Pending ISR OSSemPend() OSMBoxPend() OSQPend() OSTimeDly() IntEnter() IntExit()

  16. Advantage/Disadvantage of Using RTOS • Advantage • Split application to multi tasks, simplify the design, easy to be understand, expend and maintenance • Time latency is guaranteed • Higher system reliability • Disadvantage • More RAM/ROM usage • 2~5% CPU overhead • Adding additional cost, if commercial TROS is used • About 80 RTOS vendors, cost from $70 to $30,000 some are royalty free, some need $5 to $250 /MCU, MCU dependent

  17. µC/OS Already Widely Used in Many Fields • Already used in the field since 1992 such as: • cameras • medical instruments • musical instruments • engine control • Since 1995, our lab. ported it to MC68HC11, M68000, CPU32,M.core,HC08 and used it in several projects: • Digital Data Log in National Synchrotron Radiation Lab. • WorldFip and radiation tolerance test DAQ system at CERN • Beam Lose Monitoring System • ATP System for Beijing light Railroad • MCU based TCP/IP stack • network adapter • highway telephone call box • ATM machine • industrial robots……

  18. Free RTOS Kernel Source Code Ported Examples down load able from web Manufacture MCU AMD 80x86 Analog Device SHARC (AD21065L) ARM ARM7 Atmel AVR, AT103 Fujitsu SPARC Hitachi 64180, H8-300H H8S,SH2,SH3 Infineon Tri.Core, 80C166/167 Intel Strong ARM110, 80C251,XC52,80x86 ,196K Motorola M68HC08, M68HC11, M68HC12, M68HC16 M68000, CPU32, DSP568xx Cold.Fire, M.Core, PowerPC 8xx,MPC555 Philips XA ST 80C166/167 TI TMS320-C40, TMS320-C6201 Automation V8 Zilog Z-80, Z-180 http://WWW.uCOS-II.com/

  19. Read the book and the µC/OS-II source code Understanding RTOS concepts Compiler the µC/OS-II with examples and run on a PC Add some codes to the examples Porting the µC/OS-II to a MCU, which you are familiar with Write the CPU.c and the CPU.a files Do a project with a MCU board Learn how to divide an application to several tasks Communication and synchronization within tasks Learn RTOS with µC/OS-II

  20. Porting Most problems in porting are related to cross C compiler tools Most MCU dependent Cross C are commercial Please use GNU gcc in Free SoftwareLinux Using How to develop applications program based on µC/OS-II? Porting & Using µC/OS-II

  21. GNU gcc Tools Cross C Compiler for: M68K, CPU32, Coldfire, PowerPC,68HC11/12 SPARC,PA-RISC,VAX,AMD29K,ARM,Thumb, MN10xxx, M32, SR6000,MIPS, RT, i386, Inter960, TMS32, DEC alpha, V850, NS32K Cross assembler : AS Disassemble: Objump Liker: Ld C support lib: Libc & Libm Gcc Debug options You know GCC , You will get also Embedded ucLinux GNU gcc in Linux

  22. Take off the Memory Management Good for the non-mmu CPU in Embedded Free OS for Embedded Many application program in Linux available Not a Real Time OSDownload RTLinux3.1 from:www.rtlinux.org Much smaller than Linux, sometimes still too large for Embedded system typical RAM usage ~512K Down load from: www.uclinux.org uCLinux in Linux

  23. RTEMS (Real-Time Executive for Missile Systems)POSIX API standard based Real-Time Executive for Multiprocessor Systems (C Version) Real-Time Executive for Military Systems(ada Version) See:www.oarcorp.com/TREMS/ (On-Line Applications Research Corporation ) Free RTOS: RTEMS

  24. Hardware platform design and test Buildup free software base developing environment GNU gcc Porting an RTOS Find out free resources Protocols form the www.rfc-editor.org Source code from books and www Develop your own application How to Develop an Application Program Base on a RTOS? TCP/IP Developing Examples

  25. Open Resources Example TCP/IP Lean: Web Servers for Embedded Systems is a hands-on guide to TCP/IP networking that includes source code to a simple TCP/IP stack for use in embedded applications.

  26. 68HC08GP32 Based Lean Server

  27. 8bits MCU 512bytes RAM 32K Fash Run µC/OS-II for learning Ethernet interface: RTL8019 Total code for TCP/IP is around 7K 68HC08GP32 Based Lean Server

  28. 68F375

  29. MC 68332

  30. MC68332 CPU32

  31. 32 bits MCU ColdFire 5307: 68K in RISK , non MMU for Embedded 90MHz 75MIPs Interface with: Ethernet RTL8019 2M Flash, 16M SDRAM Developed with GNU gcc in Linux Boot uClinux or µC/OS-II from Flash to RAM TCP/IP stack available ColdFire Platform for RTOS Learning

  32. Embedded Control Systems Project for Ph.D. Student

  33. 实时操作系统VxWorks VxWorks操作系统是美国WindRiver公司于1983年设计开发的一种嵌入式实时操作系统(RTOS),是Tornado 嵌入式开发环境的关键组成部分。良好的持续发展能力、高性能的内核以及友好的用户开发环境,在嵌入式实时操作系统领域逐渐占据一席之地。首先,它十分灵活,具有多达1800个功能强大的应用程序接口(API);其次,它适用方面广,可以适用于从最简单到最复杂的产品设计;再次,它可靠性高,可以用于从防抱死刹车系统到星际探索的关键任务;最后,适用性强,可以用于所有的流行的CPU平台。 Vxworks是一个高性能的,支持广泛的网络通信协议的, 并可根据用户需求进行组合的实时操作系统, 它的开放式结构和对工业标准的支持使开发者只需要做最少的工作即可设计有效的符合用户要求的实时操作系统.

  34. 实时操作系统VxWorks BSP & Black Box • Provides VxWorks with primary interface to hardware environment. • BSP Responsibilities: • Hardware initialization on power-up. • Support for VxWorks access to hardware drivers. • Integration of hardware-dependent and hardware-independent software in VxWorks.

  35. 实时操作系统 Nucleus Nucleus是美国著名厂商ATI公司的RTOS产品。它提供实时内核(Nucleus PLUS),网络模块(Nucleus NET、Nucleus EPILOGUE和Nucleus POSE),开发工具模块(NucleusMNT/UDB/EDE/DLL)以及Web(Nucleus Java/webserve)产品等。Nucleus最大的特点是全部提供源代码,免去用户购买License和付Royalties。用户只需通过DLL动态连接库便可进行任务级调试,无需编写BSP。 ★提供源代码 NUCLEUS+提供注释严格的C源级代码给每一个用户。这样,用户能够深入地了解底层内核的运作方式,并可根据自己的特殊要求删减或改动系统软件,这对软件的规范化管理及系统软件的测试都有极大的帮助。另外,由于提供了RTOS的源级代码,用户不但可以进行RTOS 的学习和研究,而且产品在量产时也不必支付License,可以省去大量的费用。 ★ 易学易用 NUCLEUS+能够结合Paradigm,SDS以及ATI自己的多任务调试器组成功能强大的集成开发环境,配合相应的编译器和动态联结库以及各类底层驱动软件,用户可以轻松地进行RTOS的开发和调试。另外,由于这些集成开发环境 ( IDE ) 为所有的开发工程师所熟悉,因而,容易学习和使用。 ★功能模块丰富

  36. 3种嵌入式操作系统比较 操作系统购买价格 ★VxWorks: 价格40万元人民币以上 ★Nucleus: 价格15万元人民币以上 ★Linux & RTEMS: 免费

  37. 3种嵌入式操作系统比较 操作系统学习周期 ★VxWorks: 一个人约4个月时间 ★Nucleus: 一个人约1个月时间 ★Linux or RTEMS: 一个人约2个月时间

  38. 3种嵌入式操作系统比较 操作系统可靠性稳定性 ★VxWorks: 好 ★Nucleus: 较好,有bug,特别在图形包,和网络包. ★Linux & RTEMS: 较好,在高性能系统中仍需改进

  39. 3种嵌入式操作系统比较 操作系统版权费用 ★VxWorks: 每生产一件产品需交纳一份版权费 ★Nucleus: 免费 ★Linux & RTEMS: 免费

  40. 3种嵌入式操作系统比较 操作系统技术支持 ★VxWorks: 较好,由开发商独家提供有限的技术支持 ★Nucleus: 较好,由开发商独家提供有限的技术支持 ★Linux & RTEMS: 好,全世界的自由软件开发者提供支持

  41. 3种嵌入式操作系统比较 操作系统网络特性 ★VxWorks: 另加费用购买 ★Nucleus: 另加费用购买 ★Linux & RTEMS: 免费

  42. 3种嵌入式操作系统比较 操作系统软件移植 ★VxWorks: 较难,是封闭系统 ★Nucleus: 容易,代码开放 ★Linux & RTEMS: 较易,有许多应用软件支持

More Related