TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why not build operating systems as layers?

3 点作者 an-selm大约 3 年前
Disclaimer: I am not a professional programmer, nor am I very well-versed in OS theory. Nevertheless I have the following question: Why do people still build OS's from scratch, and dont just use the base system and wrap it in an OS of their liking? For example, mezzano a lisp OS is, it seems to me, pretty much built from scratch. Why do these guys not just build a lisp OS on top of some UNIX-system, so that every call to the OS goes through that layer? As an example: Some people complain that UNIX files are essentially just a lot of text, with not much further information. Why not just write an additional layer that uses those files as the base but also stores more information about them somewhere? Maybe it would be too slow, or maybe some system calls cant be passed through an additional layer. Or maybe I am not seeing something immediately obvious to any professional. But I feel like I am probably going to learn something from the answer, so I will just go ahead and ask.

2 条评论

PaulHoule大约 3 年前
People build all kinds of layers. Consider for instance<p><a href="https:&#x2F;&#x2F;www.pcworld.com&#x2F;article&#x2F;394895&#x2F;what-is-valve-proton-steam-deck-games-software-explained.html" rel="nofollow">https:&#x2F;&#x2F;www.pcworld.com&#x2F;article&#x2F;394895&#x2F;what-is-valve-proton-...</a><p>Proton is a system (based on open-source Wine) that lets you run Windows programs on Linux. Back in the day there was something called Cygwin that worked in a similar manner in the opposite direction.<p>There is a certain amount of overlap and&#x2F;or competition between language runtimes and operating systems. Back in the 1970s and early 1980s home computers frequently had a &quot;language system&quot; instead of an operating system, typically it was a BASIC-based environment but it could be FORTH, LISP or some other language. My first computer was a TRS-80 color computer with just 4K of RAM but it was good enough to learn programming on because a language system is thriftier than a real OS.<p>With the IBM PC however you would usually boot into MS-DOS and then run a BASIC interpreter (initially BASICA but then there was GWBASIC...) and I remember doing the same with the OS-9 operating system and BASIC09 on my Coco once it was upgraded to 64K of RAM and a disk system.<p>Thus it&#x27;s pretty clear that &quot;running a language runtime under an OS&quot; is competitive with &quot;running a language system on bare metal.&quot;<p>Java in particular has a sophisticated runtime but you find a pretty high level of services offered by a Common LISP runtime or many other languages.<p>And of course using emulation, virtual machines and similar methods you can run just about anything on top of an ordinary OS.
评论 #30879276 未加载
khedoros1大约 3 年前
&gt; Why do these guys not just build a lisp OS on top of some UNIX-system, so that every call to the OS goes through that layer?<p>In Mezzano&#x27;s case, presumably because they wanted to build an OS in Common Lisp, not on top of the C that a Unix system would be implemented in. Looking at their Patreon (<a href="https:&#x2F;&#x2F;www.patreon.com&#x2F;froggey" rel="nofollow">https:&#x2F;&#x2F;www.patreon.com&#x2F;froggey</a>) and FAQ (<a href="https:&#x2F;&#x2F;mezzanos.herokuapp.com&#x2F;static&#x2F;everyone&#x2F;faq1.html" rel="nofollow">https:&#x2F;&#x2F;mezzanos.herokuapp.com&#x2F;static&#x2F;everyone&#x2F;faq1.html</a>), part of the purpose of the OS is to re-explore the Lisp machines from the &#x27;80s.<p>I know that if I built an OS, my purpose would likely be either learning, or experimentation with some concept that would be difficult to implement in any of the standard existing systems. Building on top of an existing base would defeat the point of the exercise, IMO.