- 论坛徽章:
- 0
|
摘自http://www.freebsd.org.cn/snap/d ... uxemu-advanced.html
- ......
- 在FreeBSD内核中有一个Linux内核;由内核提供的能够提供所有服务的各种潜在功能在FreeBSD系统调用表记录和Linux系统调用表记录之间是一样的:文件系统操作,虚拟内存操作,信号发送,System V IPC,...等等。唯一的不同是FreeBSD会得到FreeBSD的胶合功能, 而Linux程序会得到Linux的胶合功能 (大部分老的操作系统只有它们自己的胶合函数, 函数地址在静态全局变量sysent[]结构数据里面, 而不是动态的初始化到进程的proc结构)。
- 哪一个是FreeBSD自己的ABI呢?这无关紧要。基本上, 唯一的不同是FreeBSD的胶合功能是被静态连接到内核,而Linux的胶合功能可能是被静态连接到内核,也可能它们通过一个内核模块来访问。
- 有一个真正的模拟器吗?没有,它只不过是一个ABI执行机制,不是一个模拟器。
- 为什么有时它被叫做“Linux模拟器”? 只是为了更容易地卖出FreeBSD罢了!实际上,历史上从来没有描述这样一种执行机制的名字,FreeBSD并不是真正地运行Linux程序,如果您不编译进代码,或加载一个模块。就需要有一个名字来描述这样一种加载功能--因此就想出了“Linux模拟器”这样一个名字。
复制代码
摘自http://www.freebsd.org/doc/en_US ... uxemu-advanced.html
- ... ffect, there is a Linux kernel in the FreeBSD kernel; the various underlying functions that implement all of the services provided by the kernel are identical to both the FreeBSD system call table entries, and the Linux system call table entries: file system operations, virtual memory operations, signal delivery, System V IPC, etc... The only difference is that FreeBSD binaries get the FreeBSD glue functions, and Linux binaries get the Linux glue functions (most older OS's only had their own glue functions: addresses of functions in a static global sysent[] structure array, instead of addresses of functions dereferenced off a dynamically initialized pointer in the proc structure of the process making the call).
- Which one is the native FreeBSD ABI? It does not matter. Basically the only difference is that (currently; this could easily be changed in a future release, and probably will be after this) the FreeBSD glue functions are statically linked into the kernel, and the Linux glue functions can be statically linked, or they can be accessed via a kernel module.
- Yeah, but is this really emulation? No. It is an ABI implementation, not an emulation. There is no emulator (or simulator, to cut off the next question) involved.
- So why is it sometimes called “Linux emulation”? To make it hard to sell FreeBSD! Really, it is because the historical implementation was done at a time when there was really no word other than that to describe what was going on; saying that FreeBSD ran Linux binaries was not true, if you did not compile the code in or load a module, and there needed to be a word to describe what was being loaded--hence “the Linux emulator”.
复制代码
freebsd没有采用模拟的方式对linux程序支持,这一点与vmware、wine之类的模拟器应该不一样。它仅是在freebsd的ABI基础上增加了linux的ABI,这样看来Linux二进制兼容模式与native模式程序运行的机制相同,不该有执行效率的问题,至少不该有很大影响,是不是  |
|