虚拟机相关技术研究及实践
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
虚拟机(Virtual Machine,VM)是相对我们平常所用的实际的计算机而言的一个概念,它是一个假想的模拟实际计算机进行工作的软件系统,同真实计算机一样,虚拟机有自己的中央处理器,指令系统,存储器组织,寄存器组,堆栈,输入输出等,可以接受指令系统的指令,完成计算或数据处理任务。虚拟机的优点之一是计算机程序可以在不同的操作系统之间复用,即实现程序的跨平台,Java虚拟机的设计思想正体现了这一特点。
     本文以Java虚拟机技术为主要研究对象,比较深入地分析和研究其一些关键技术,并用C/C++设计和实现一个基于Windows平台的小型虚拟机软件系统TVM(Tiny Virtual Machine),主要做了以下工作:
     首先了解Java虚拟机的基本运行环境,如PC寄存器、JAVA栈、堆以及框架等,又以Kaffe(一个Java虚拟机的实现)为例,对Java虚拟机的运行过程进行分析。
     其次研究了Java虚拟机的内存管理机制,如垃圾回收技术,并对其内存泄漏以及性能等问题作了探讨。
     然后对TVM虚拟机的工作过程进行分析并给出其总体设计思路,接着实现TVM虚拟机,其中包括虚拟中央处理器、存储器组织以及指令系统等的设计与实现。
     最后为TVM虚拟机设计和实现一个汇编器TA,并对整个TVM虚拟机系统进行测试验证,同时也与JAVA虚拟机作了比较。
Virtual machine is a concept relative to the real computer we use daily. It is a software system that simulates the working process of real machines. Like real one, Virtual machine has its own Central Processing Unit, Instruction System, Storage, Register Group, Stack and I/O Devices etc. It can also process the instructions of Instruction System to accomplish tasks like computing or data-processing.One merit of virtual machine is to reuse the program in different operating systems. And the design of Java Virtual Machine is actually based on this.
    This paper lay emphasis on Java Virtual Machine and does some analysis and research of its key technologies.Then the author design and implement a Tiny Virtual Machine(TVM) software system based on Windows platform using c/c++ language.The specific jobs are as follows:
    First,understand the basic running environment of Java Virtual Machine such as PC Register,JAVA Stack,Heap and Framework etc.Then,analyze the running process of Java Virtual Machine via Kaffe(an implementation of Java Virtual Machine).
    Second,research the memory management mechanism of Java Virtual Machine such as garbage collecting technique and discuss the issues of memory leakage and performance.
    third,analyze the working process of Tiny Virtual Machine and come up with its design approach.Then,implement the Tiny Virtual Machine including virtual central processing unit,memeory and instruction system.
    last,design and implement a compiler TA and do some testing work of Tiny Virtual Machine.Besides,comparison between Tiny Virtual Machine and Java Virtual Machine is presented.
引文
?
    
    
    [1] James Gosling,Bill Joy and Guy Steele.The Java Language Specification V1.0 Sun Microsystems,Inc, 1996.
    [2] Sun Microsystems Inc. The Java Virtual Machine Specification (Second Edition) [M/OL]. http://java.sun.com/docs/books/,1999-09-01.
    [3] Lindholm T.,Yellin F.Java虚拟机规范[M].玄伟剑,译.北京大学出版社
    [4] Under The Hood:The Lean,Mean Virtual Machine.Java World, 1996.(6)
    [5] Security and The Class Verifier. Java World,1997.
    [6] Under The Hood:Java's Garbage-collected Heap.Java World, 1996.(8)
    [7] Jim Patrick, Handling memory leaks in Java programs, http://www-106.ibm.com/developerWorks/library/j-leaks/index.html
    [8] Byung-Sun Yang, etc:Lightweight Monitor for Java VM, ACM SIGARCH Computer Architecture News [EB/OL].http://latte.sun.ac.kr/publications,March 1999.
    [9] Byung-Sun Yang, etc:A Java VM Just-in-Time Compiler With Fast and Efficient Register Allocation[EB/OL].http://latte.sun.ac.kr/publications,March,1999.
    [10] 孙希、俞建新:Java虚拟机新技术探讨 南京大学计算机软件新技术国家重点实验室,《计算机应用》第21卷第8期
    [11] 廖春元、戴梅萼:Java虚拟机技术探讨 清华大学计算机系(100084)《微型机与应用》1998年第3期
    [12] 王立冬、张凯:Java虚拟机中类装载器的实现《计算机应用》第22卷第11期
    [13] 丁宇新、程虎:Java虚拟机中无用单元的精确回收《计算机学报》第22卷第11期
    [14] 刘书家、赵传强、李朴:虚拟86模式下实时多任务操作系统的研究与实践《计算机研究与发展》第34卷 第3期
    [15] Carsten Nitsch (principal author),Karlheinz Weiss,Thorsten Steckstor. Embedded System Architecture Design Based on Real-Time Emulation Submission to RSP'2000
    [16] Mr. Jan Bottorff, President janb@pmatrix.com,Paradigm Matrix, Inc. San Ramon, California.The Argument Source Permutation (ASP) Virtual Machine Instruction Set
    [17] John Leuner, jewel.removeforspam@pixie.co.za A free Java Virtual Machine, http://www. sourceforge.com/
    [18] Chandrasekhar Boyapati Towards An Extensible Virtual Machine, MIT Laboratory for Computer Science, Cambridge, MA 02139 chandra@lcs.mit.edu
    [19] The Jikes~(TM) Research Virtual Machine User's Guide Post 2.2.2 (CVS head) http://www-124.ibm.com/developerworks/oss/jikesrvm
    [20] Bradley M.Kuhn Considerations on Porting Perl to the Jav a Virtual Machine Department of Electrical and Computer Engineering and Computer Science of the College of Engineering B.S., Loyola College In Maryland, 1995
    [21] 戚隆宁、浦汉来、罗春:基于μITRON3.0标准的操作系统级模拟器的实现
    
    Chinese Journal of ELECTRON DEVICES 2003年第26卷第2期
    [22] 贺红卫:“Inte18086软件仿真器的设计与实现”,系统仿真学报,1996年9月
    [23] 李恩有、张祥、吴成柯等:“基于一实际应用系统的1860XR汇编程序及链接程序设计”,计算机研究与发展,1997年第6期
    [24] Jianwen Zhu,Daniel D.Oajski "A Retargetable,Ultra-fast Instruction Set Simulator",Design,Automation and Test in Europe Conference and Exhibition 1999. Proceedings,1999 page(s):298-302
    [25] 崔光佐、程旭、佟冬:“面向处理器的系统级模拟、仿真及调试技术—基于软硬件协同设计的新方法”,计算机研究与发展,2001年3月,第3期
    [26] 陆鑫达主编:计算机系统结构,高等教育出版社,1996年3月
    [27] Leland L.Beck System Software and Introduction to System Programming, San Diego State University, 1990.
    [28] Dean Elsner, Jay Fenlason,et al. The GNU Assembler Manual,the Free Software Foundation Inc,July 1996.
    [29] John L. Hennessy, David A. Patterson "Computer Organization and Design",Morgan Xaufrnann Publishers,San Mateo,California, 1994.
    [30] (美)Bill Blunden著 杨涛、杨晓云、王建桥等译:虚拟机的设计与实现机械电子工业出版社
    [31] 蔡建平:“微控制器软件仿真系统的设计实现”,微计算机应用,1995年第1期
    [32] 李锋,王雷,刘又城等:“CPU仿真器MCS中存贮结构仿真的实现”,北京航空航天大学学报,2001年第4期
    [33] 金成植:“编译程序构造原理和实现技术”,北京:高等教育出版社,2000
    [34] 高仲义,金茂中:“编译原理及编译程序构造”,北京:北京航空航天大学出版社,1990
    [35] 编著者:庞丽萍等:软件开发基础——面向对象技术与操作系统虚拟机,高等教育出版社
    [36] 编著者:唐朔飞:计算机组成原理,高等教育出版社
    [37] 编著者:张晨曦:计算机体系结构,高等教育出版社
    [38] 编著者:金诚植:编译程序构造原理与实现技术,高等教育出版社
    [39] Matt Pietrek 《Windows 95 System Programming Secrets》March 1996
    [40] Walter Oney 《Programming the Windows Driver Model》1999