Mac OS X 和 BSD 的关系有多密切? [英] How closely are Mac OS X and BSD related?

查看:22
本文介绍了Mac OS X 和 BSD 的关系有多密切?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读到 Mac OS X 和 bsd 是相关的.他们的关系有多密切.可以在 BSD 上调整和安装 Mac OS X 软件吗?

I read that Mac OS X and bsd are related. How closely are they related. Can Mac OS X software be tweaked and installed on BSD?

推荐答案

回到 OS X 10.4 的时代,我花了一些时间未能为 OS X 编写 VFS.在那些日子里,内核的主要子系统,只有网络堆栈和 VFS 仍然是真正的 BSD.当时,甚至 VFS 也被部分重写以使其更加模块化(所有 BSD VFS 数据结构都变成了不透明的指针,并且 API 是通过所谓的 KPI 函数实现的).我相信网络堆栈也在以同样的方式发展.在与用户态的接口处还有一个薄层,使操作系统对用户态程序看起来像 BSD.

Back in the days of OS X 10.4 I spent some time failing to write a VFS for OS X. In those days, of the major subsystems of the kernel, only the network stack and the VFS were still truly BSD. At that time, even the VFS had been partly rewritten to make it more modular (all the BSD VFS data structures became opaque pointers and the API was through what were called KPI functions). I believe the network stack was going the same way. There was also a thin layer at the interface with userland that made the OS look like BSD to userland programs.

其他一切都几乎被重写或替换:内存管理、进程管理等来自 Mach 微内核;设备驱动子系统由 Apple 从头开始​​编写.

Everything else had been pretty much rewritten or replaced: memory management, process management etc came from the Mach microkernel; the device driver subsystem was written from the ground up by Apple.

在用户态编程方面,OS X 与 BSD 非常相似,为 BSD 编写的程序应该很容易移植.但是,OS X 有很多在 BSD 中不可用的 API.这些几乎包括与用户界面有关的所有内容 - 图形、声音等.还有其他一些 BSD 中不存在的界面,例如启动 API,它是 OS X 启动后台进程的首选方式.

In terms of userland programming, OS X is very similar to BSD and programs written for BSD should be easily portable. However, OS X has a lot of APIs that aren't available in BSD. These include almost everything to do with the user interface - graphics, sound etc. There are also other interfaces that don't exist in BSD such as the launch API which is the OS X preferred way of launching background processes.

这篇关于Mac OS X 和 BSD 的关系有多密切?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆