问题描述
我在这里看到了这个帖子.我想知道这是否合法(听起来像)以及这样做的缺点是什么.在某些架构中独立运行它需要什么?谢谢
I saw this thread here. I was wondering if this was legit (sounds like it) and what are the drawbacks of doing this. What does it entail to run it stand alone in some architecture? Thanks
推荐答案
目前尝试用托管语言创建操作系统是一个有趣的研究问题".这意味着这似乎是可能的,但仍有相当多的重要问题需要解决(例如,我预计不会很快出现托管窗口").
Trying to create an operating system in a managed language is currently an "interesting research problem". This means that it seems possible, but there are still quite a few important issues that need to be resolved (for example, I wouldn't expect "managed windows" anytime soon).
例如,看看 Singularity 项目(也可以使用 在 CodePlex).它仍然有一些原生部分,但很少.据我所知,即使是垃圾收集器也是用托管代码编写的(带有一些允许使用指针安全操作的语言扩展).
For example, take a look at the Singularity project (also available at CodePlex). It still has some native parts, but very few of them. As far as I know, even the garbage collector is written in managed code (with some language extension that allows safe manipulation with pointers).
诀窍在于,即使是托管代码最终也会被编译为本机代码.在 .NET 中,编译通常由 JITter 在您启动应用程序时完成.在 Singularity 中,这是提前完成的,因此您运行本机代码(但从托管代码生成).奇点还有其他一些有趣的方面——例如,进程通过消息进行通信(并且不能动态加载代码),这使得在生成本机代码时可以进行一些积极的优化.
The trick is that even managed code will eventually be compiled to native code. In .NET, the compilation is done usually by JITter when you start the application. In Singularity, this is done in advance, so you run native code (but generated from managed). Singularity has some other interesting aspects - for example, processes communicate via messages (and cannot dynamically load code), which makes it possible to do some aggressive optimizations when generating native code.
这篇关于一个完整的 C# 操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!