我只是想知道谁知道Windows、Mac OS X和Linux是由哪些编程语言组成的,以及操作系统的每个部分都使用了哪些语言(例如:内核、插件架构、GUI组件等)。
我假设每种都有多种语言,显然我知道Linux内核是用C编写的。
我完全猜测Mac OS X包含大量Objective-C代码,因为它是苹果从NeXT派生的语言。
Windows,我听说包含C, c++和英特尔汇编。Linux或Mac OS是否包含任何汇编代码?
还有,是否有像Ruby, Python之类的脚本语言被操作系统开发者用来编写部分操作系统的脚本?操作系统的哪些部分是用每种语言编写的?
Linux: C.组装中的部分部件。
[...] It's mostly in C, but most people wouldn't call what I write C.
It uses every conceivable feature of the 386 I could find, as it was
also a project to teach me about the 386. As already mentioned, it
uses a MMU, for both paging (not to disk yet) and segmentation. It's
the segmentation that makes it REALLY 386 dependent (every task has a
64Mb segment for code & data - max 64 tasks in 4Gb. Anybody who needs
more than 64Mb/task - tough cookies). [...] Some of my "C"-files
(specifically mm.c) are almost as much assembler as C. [...] Unlike
minix, I also happen to LIKE interrupts, so interrupts are handled
without trying to hide the reason behind them. (Source)
Mac OS X: Cocoa主要在Objective-C中。内核用C语言编写,部分部件用汇编。
Mac OS X, at the kernel layer, is mostly an older, free operating system called BSD (specifically, it’s Darwin, a sort of hybrid of BSD, Mach, and a few other things)... almost entirely C, with a bit of assembler thrown in. (Source)
Much of Cocoa is implemented in Objective-C, an object-oriented language that is compiled to run at incredible speed, yet employes a truly dynamic runtime making it uniquely flexible. Because Objective-C is a superset of C, it is easy to mix C and even C++ into your Cocoa applications.
(Source)
Windows: C, c++, c#。汇编程序中的部分部件。
对于Windows,我们几乎全部使用C、c++和c#。一些代码区域是手工调优/手工编写的汇编。(源)
Unix: C.汇编中的部分部件。(源)