RTOS和嵌入式Linux之间有什么区别? [英] What is the difference between RTOS and Embedded Linux?

查看:5369
本文介绍了RTOS和嵌入式Linux之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RTOS和嵌入式Linux用于嵌入式系统编程。嵌入式Linux本身是一个RTOS?任何人都可以列出比较或差异?

解决方案

Linux是一个通用操作系统(GPOS);其对嵌入式系统的应用通常由设备支持,文件系统,网络连接和UI支持的可用性驱动。所有这些都可以在实时操作系统中使用,但常常支持较少的支持或额外的成本或集成工作。



许多RTOS并不是完整的操作系统, Linux是由静态链接库构成的,它只提供任务调度,IPC,同步定时和中断服务,而且仅仅是调度内核。这样的库与您的应用程序代码相关联,以生成一个可直接引导(或通过引导程序)引导的单个可执行文件。大多数RTOS不直接支持从文件系统动态地加载和卸载代码,就像使用Linux一样 - 启动时运行,并运行直到掉电。



批判性Linux不是实时的。 RTOS提供调度保证,以确保确定性行为和及时的响应事件和中断。在大多数情况下,这是通过基于优先级的优先级调度算法,其中准备运行的最高优先级任务总是运行 - 立即预先排除任何较低优先级的任务,而不需要特定的产量或放弃CPU,或完成一个时间-slice。



Linux有一些调度选项,包括一个实时调度程序,但这是最好的软实时 - 一个我不喜欢的一个术语它是不明确的,基本上意味着实时,大部分时间,但有时不是。如果您的应用程序不需要实时即可实现,但实时Linux的典型延迟将在几十或几百微秒的数量级,而典型的RTOS实时内核可以从延迟时间零到几微秒。嵌入式Linux的另一个问题是,它需要大量的CPU资源,也许> 200MIPS,32位处理器,理想情况下是使用MMU,4Mb ROM和16MB RAM启动(可能需要几秒钟)。另一方面,RTOS可以以毫秒为单位,以小于10Kb的速度运行,在8位的微控制器上。这可能会对体积生产的系统成本产生重大影响,尽管表面上是免费的。



有更大的RTOS产品展示GPOS的一些功能,如动态加载,文件系统,网络,GUI(例如,在QNX中),许多RTOS提供了一个POSIX API(通常是其原生的实时API二次),例如VxWorks和QNX,以便为Linux和Unix可以比较容易地移植。这些更大更全面的RTOS产品保持可扩展性,因此不包括不需要的功能。相比之下,Linux的扩展性有限。


RTOS and Embedded Linux are used for embedded systems programming. Is Embedded Linux itself an RTOS ? Can anyone list the comparison or difference please?

解决方案

Linux is a general-purpose OS (GPOS); its application to embedded systems is usually motivated by the availability of device support, file-systems, network connectivity, and UI support. All these things can be available in an RTOS, but often with less broad support, or at additional cost or integration effort.

Many RTOS are not full OS in the sense that Linux is, in that they comprise of a static link library providing only task scheduling, IPC, synchronisation timing and interrupt services and little more - essentially the scheduling kernel only. Such a library is linked with your application code to produce a single executable that your system boots directly (or via a bootloader). Most RTOS do not directly support the loading and unloading of code dynamically from a file system as you would with Linux - it is all there at start-up and runs until power down.

Critically Linux is not real-time capable. An RTOS provides scheduling guarantees to ensure deterministic behaviour and timely response events and interrupts. In most cases this is through a priority based pre-emptive scheduling algorithm, where the highest priority task ready to run always runs - immediately - pre-empting any lower priority task without a specific yield or relinquishing of the CPU, or completion of a time-slice.

Linux has a number of scheduling options, including a real-time scheduler, but this is at best "soft" real-time - a term I dislike since it is ill-defined, and essentially means real-time, most of the time, but sometimes not. If your application has no need of "hard" real-time, that's fine, but typical latencies in real-time Linux will be in the order of tens or hundreds of microseconds, whereas a typical RTOS real-time kernel can achieve from latencies from zero to a few microseconds.

Another issue with embedded Linux is that it needs significant CPU resources, perhaps >200MIPS, 32bit processor, ideally with an MMU, 4Mb of ROM and 16MB of RAM to just about boot (which may take several seconds). An RTOS on the other hand can be up in milliseconds, run in less than 10Kb, on microcontrollers from 8-bit up. This can have a significant impact on system cost for volume production despite being ostensibly "free".

There are larger RTOS products that exhibit some of the features of a GPOS such as dynamic loading, filesystems, networking, GUI (for example, in QNX), and many RTOS provide a POSIX API (usually secondary to their native real-time API) for example VxWorks and again QNX, so that a great deal of code developed for Linux and Unix can be ported relatively easily. These larger more comprehensive RTOS products remain scalable, so that functionality not required is not included. Linux in comparison has far more limited scalability.

这篇关于RTOS和嵌入式Linux之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆