2013年11月29日 星期五

About 64bit application & OS & processor

最近在想kvm for ARMv8有什麼好處
想一想發現其實這就等同於ARMv8有什麼好處

我想最重要的一點就是64bit processor吧
由此又想到一堆關於32bit vs 64bit virtualization的問題
  • 64bit guest OS run on 32bit host OS?
  • 64bit guest OS run on 32bit processor?
  • Linux program run on Windows and vice versa?
看了這篇文章後我想答案是 http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm
  • 只要是是64bit processor就可以run 64bit guest OS,但通常virtual machine設計會規定要有hardware virtualization support才可以,因為software virtualization會需要每個guest 64bit instruction都trap進32bit host來作simulation,相當慢!
  • Virtual machine無法,但simulator&emulator就可以,因為virtual machine是作OS virtualization,而64bit OS cannot run on 32bit processor,但simulator是作hardware virtualization,所以simulator可以在32bit processor上模擬一個64bit virtual processor,想當然就可以跑64bit guest OS
  • There are two main reasons that binarys from one OS can't be run on another OS. First is the fact that the binarys are in different formats. Linux uses ELF, and Windows uses PE. Now that compatibility can easlily be overcome, but the other problem is the OS library functions that all applications use must be ported over as well. Applications need to use OS system functions to do just about anything at all. This includes printing to the console, opening/closing files, creating windows, etc.


以下整理該文章我看到的一些重點
The main issue is that your computer works from the hardware such as the processor (or CPU, as it is called), through the operating system (OS), to the highest level which is your applications. So the computer hardware is designed first, the matching operating systems are developed, and finally the applications appear.


But a 64-bit application will only run on a 64-bit OS and a 64-bit OS will only run on a 64-bit processor.


An example of backward compatibility is Windows 64-bit. It has software called WOW64 that provides compatibility by emulating a 32-bit system.
One important point that is made in that article is that it is not possible to install a 32-bit device driver on a 64-bit operating system. Because device driver is at the same level with OS.

Following the general rule, we would expect that you cannot run 64-bit software on a 32-bit system. Except that there is one exception called virtualization.


Virtual Machine: OS virtualization.
Simulator & Emulator: Hardware virtualization.
So virtual machine in 32bit processor cannot run 64bit guest OS.
However, simulator in 32bit processor can simulate 64bit machine and run 64bit OS.


Reference : http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm

0 意見:

張貼留言