tiny os虚拟机_在C#中营救Tiny OS

tiny os虚拟机

tiny os虚拟机

About four years ago (in the middle of the last fifteen years of writing software for money) I graduated from college. I took a round-about way through school at OIT - my four-year degree took eleven years (I actually had to make deals with four different deans to allow me to keep my credits from expiring) but it turned out OK.

大约四年前(在为金钱编写软件的最后十五年中),我大学毕业了。 我在OIT上学时走了个弯路-我的四年制学位花了十一年的时间(实际上,我不得不与四个不同的系主任打交道,以使我的学分永不过期),但事实证明还不错

Some where in the middle of going to school at night we were asked in an Operating Systems class to write a "Virtual CPU and OS." More of an interpreter, we were given a description of the OS, some op-codes and an ASM-like machine language. We were to write the OS, and feed test programs into the system. It was a fun exercise and a good way to teach folks how virtual memory and memory mapping works, threads vs. processes, etc. I was the only student who chose to write it in managed code. Quite the coup for 2002.

在晚上上学的某个时候,我们在一个操作系统课程中要求我们编写“虚拟CPU和OS” 。 我们提供了更多的解释器,包括操作系统的描述,一些操作码和类似ASM的机器语言。 我们要编写操作系统,并将测试程序输入系统。 这是一个有趣的练习,也是一种向人们传授虚拟内存和内存映射如何工作,线程还是进程等的好方法。我是唯一选择用托管代码编写它的学生。 2002年的妙招。

I turned in the project and threw it up on GotDotNet (this link will be dead in July of 2007), but of course, GDN will be gone soon. Just so it wouldn't be lost, it's now available here in C#. It's actually kind of fun, I think, as I put in some "jokes" - funny to me at least. For example, the OS pages it's virtual memory to XML files when it runs out of "physical" memory. It behaves like a real little OS. It'll thrash with low memory, and get fragmented if a lot is going on.

我上交了项目,并将其放在GotDotNet上(此链接将在2007年7月终止),但是GDN当然会很快消失。 只是为了确保它不会丢失,它现在在C#中可用。 我认为,这实际上是一种乐趣,至少是对我来说很有趣。 例如,当“物理”内存用完时,操作系统会将其虚拟内存分页为XML文件。 它的行为就像一个真正的小操作系统。 它会因内存不足而崩溃,如果发生了很多事情,就会变得零散。

A tiny virtual CPU and OS written entirely in C#. The TinyOS simulates the scheduling, memory management (including paging and virtual memory) and other operations of theoretical Operating System. You’ll see many Framework classes and techniques in use including Regular Expressions, XML Serialization, generated Strongly Typed Collections, XML Comments and a generated Help file. You won’t get much useful work out of the TinyOS itself, but the techniques you’ll learn can be applied to real life.

完全用C#编写的微型虚拟CPU和操作系统。 TinyOS模拟理论操作系统的调度,内存管理(包括分页和虚拟内存)和其他操作。 您将看到许多正在使用的Framework类和技术,包括正则表达式,XML序列化,生成的强类型集合,XML注释和生成的帮助文件。 TinyOS本身并不会带来很多有用的工作,但是您将学到的技术可以应用于现实生活中。

Since this little ditty, others who really know what they are doing have written more serious OS's in C# that are worth looking at.

由于这个小技巧,其他真正知道自己在做什么的人已经用C#编写了更值得研究的严肃OS

I presented on my little CPU/OS at TechEd Malaysia 2002, and the PPT slides are available as well. I also did it again in VB.NET if you like with a little trouble.

我在2002年TechEd Malaysia上用我的小型CPU / OS进行了演示,并且还提供了PPT幻灯片如果您有一点麻烦,我也会在VB.NET中再次进行此操作

I looked at this code in 2005 and was shocked and offended with myself - well, not really, but it was enlightening to say the least. 

我在2005年查看此代码后,对自己感到震惊和冒犯-很好,不是真的,但是至少可以说这很有启发性。

Go find some code that you wrote at LEAST FIVE years ago and tell me how it looks today...

去查找您至少在五年前编写的一些代码,并告诉我今天的样子...

翻译自: https://www.hanselman.com/blog/rescuing-the-tiny-os-in-c

tiny os虚拟机

刚学C#时就一直想找到一种方法可以让.Net程序在未安装framework的电脑上运行,但一直没有找到真正可用的。虽然有些公司发布了可以将.net代码编译成navtive代码以脱离.net环境运行,如Remotesoft DOTNET Linker,Xenocode Postbuild等,但一直没有破解版,用它们编译的程序每次运行会添出个版权信息。最近偶然发现一种方法可以做到真正使程序脱离.net环境运行且没有任何版权信息添出,现将使用方法、源代码、测试程序发布于此: 请首先在文章末尾下载测试程序,是一个用C#做的串口工具,下载解压后有两个文件夹(FrameWork和APP)和一个程序(串口工具.exe),在APP文件夹下有一个名为9527.exe的程序,这个是C#真正的“串口工具.exe”,而主目录下的串口工具.exe只是一个Loader程序,它运行后首先判断电脑上有没有安装framework,若有,则直接启动APP下的9527.exe程序;若无,则通过framework虚拟机(FrameWork下的VM.exe(其实是飞信框架里的FetionVM.exe,修改了它的图标和版权,想改成其它的大家可以用VC改一下,有网友强列要求指出这一点,想不明白为什么,呵呵,让指出就指出吧,还要求指出调用的方法,,其实我连源程序都公布了,用说的这么明白吗))启动9527.exe程序。Loader程序不会打开任何窗口,并在启动真正应用程序后立即退出。Loader程序主函数(VC6.0编写)的代码附件上有
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值