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

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

问题描述

我了解到Mac OS X和bsd是相关的.它们之间有多紧密的联系.可以调整Mac OS X软件并将其安装在BSD上吗?

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函数).我相信网络堆栈会以相同的方式运行.在与用户界面的接口上还存在一个薄层,这使得OS在用户界面程序中看起来就像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天全站免登陆