虛擬環境技術有助於使用者在原本的作業系統中創造另一個的硬軟體環境,並能在其虛擬環境中執行程式,一如使用者好像真的擁有該硬體環境。於使用者模式中執行的虛擬環境由於執行指令的權限受到限制,所以可以確保該虛擬環境內的所有動作將不會危害整個系統的運作,使用者可以放心的在虛擬環境中進行各種測試動作。但這也代表使用者模式虛擬環境擁有一個無法避免的缺點:由於隔音的概念作用,虛擬機器下的程序無法對虛擬環境以外的程序直接進行I/O溝通,就算兩者是位於同一台主機上的虛擬環境也一樣做不到。所以對開發人員來說,便無法利用虛擬環境技術來為那些需要與外界溝通的裝置的I/O動作部份進行監控偵錯。而在進行虛擬環境內對外部實體裝置I/O對應動作控制的研究時,發現QEMU此虛擬軟體並無直接反應從外部而來的中斷要求的機制。 此篇論文以平行埠上的Parallel Line Internet Protocol(PLIP)連線協定為實測與研究對象,提出一種虛擬中斷的原則與方法,使得QEMU此類使用者模式虛擬環境軟體能夠處理I/O溝通過程中的所需要的中斷即時性回應,使用者能以此方法讓虛擬機器在無法攔截硬體中斷要求信號的限制下仍能正常使用PLIP協定,能透過控制平行埠達到對外進行I/O的溝通。文中並比較在有虛擬中斷支援下與未支援下的數據,發現虛擬中斷方法可逼近使用實體中斷的性能與效率。 Virtual environment can help user to create a hardware environment which he wants, and execute the program in it as that user really owns hardware environment like that. Because the user mode virtual environment is limited when it try to execute instructions, all action of the virtual environment will not crush user’s Host-OS and kernel system. User can do any danger behavior in his virtual environment. It means the process in the virtual environment cannot make directly I/O communication with the other process which is out of the virtual environment. Thus, it is impossible to use virtual environment to debug for I/O communication. While doing research about I/O communication between virtual environment and physical device, we found that QEMU has no scheme to reply an IRQ which comes from outside. This paper take PLIP with parallel port for an object of study and experiment. We find a method to virtual interrupt for QEMU and other user mode virtual environment can reply IRQ in I/O communication process. User can use this method to make virtual machine which can’t receive hardware IRQ signal operates PLIP normally, and it will do I/O communication with outside device by controlling parallel port. We compared the result of virtual interrupt and no virtual interrupt. We find that virtual interrupt can help system acts more closer to which use physical interrupt.