What languages are Windows, Mac OS X and Linux written in?
我只是想知道,谁知道Windows、Mac OS X和Linux是由哪些编程语言组成的,以及在操作系统的每个部分(即:内核、插件架构、GUI组件等)使用哪些语言。
我假设每种语言都有多种语言,显然我知道Linux内核是用C语言编写的。
我完全猜测MacOSX包含了大量的Objective-C代码,因为它是苹果从Next派生的语言。
WINDOWS,我听说过包含C、C++和英特尔汇编。Linux或Mac OS是否包含任何程序集代码?
另外,操作系统开发人员是否使用Ruby、Python等脚本语言编写操作系统的部分脚本?操作系统的哪些部分将用每种语言编写?
- Windows:C++,内核在C中
- Mac:目标C,内核在C(IO PNP子系统是嵌入式C++)
- Linux:大多数东西都在C,很多用户应用程序都在Python中,KDE都是C++。
所有内核也将使用一些汇编代码。
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语言。装配机中的一些零件。
We use almost entirely C, C++, and C# for Windows. Some areas of code are hand tuned/hand written assembly. (Source)
unix:c.装配中的一些零件。(源)
Mac OS X在一些库中使用大量的C++,但由于害怕ABI的破坏,它没有被公开。
我知道这是一个老帖子,但Windows绝对不是用C++编写的。它里面有很多C++,但是我们把技术定义为一个操作系统不是C++。Windows API和Windows内核(两者本质上都是操作系统)是用C编写的。几年前,我收到了一些泄漏的Windows 2000和Windows XP代码。代码还不够完整,无法编译内核或API,但我们能够编译单独的程序和服务。例如,我们能够成功地编译notepad.exe、mspaint.exe和spoolsv.exe服务(打印后台处理程序)。所有的代码都是用C编写的,我没有再看一遍,但我确信泄漏的代码仍然可以作为仍然可用的Torrent文件保存下来。
- Windows:C++
- Linux:C
- MAC:目标C
- Android:Java、C、C++
- Solaris:C,C++
- IOS 7:ObjuleC,SWIFT,C,C++
Windows:主要是C和C++,一些C
你说得对,Macosx的核心是Objective-C。
Windows C++
Linux C
关于脚本语言,不,它们的层次相当高。
我读过或听说过Mac OS X主要是用Objective-C编写的,其中一些较低级别的部分,如内核和用C编写的硬件设备驱动程序。我相信苹果"吃自己的狗食",这意味着他们使用自己的Xcode开发工具编写Mac OS X。gcc(gnu compiler collection)编译器链接器是xcode用于编译和/或链接可执行文件的大多数UNIX命令行工具。在其他可能的语言中,我知道GCC编译C、Objul-C、C++和ObjaveC++语言的源代码。
Linux内核大部分是用C语言编写的(我想还有一些汇编语言),但是一些重要的用户空间实用程序(程序)是用bash脚本语言编写的shell脚本。除此之外,很难定义"Linux",因为您基本上是通过挑选所需的部分并将它们组合在一起来构建Linux系统,并且根据单个Linux用户的需要,您可以获得几乎所有涉及的语言。(正如保罗所说,Python和C++扮演着重要的角色)
真的!!!!有9年的问题,但我刚刚看到一系列关于Windows命令行历史的内部文章,我认为其中的一些部分可能是与Windows相关的问题:
For those who care about such things: Many have asked whether Windows is written in C or C++. The answer is that - despite NT's Object-Based design - like most OS', Windows is almost entirely written in 'C'. Why? C++ introduces a cost in terms of memory footprint, and code execution overhead. Even today, the hidden costs of code written in C++ can be surprising, but back in the late 1990's, when memory cost ~$60/MB (yes … $60 per MEGABYTE!), the hidden memory cost of vtables etc. was significant. In addition, the cost of virtual-method call indirection and object-dereferencing could result in very significant performance & scale penalties for C++ code at that time. While one still needs to be careful, the performance overhead of modern C++ on modern computers is much less of a concern, and is often an acceptable trade-off considering its security, readability, and maintainability benefits ... which is why we're steadily upgrading the Console’s code to modern C++.
请参见标题"一个在多个平台上运行的操作系统",其中说明:
1 | Most of the source code for Windows NT is written in C or C++. |
作为对MacOSX核心的补充,在雪豹之前,finder还没有用objective-c编写。在雪豹中,它是用可可写的,客观-C
Windows显然不是用C(!)编写的
只需查看Windows的源代码,就可以看到…