tips:micro kernel是微内核,但是pico kernel翻译成微微内核有点不顺畅,在本文翻译成微内核了。
机翻的,主要是为了自用,翻都翻了所以顺便上传一下。
ThreadX is a high-performance real-time kernel designed specifically for embedded applications. This chapter contains an introduction to the product and a description of its applications and benefits.
ThreadX 是一款专为嵌入式应用设计的高性能实时内核。本章介绍该产品,并阐述其应用和优势。
ThreadX Unique Features ThreadX特性
Unlike other real-time kernels, ThreadX is designed to be versatile—easily scaling among small microcontroller-based applications through those that use powerful CISC, RISC, and DSP processors.
与其他实时内核不同,ThreadX 的设计具有多功能性——可以通过使用强大的 CISC、RISC 和 DSP 处理器的应用程序轻松在基于小型微控制器的应用程序之间扩展。
ThreadX is scalable based on its underlying architecture. Because ThreadX services are implemented as a C library, only those services actually used by the application are brought into the run-time image. Hence, the actual size of ThreadX is completely determined by the application. For most applications, the instruction image of ThreadX ranges between 2 KBytes and 15 KBytes in size.
ThreadX 基于其底层架构具有可扩展性。由于 ThreadX 服务以 C 语言库的形式实现,因此只有应用程序实际使用的服务才会被纳入运行时映像。因此,ThreadX 的实际大小完全由应用程序决定。对于大多数应用程序,ThreadX 的指令映像大小在 2 KB 到 15 KB 之间。
Picokernel Architecture 微内核架构
Instead of layering kernel functions on top of each other like traditional microkernel architectures, ThreadX services plug directly into its core. This results in the fastest possible context switching and service call performance. We call this non-layering design a picokernel architecture.
ThreadX 的服务直接插入其内核,而非像传统微内核架构那样将内核功能层层叠加。这实现了最快的上下文切换和服务调用性能。我们将这种非分层设计称为微内核架构。
ANSI C Source Code ANSI C代码
ThreadX is written primarily in ANSI C. A small amount of assembly language is needed to tailor the kernel to the underlying target processor. This design makes it possible to port ThreadX to a new processor family in a very short time—usually within weeks!
ThreadX 主要用 ANSI C 编写。只需少量汇编语言即可根据底层目标处理器定制内核。这种设计使得 ThreadX 能够在极短的时间内(通常几周内)移植到新的处理器系列!
Advanced Technology 先进技术亮点
The following are highlights of the ThreadX advanced technology.
以下是ThreadX先进技术的亮点。
Simple picokernel architecture 简单的微内核架构
Automatic scaling (small footprint) 自动扩展(占用空间小)
Deterministic processing 确定性处理
Fast real-time performance 快速实时性能
Preemptive and cooperative scheduling 抢占式和协作式调度
Flexible thread priority support 灵活的线程优先级支持
Dynamic system object creation 动态系统对象创建
Unlimited number of system objects 无限数量的系统对象
Optimized interrupt handling 优化的中断处理
Preemption-threshold 抢占阈值
Priority inheritance 优先级继承
Event-chaining 事件链
Fast software timers 快速软件定时器
Run-time memory management 运行时内存管理
Run-time performance monitoring 运行时性能监控
Run-time stack analysis 运行时堆栈分析
Built-in system trace 内置系统跟踪
Vast processor support 支持多种处理器
Vast development tool support 支持多种开发工具
Completely endian neutral 完全字节序中立
Not A Black Box 并非黑盒
Most distributions of ThreadX include the complete C source code as well as the processor-specific assembly language. This eliminates the "black-box" problems that occur with many commercial kernels. With ThreadX, application developers can see exactly what the kernel is doing—there are no mysteries!
ThreadX 的大多数发行版都包含完整的 C 源代码以及特定于处理器的汇编语言。这消除了许多商业内核中存在的“黑盒”问题。使用 ThreadX,应用程序开发者可以清晰地看到内核的运行情况——没有任何神秘之处!
The source code also allows for application specific modifications. Although not recommended, it is certainly beneficial to have the ability to modify the kernel if it is absolutely required.
源代码还允许针对特定应用程序进行修改。虽然不建议这样做,但如果确实需要修改内核,那么拥有修改内核的能力无疑是有益的。
These features are especially comforting to developers accustomed to working with their own in-house kernels. They expect to have source code and the ability to modify the kernel. ThreadX is the ultimate kernel for such developers.
这些功能对于习惯使用自主研发内核的开发者来说尤其令人欣慰。他们希望拥有源代码并能够修改内核。ThreadX 正是这类开发者的理想之选。
The RTOS Standard RTOS 标准
Because of its versatility, high-performance picokernel architecture, advanced technology, and demonstrated portability, ThreadX is deployed in more than two-billion devices today. This effectively makes ThreadX the RTOS standard for deeply embedded applications.ThreadX
凭借其多功能性、高性能 picokernel 架构、先进技术以及卓越的可移植性,目前已部署在超过 20 亿台设备中。这使得 ThreadX 成为深度嵌入式应用的 RTOS 标准。
Safety Certifications 安全认证
TÜV Certification TÜV 认证
ThreadX has been certified by SGS-TÜV Saar for use in safety-critical systems, according to IEC-61508 SIL 4. The certification confirms that ThreadX can be used in the development of safety-related software for the highest safety integrity levels of IEC-61508 for the "Functional Safety of electrical, electronic, and programmable electronic safety-related systems." SGS-TUV Saar, formed through a joint venture of Germany's SGS-Group and TUV Saarland, has become the leading accredited, independent company for testing, auditing, verifying, and certifying embedded software for safety-related systems worldwide.
ThreadX 已获得 SGS-TUV Saar 认证,符合 IEC-61508 SIL 4 标准,可用于安全关键型系统。该认证确认 ThreadX 可用于开发符合 IEC-61508“电气、电子和可编程电子安全相关系统的功能安全”最高安全完整性等级的安全相关软件。SGS-TUV Saar 由德国 SGS 集团和 TUV Saarland 合资成立,已成为全球领先的独立认证公司,为安全相关系统的嵌入式软件提供测试、审核、验证和认证服务。
IEC 61508 up to SIL 4
MISRA C Compliant 符合 MISRA C 标准
MISRA C is a set of programming guidelines for critical systems using the C programming language. The original MISRA C guidelines were primarily targeted toward automotive applications; however, MISRA C is now widely recognized as being applicable to any safety critical application. ThreadX is compliant with all "required" and "mandatory" rules of MISRA-C:2004 and MISRA C:2012. ThreadX is also compliant with all but three "advisory" rules. Refer to the ThreadX_MISRA_Compliance.pdf. document for more details.
MISRA C 是一套针对使用 C 编程语言的关键系统编程指南。最初的 MISRA C 指南主要针对汽车应用;然而,MISRA C 现已被广泛认可为适用于任何安全关键应用。ThreadX 符合 MISRA-C:2004 和 MISRA C:2012 的所有“必需”和“强制”规则。ThreadX 还符合除三条“建议”规则之外的所有规则。更多详情,请参阅 ThreadX_MISRA_Compliance.pdf 文档。
UL Certification UL认证
ThreadX has been certified by UL for compliance with UL 60730-1 Annex H, CSA E60730-1 Annex H, IEC 60730-1 Annex H, UL 60335-1 Annex R, IEC 60335-1 Annex R, and UL 1998 safety standards for software in programmable components. Along with IEC/UL 60730-1, which has requirements for "Controls Using Software" in its Annex H, the IEC 60335-1 standard describes the requirements for "Programmable Electronic Circuits" in its Annex R. IEC 60730 Annex H and IEC 60335-1 Annex R address the safety of MCU hardware and software used in appliances such as washing machines, dishwashers, dryers, refrigerators, freezers, and ovens.
ThreadX 已通过 UL 认证,符合 UL 60730-1 附录 H、CSA E60730-1 附录 H、IEC 60730-1 附录 H、UL 60335-1 附录 R、IEC 60335-1 附录 R 以及 UL 1998 可编程组件软件安全标准。除了 IEC/UL 60730-1 在其附录 H 中规定了“使用软件进行控制”的要求外,IEC 60335-1 标准在其附录 R 中也规定了“可编程电子电路”的要求。IEC 60730 附录 H 和 IEC 60335-1 附录 R 规定了洗衣机、洗碗机、烘干机、冰箱、冰柜和烤箱等家用电器中使用的 MCU 硬件和软件的安全要求。
UL/IEC 60730, UL/IEC 60335, UL 1998 Embedded Applications
Embedded applications execute on microprocessors buried within products such as wireless communication devices, automobile engines, laser printers, medical devices, etc. Another distinction of embedded applications is that their software and hardware have a dedicated purpose.
嵌入式应用程序在嵌入在无线通信设备、汽车发动机、激光打印机、医疗设备等产品中的微处理器上运行。嵌入式应用程序的另一个特点是其软件和硬件都有其特定的用途。
Real-time Software 实时软件
When time constraints are imposed on the application software, it is called the real-time software. Embedded applications are almost always real-time because of their inherent interaction with external events.
当应用软件受到时间限制时,它被称为“实时”软件。由于嵌入式应用程序与外部事件的固有交互,它们几乎总是实时的。
Multitasking 多任务处理
As mentioned, embedded applications have a dedicated purpose. To fulfill this purpose, the software must perform a variety of tasks. A task is a semi-independent portion of the application that carries out a specific duty. It is also the case that some tasks are more important than others. One of the major difficulties in an embedded application is the allocation of the processor between the various application tasks. This allocation of processing between competing tasks is the primary purpose of ThreadX.
如上所述,嵌入式应用程序有其特定的用途。为了实现此目的,软件必须执行各种“任务”。任务是应用程序中执行特定任务的半独立部分。有时,某些任务比其他任务更重要。嵌入式应用程序的主要难点之一是如何在各个应用任务之间分配处理器。ThreadX 的主要目的就是在相互竞争的任务之间分配处理能力。
Tasks vs. Threads 任务 vs 线程
Another distinction about tasks is that the term task is used in a variety of ways. It sometimes means a separately loadable program. In other instances, it may refer to an internal program segment. Therefore, in contemporary operating systems, there are two terms that more or less replace the use of task: process and thread. A process is a completely independent program that has its own address space, while a thread is a semi-independent program segment that executes within a process. Threads share the same process address space. The overhead associated with thread management is minimal.
任务的另一个区别在于,“任务”一词的使用方式多种多样。它有时指可单独加载的程序,有时指内部程序段。因此,在当代操作系统中,有两个术语或多或少地取代了“任务”一词:进程和线程。进程是完全独立的程序,拥有自己的地址空间;而线程是在进程内执行的半独立程序段。线程共享相同的进程地址空间。线程管理的开销极小。
Most embedded applications cannot afford the overhead (both memory and performance) associated with a full-blown process-oriented operating system. In addition, smaller microprocessors don't have the hardware architecture to support a true process-oriented operating system. For these reasons, ThreadX implements a thread model, which is both extremely efficient and practical for most real-time embedded applications.
大多数嵌入式应用程序无法承受成熟的面向过程操作系统所带来的开销(包括内存和性能)。此外,小型微处理器的硬件架构也无法支持真正的面向过程的操作系统。因此,ThreadX 实现了一种线程模型,这对于大多数实时嵌入式应用程序来说既高效又实用。
To avoid confusion, ThreadX does not use the term task. Instead, the more descriptive and contemporary name thread is used. 为避免混淆,ThreadX 不使用“任务”一词。取而代之的是更具描述性和现代感的名称 thread。
ThreadX Benefits ThreadX 的优势
Using ThreadX provides many benefits to embedded applications. Of course, the primary benefit rests in how embedded application threads are allocated processing time.
使用 ThreadX 为嵌入式应用程序带来诸多益处。当然,主要益处在于嵌入式应用程序线程的分配处理时间的方式。
Improved Responsiveness 提升响应速度
Prior to real-time kernels like ThreadX, most embedded applications allocated processing time with a simple control loop, usually from within the C main function. This approach is still used in very small or simple applications. However, in large or complex applications, it is not practical because the response time to any event is a function of the worst case processing time of one pass through the control loop.
在 ThreadX 等实时内核出现之前,大多数嵌入式应用程序使用简单的控制循环(通常在 C 语言的 main 函数中)分配处理时间。这种方法至今仍用于非常小型或简单的应用程序。然而,在大型或复杂的应用程序中,这种方法并不实用,因为任何事件的响应时间都取决于控制循环一次执行的最坏情况处理时间。
Making matters worse, the timing characteristics of the application change whenever modifications are made to the control loop. This makes the application inherently unstable and difficult to maintain and improve on.
更糟糕的是,每当对控制循环进行修改时,应用程序的时序特性都会发生变化。这使得应用程序本质上不稳定,难以维护和改进。
ThreadX provides fast and deterministic response times to important external events. ThreadX accomplishes this through its preemptive, priority based scheduling algorithm, which allows a higher priority thread to preempt an executing lower-priority thread. As a result, the worst-case response time approaches the time required to perform a context switch. This is not only deterministic, but it is also extremely fast.
ThreadX 为重要的外部事件提供快速且确定的响应时间。ThreadX 通过其基于优先级的抢占式调度算法来实现这一点,该算法允许高优先级线程抢占正在执行的低优先级线程。因此,最坏情况下的响应时间接近执行上下文切换所需的时间。这不仅具有确定性,而且速度极快。
Software Maintenance 软件维护
The ThreadX kernel enables application developers to concentrate on specific requirements of their application threads without having to worry about changing the timing of other areas of the application. This feature also makes it much easier to repair or enhance an application that utilizes ThreadX.
ThreadX 内核使应用程序开发人员能够专注于其应用程序线程的特定需求,而无需担心更改应用程序其他部分的时序。此功能还使修复或增强使用 ThreadX 的应用程序变得更加容易。
Increased Throughput 提高吞吐量
A possible work-around to the control loop response time problem is to add more polling. This improves the responsiveness, but it still doesn't guarantee a constant worst-case response time and does nothing to enhance future modification of the application. Also, the processor is now performing even more unnecessary processing because of the extra polling. All of this unnecessary processing reduces the overall throughput of the system.
解决控制环路响应时间问题的一种可能方法是增加轮询。这可以提高响应速度,但仍然不能保证最坏情况下的响应时间恒定,并且无助于增强应用程序的未来修改。此外,由于额外的轮询,处理器现在正在执行更多不必要的处理。所有这些不必要的处理都会降低系统的整体吞吐量。
An interesting point regarding overhead is that many developers assume that multithreaded environments like ThreadX increase overhead and have a negative impact on total system throughput. But in some cases, multithreading actually reduces overhead by eliminating all of the redundant polling that occurs in control loop environments. The overhead associated with multithreaded kernels is typically a function of the time required for context switching. If the context switch time is less than the polling process, ThreadX provides a solution with the potential of less overhead and more throughput. This makes ThreadX an obvious choice for applications that have any degree of complexity or size.
关于开销,一个有趣的观点是,许多开发人员认为像 ThreadX 这样的多线程环境会增加开销,并对系统总吞吐量产生负面影响。但在某些情况下,多线程实际上通过消除控制环路环境中发生的所有冗余轮询来降低开销。多线程内核的开销通常取决于上下文切换所需的时间。如果上下文切换时间小于轮询过程,ThreadX 可以提供更低开销、更高吞吐量的解决方案。这使得 ThreadX 成为各种复杂程度或规模应用程序的不二之选。
Processor Isolation 处理器隔离
ThreadX provides a robust processor-independent interface between the application and the underlying processor. This allows developers to concentrate on the application rather than spending a significant amount of time learning hardware details.
ThreadX 在应用程序和底层处理器之间提供了一个强大的、独立于处理器的接口。这使得开发人员可以专注于应用程序本身,而无需花费大量时间学习硬件细节。
Dividing the Application 划分应用程序
In control loop-based applications, each developer must have an intimate knowledge of the entire application's run-time behavior and requirements. This is because the processor allocation logic is dispersed throughout the entire application. As an application increases in size or complexity, it becomes impossible for all developers to remember the precise processing requirements of the entire application.
在基于控制环的应用程序中,每个开发人员都必须深入了解整个应用程序的运行时行为和需求。这是因为处理器分配逻辑分散在整个应用程序中。随着应用程序规模或复杂程度的增加,所有开发人员都不可能记住整个应用程序的精确处理需求。
ThreadX frees each developer from the worries associated with processor allocation and allows them to concentrate on their specific piece of the embedded application. In addition, ThreadX forces the application to be divided into clearly defined threads. By itself, this division of the application into threads makes development much simpler.
ThreadX 让每个开发人员摆脱与处理器分配相关的担忧,让他们能够专注于嵌入式应用程序中的特定部分。此外,ThreadX 强制将应用程序划分为明确定义的线程。这种将应用程序划分为线程的方式本身就大大简化了开发过程。
Ease of Use 易于使用
ThreadX is designed with the application developer in mind. The ThreadX architecture and service call interface are designed to be easily understood. As a result, ThreadX developers can quickly use its advanced features.
ThreadX 的设计充分考虑了应用程序开发人员的需求。ThreadX 的架构和服务调用接口设计得易于理解。因此,ThreadX 开发人员可以快速使用其高级功能。
Improve Time-to-market 缩短产品上市时间
All of the benefits of ThreadX accelerate the software development process. ThreadX takes care of most processor issues and the most common safety certifications, thereby removing this effort from the development schedule. All of this results in a faster time to market!
ThreadX 的所有优势都加速了软件开发流程。ThreadX 负责处理大多数处理器问题和最常见的安全认证,从而将这方面的工作从开发计划中移除。所有这些都将缩短产品上市时间!
Protecting the Software Investment 保护软件投资
Because of its architecture, ThreadX is easily ported to new processor and/or development tool environments. This, coupled with the fact that ThreadX insulates applications from details of the underlying processors, makes ThreadX applications highly portable. As a result, the application's migration path is guaranteed, and the original development investment is protected.
由于其独特的架构,ThreadX 可以轻松移植到新的处理器和/或开发工具环境中。再加上 ThreadX 将应用程序与底层处理器的细节隔离开来,使得 ThreadX 应用程序具有高度的可移植性。因此,应用程序的迁移路径得到了保证,并且原始开发投资也得到了保护。