本文介绍了Ada实时需要底层操作系统吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据阅读文档了解,Ada实时模块的工作与操作系统完全隔离。无需底层操作系统和资源管理器即可实现并发。 Ada处理任务调度,时间管理,任务状态转换,列表管理,任务优先级,锁定策略,调度策略,ISR,任务间通信等。

From what I have understood by reading the documentation, the Ada real-time module works completely isolated from the OS. It's possible to have concurrency without having an underlying OS and a resource manager. Ada handles task dispatching, time management, task state transition, list managements, task priority, locking policies, scheduling policies, ISR, inter task communication, etc.

Ada实时模块是一种实时操作系统?

If so then Ada real-time module is kind of a real-time operating system?

推荐答案

是和否。

Ada程序需要什么是它自己的RTS(运行时系统)-相当大的代码块(在另一个最近的问题中)使 Hello World膨胀到几百千字节。这一点根本没有体现Ada的效率,而与计划的规模无关,对于任何重要的计划(例如,涉及并发性-它与您必须为其他解决方案添加的库相比具有竞争优势。

What an Ada program needs is its own RTS (Runtime System) - the fairly large chunk of code that (in another recent question) inflates "Hello World" to several hundred kilobytes. This doesn't reflect at all on the "efficiency" or otherwise of Ada, it's a onetime cost regardless of the size of the program, and for any significant program - e.g. involving concurrency - it's competitive with the libraries you'd have to add for other solutions.

问题是-运行系统如何实现?如果在标准模式下使用标准的现成Ada编译器(Gnat),则会获得一个RTS,该RTS将Ada并发功能放在 pthreads(Posix线程)包的顶部,以处理底层细节。这显然是在操作系统之上。

The question is - how is that runtime system implemented? If you use the standard off-the-shelf Ada compiler (Gnat) in its standard mode, you get a RTS that layers the Ada concurrency facilities on top of the "pthreads" (Posix threads) package to handle the low level details. And that is obviously layered on top of the OS. Here's a detailed description.

但是还有其他解决方案,可以使用RTOS或通过裸机CPU上的Ada RTS本身甚至根本不提供任何相同的设施(以没有并发为代价) ),如果您的目标是具有1K内存的嵌入式微控制器。

But there are other solutions, where the same facilities can be provided, either using an RTOS, or by the Ada RTS itself on a bare metal CPU, or even not at all (at the expense of no concurrency) if you're targeting an embedded microcontroller with 1K memory.

您可以通过添加-RTS =为另一个RTS构建任何Ada程序。构建命令的path / to / my / rts 选项(gnatmake或其他)。

You can build any Ada program for another RTS by adding the --RTS=path/to/my/rts option to the build command (gnatmake or whatever).

对于工业用途,Adacore自己提供。

For industrial use, Adacore themselves offer commercial support for VXWorks.

有,位于FreeRTOS或其他RT OS之上。 (此处出色的)。它们可能无法提供完整的Ada任务处理功能,但是可以提供选定的子集(例如RAVENSCAR配置文件),它适合小型系统实现(例如12K左右的ARM Thumb代码)和(RAVENSPARK)。

There are examples of RTS for embedded ARM CPUs, layered over FreeRTOS or other RT OSes. (Excellent supporting blog here). These may not provide the full Ada tasking facilities, but a selected subset such as the RAVENSCAR profile, which is amenable to small system implementation (such as 12K or so of ARM Thumb code), and formal proof of correctness (RAVENSPARK).

这些部分是。 还提供了。

Some protocols are available, but with the rarity of people singing Ada's praises, they aren't widely advertised and may take some digging to find. For example, here's a library that interfaces to the MBUS protocol used by some industrial tools. The same author also offers a preliminary version of a libusb binding.

如果您对运行具有最小RTS和在下面没有操作系统的情况下,OSDev Wiki上的页可能很有趣。这适用于i386,但对于和微控制器。

If you're interested in the mechanism of running Ada with a minimal RTS and no OS underneath, the "Ada Bare Bones" page on the OSDev Wiki may be interesting. This is for i386 but similar "bare bones" RTS exist for AVR and MSP430 microcontrollers.

看起来像是另一本有用的资源,并在。

This book looks like another useful resource, with accompanying tutorial material on its own website.

要从理论上讲,请非常有价值。

For a more theoretical treatment, John McCormick's book "Building parallel, real time and embedded applications in Ada" is valuable.

还有一个链接:正如您提到的GUI,我建议您看一下用Ada编写的,您的应用程序可在任何浏览器上浏览网页。

And one more link : as you mention GUI, I'd suggest looking at the Gnoga framework, written in Ada, where your application serves web pages viewable on any browser.

这篇关于Ada实时需要底层操作系统吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 06:00