windows os x linux,What languages are Windows, Mac OS X and Linux written in?

问题

I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI components, etc).

I assume that there are multiple languages for each and obviously I know the Linux kernel is written in C.

I'm totally guessing here that Mac OS X contains a lot of Objective-C code as it is Apple's language derived from NeXT.

Windows, I have heard contains C, C++ and Intel Assembly. Do Linux or Mac OS contain any Assembly code?

Also, are there scripting languages like Ruby, Python, etc used by the OS developers for scripting parts of the OS? What parts of the OS would be written in each language?

回答1:

Windows: C++, kernel is in C

Mac: Objective C, kernel is in C (IO PnP subsystem is Embedded C++)

Linux: Most things are in C, many userland apps are in Python, KDE is all C++

All kernels will use some assembly code as well.

回答2:

Linux: C. Some parts in assembly.

[...] 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 mostly in Objective-C. Kernel written in C, some parts in assembly.

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#. Some parts in assembler.

We use almost entirely C, C++, and C# for Windows. Some areas of code are hand tuned/hand written assembly. (Source)

Unix: C. Some parts in assembly. (Source)

回答3:

Mac OS X uses large amounts of C++ inside some libraries, but it isn't exposed as they're afraid of the ABI breaking.

回答4:

I understand that this is an old post but Windows is definitely not written in C++. There is lots of C++ in it but what we technical define as an operating system is not in C++. The Windows API, the Windows kernel (both of these are in essence what an operating system is) are written in C. Years ago I was given some leaked code for both Windows 2000 and Windows XP. The code was not nearly complete enough to compile the kernel or API but we were able to compile individual programs and services. For example, we were able to successfully compile Notepad.exe, mspaint.exe, and the spoolsv.exe service (print spooler). All written in C. I have not looked again but I am sure that leaked code still survives as torrent files out there that may still be available.

回答5:

Windows: Mostly C and C++, some C#

回答6:

windows: C++

linux: C

mac: Objective C

android: JAVA, C, C++

Solaris: C, C++

iOS 7: Objective-C,Swift,C, C++

回答7:

You're right MacOSX has Objective-C in the core.

Windows C++

Linux C

About the scripting languages, no, they pretty much high level.

回答8:

I have read or heard that Mac OS X is written mostly in Objective-C with some of the lower level parts, such as the kernel, and hardware device drivers written in C. I believe that Apple "eat(s) its own dog food", meaning that they write Mac OS X using their own Xcode Developer Tools. The GCC(GNU Compiler Collection) compiler-linker is the unix command line tool that xCode used for most of its compiling and/or linking of executables. Among other possible languages, I know GCC compiles source code from the C, Objective-C, C++ and Objective-C++ languages.

回答9:

The Linux kernel is mostly written in C (and a bit of assembly language, I'd imagine), but some of the important userspace utilities (programs) are shell scripts written in the Bash scripting language. Beyond that, it's sort of hard to define "Linux" since you basically build a Linux system by picking bits and pieces you want and putting them together, and depending on what an individual Linux user wants, you can get pretty much any language involved. (As Paul said, Python and C++ play important roles)

回答10:

Wow!!! 9 years of question but I've just come across a series of internal article on Windows Command Line history and I think some part of it might be relevant Windows side of the question:

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++.

回答11:

As an addition about the core of Mac OS X, Finder had not been written in Objective-C prior to Snow Leopard. In Snow Leopard it was written in Cocoa, Objective-C

回答12:

See under the heading One Operating System Running On Multiple Platforms where it states:

Most of the source code for Windows NT is written in C or C++.

回答13:

Windows is obviously not written in C# (!)

Simply see the source code of Windows and you'll see...

来源:https://stackoverflow.com/questions/580292/what-languages-are-windows-mac-os-x-and-linux-written-in

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/268598.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Windows 7 硬盘安装方法

Windows 7硬盘安装正确方法收集一早同事的Windows 7系统有点问题,视频等不能正常播放。想要升级到7068的比较新的版本,是修复呢,还是重新安装呢?但他没有光驱,只能硬盘安装了。于是网上收集了一些硬盘安装的资料。这三…

Jmeter常见问题

1. JMeter的工作原理是什么?向服务器提交请求;从服务器取回请求返回的结果。2. JMeter的作用?JMeter可以用于测试静态或者动态资源的性能(文件、Servlets、Perl脚本、java对象、数据库和查询、ftp服务器或者其他的资源&#xff…

linux7.0开启ssh端口命令,Centos 7 修改SSH端口号

最近自己需要用台linux服务器,听朋友意见选择了Centos,安装完了之后发现全是坑!防火墙改为firewalld,linux系统默认了10多年的iptables都没装。。。预装的数据库是mariadb,没有mysql(后来查资料mariadb是mysql的分支&a…

《C#3.0 in a Nutshell,3rd Edition》之C#3.0和.net3.5基本介绍篇

前言 借着看这本书的机会,好好系统学习一下C#3.0和.net3.5。C#3.0是一门面向对象的编程语言,具有多用途和类型安全等特征。为实现开发和学习的高效性,她在语言的简单,易表达,以及可编程性上做了很大努力。使得新人能够…

linux github中文官网,GitHub使用简介

GitHub使用简介1. 关于GitHub的常见使用方法,请参考官网上面的说明。本篇文档只是针对于常用的,而且容易犯错的用法进行说明。仅仅是个人观点。2. 如何使用GitHub?(1) 常用的是首先在GitHub上创建一个版本库,然后接下来的工作是在…

[Win 7]Windows7 RC 简体中文版测试正式开始了哦!!

备受全世界关注的Windows7 RC ,于昨天晚上全球同步提供下载,在MSDN和Technet上已经同步提供下载,如果您是订阅用户可以立即下载体验了。微软已经宣布Windows 7RC的公开发布提起为5月5号!此次RC的发布,微软盛情邀请了10几位MVP参与…

bzoj 36733674 可持久化并查集加强版(可持久化线段树+启发式合并)

CCZ在2015年8月25日也就是初三暑假要结束的时候就已经能切这种题了%%% 学习了另一种启发式合并的方法,按秩合并,也就是按树的深度合并,实际上是和按树的大小一个道理,但是感觉(至少在这题上)更好处理一些。…

linux apache守护进程,Linux基础命令---httpd守护进程

httpdhttpd是apache超文本传输协议的主程序,它被设计成一个独立运行的守护进程。httpd会建立一个线程池来处理http请求。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法httpd [选项]2、参数列表选项说明-d serverroo…

银行家舍入VS四舍五入(下):.NET发现之旅(四)

接上节这一节继续讨论银行家舍入和四舍五入三&#xff0c;自己动手开发四舍五入组件<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" />事实上四舍五入在很多项目中还经常使用&#xff0c;所以我们可以动手开发一个这样的组件&…

基础回顾之泛型

1.泛型的优点 1>提高了安全性(将运行期的错误提前到编译器) 2>省去了强转的麻烦 2.<>中只能存放引用数据类型 3.集合前后泛型需要一致,jdk1.7之后,后面的<>中可以不写 4.方法的泛型最好和类的泛型一致 5.方法的泛型若与类的泛型不一致必须在方法前声明自己的…

linux dd安装系统,通过DD命令安装Windows,并介绍几款DD镜像包

Loading...原则上仅适用于独立服务器&#xff0c;并未添加其他虚拟化驱动online/oneprovider/hetzner的服务器已经过测试可以正常使用首先进入服务器的救援系统进入救援系统后使用root权限输入以下命令&#xff0c;然后等待一段时间后可尝试远程连接win10LTSC&#xff1a;wget …

2017.8.23创业项目方向

新型外包服务 除甲醛 催乳师 转载于:https://www.cnblogs.com/wpxuexi/p/7420425.html

FMS3系列(六):使用远程共享对象(SharedObject)实现多人时时在线聊天(Flex | Flash)

FMS开发中&#xff0c;经常会使用共享对象来同步用户和存储数据。对于实现广播文字信息实现聊天的支持非常强大&#xff0c;还可以跟踪用户的时时动作&#xff0c;在开发Flash多人在线游戏中的应用也非常广阔。 在使用FMS开发共享对象时需要注意&#xff0c;只有使用Flash Medi…

表驱动法——直接访问表示例1

表驱动法——直接访问表示例1 《代码大全》看到“表驱动法”一章&#xff0c;以下是表驱动法的第一个方法——直接访问表 import java.util.Scanner; import java.util.Calendar;class DaysPerMonth {public static void main(String[] args) {System.out.println("输入年…