在嵌入式linux中使用mono作为硬件
我正在一家公司实习做研究。我在使用 Mono(.Net 平台的跨平台实现)时遇到一些问题。我的公司设计硬件和软件。
我对使用嵌入式linux的了解非常有限。我实习的公司非常注重 .NET。但是 Mono 的新发展,他们问自己是否可以将 Linux 瞄准较小的项目,也可以避免为他们设计软件和硬件的人们支付高昂的许可成本。
我已经研究过 mono 可以做什么(以及还不能做什么)。现在我谈到了嵌入的问题。我有点迷失在如何构建嵌入式 Linux 的故事中。
我看到一些故事,他们只是使用一些标准的 Linux 库来在硬件上制作嵌入式 Linux。我还看到存在特殊的 Linux 发行版,例如 uClinux(又名 µClinux)。那么有什么区别,或者只是一样。当我想在目标设备上使用嵌入式 Linux 时,通常的流程是什么样的?
好吧,比单声道部分,所以基本上我希望能够在嵌入式 Linux 中运行 C#。这里主要使用uclinux,我可以使用mono吗?我查看了一些规格,它们没有内存管理单元(MMU)。
所以基本上我担心没有MMU。既然垃圾收集器会如何反应呢?
我希望我没有提出过多的问题,
问候,我已经感谢您阅读它,
本杰明
I am doing research for a company as an internship. I had some question in using Mono, the cross platform implementation of .Net platform. My company designs hardware and sotware.
My knowledge of using embedded linux is very limited. My company where I am doing my internship is really .NET minded. But the new developments of mono, they asking themselves if they can target linux for smaller projects, too avoid the high licensing cost for the people for which they design the software and hardware.
I already looked in to what mono can do (and can't yet do). Now I reach the embedded question. I am kinda lost in the story in how an embedded linux is built.
I saw some stories where they just took some standard linux libraries to make the embedded linux on the hardware. I also saw that there exists special linux distributions like uClinux (aka µClinux). So what's the difference, or is it just the same. What does the process look like typically when I want to use embedded linux on a target deivce?
OK, than the mono part, so basically I want to be able to run C# in embedded linux. Here mostly they use uclinux, am I able to use mono for this? I looked at some specifications, and they don't have Memory Management Unit (MMU).
SO basically I worry about that no MMU. Since how will the garbage collector react?
I hope i didn't give an overload of questions,
Regards, and I thank you already for reading it,
Benjamin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
垃圾收集器不依赖于 MMU,尽管如果有 MMU,它的效率会更高。
我们目前利用它来生成空引用异常而不进行检查:在 uclinux 上,您需要启用显式检查(代码已经存在,只需启用即可)。
其他人报告在 uclinux 上使用 mono,尽管可能需要对这里和那里的源代码进行一些调整,因为我们从未在该平台上测试过它(当然,我正在谈论我们已经支持的 cpu 架构上的 uclinux,例如 ARM,您没有具体说明)。
至于其他评论,AOT 和 mkbundle 很大程度上与您的需要无关。您真正想要的是减少单声道占用空间以适应您的设备允许的情况,请参阅 http://www .mono-project.com/Small_footprint 了解更多信息。
如果是我做决定,我总是会选择常规的 ARM Linux 而不是 uclinux 来运行复杂的软件,比如 Mono 或任何需要在 Mono 上运行的程序。
The garbage collector doesn't depend on a MMU, though it can be more efficient if there is one.
We currently take advantage of it to generate null reference exceptions without checks: on uclinux you will need to enable the explicit checks (the code is already there, it just needs to be enabled).
Other people reported using mono on uclinux, though there are likely some tweaks required to the sources here and there since we never test it on that platform (of course I'm talking about uclinux on a cpu architecture we already support, like ARM, you didn't specify).
As for other comments, AOT and mkbundle are largely irrelevant for what you need. What you really want is to reduce the mono footprint to fit into what your device allows, see http://www.mono-project.com/Small_footprint for more info.
If it was me making the decision, I'd always choose a regular ARM linux over uclinux for running complex software like mono or whatever program you need to run on mono.
如果您的设备没有 MMU,也许您可能想使用 Microsoft 的开源 .NET微框架。它比 .NET/Mono 受到更多限制,并且它是一个解释器,而不是 JIT,但它可以在更有限的硬件上运行。
If your devices don't have a MMU, perhaps you might want to use Microsoft's open-source .NET Micro Framework. It's much more limited than .NET/Mono, and it's an interpreter, not a JIT, but it can run on much more limited hardware.
Mono 的限制可以如您所愿。如果您使用的设备没有 MMU,我会查看 Ahead of时间编译。
mkbundle 也可能有效,但我不确定它是否可以在没有一个MMU。也就是说,如果您使用 AOT,您将首先使用 mkbundle 来引入所有依赖项。
Mono can be as limited as you want it to be. If you're using a device that has no MMU, I'd look into Ahead of Time compilation.
mkbundle may also work as well, but I'm not sure that it can do without an MMU. That said, if you're using AOT, you're going to be using mkbundle first to pull in all the dependencies.
如果您的公司希望通过 MONO 定位嵌入式 Linux 板,并且所需要做的只是转移一些已经在桌面 Windows 计算机上运行的应用程序,那么您可能会遇到很少的问题。但是,如果您想与某些 IO、I2C、SPI、1-Wire 和其他外设通信,则通过 MONO 访问它们时会遇到问题,并且您可能需要制作一些转换器(可能用 GCC 编写),这将是真实硬件和 MONO 应用程序之间的网关。
If your company wants to target embedded Linux boards via MONO, and all that is needed is to transfer some application that already runs on desktop windows computer, then you will probably have very little problems. But if you want to talk to some IO, I2C, SPI, 1-Wire and other peripherals, you will have a problem to access them via MONO and you will probably have to make some translator (probably written in GCC) that will be a gateway between real hardware and your MONO application.