KR100928866B1 - Apparatus and method for running an application in a virtual environment - Google Patents
Apparatus and method for running an application in a virtual environment Download PDFInfo
- Publication number
- KR100928866B1 KR100928866B1 KR1020070091659A KR20070091659A KR100928866B1 KR 100928866 B1 KR100928866 B1 KR 100928866B1 KR 1020070091659 A KR1020070091659 A KR 1020070091659A KR 20070091659 A KR20070091659 A KR 20070091659A KR 100928866 B1 KR100928866 B1 KR 100928866B1
- Authority
- KR
- South Korea
- Prior art keywords
- virtual environment
- application
- state information
- cpu state
- cpu
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45537—Provision of facilities of other operating environments, e.g. WINE
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
가상 환경에서의 어플리케이션 실행 장치 및 방법에 관한 것이다.An apparatus and method for executing an application in a virtual environment.
본 발명의 실시예에 따른 가상 환경에서의 어플리케이션 실행 방법은 가상 환경 구축을 위한 초기화를 수행하는 단계, 가상 환경의 커널 레벨로 전환하는 단계, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계, 가상 환경 내에서 실행되는 어플리케이션의 CPU 상태 정보인 제 2 CPU 상태 정보를 복원하는 단계, 복원된 제 2 CPU 상태 정보를 이용하여 어플리케이션을 실행하는 단계, 어플리케이션의 실행이 완료되지 않고 중단되는 경우 제 2 CPU 상태 정보를 저장하는 단계, 및 제 2 CPU 상태 정보 저장 단계 수행 후 제 1 CPU 상태 정보를 복원하는 단계를 포함한다.An application execution method in a virtual environment according to an embodiment of the present invention comprises the steps of performing initialization for building a virtual environment, switching to a kernel level of the virtual environment, and storing first CPU state information which is current CPU state information. Modifying the contents of the current CPU register to a value generated by performing an initialization step after performing the step of storing the first CPU state information; and restoring second CPU state information, which is CPU state information of an application running in the virtual environment. Executing the application using the restored second CPU state information, storing the second CPU state information if the execution of the application is interrupted without completing the first step, and storing the second CPU state information. Restoring CPU state information.
Description
본 발명은 가상 환경에서의 어플리케이션의 실행 장치 및 방법에 관한 것으로서, 더욱 상세하게는 특정 어플리케이션을 실행하기 위하여 기존 운영체제의 커널과 격리된 가상 환경을 제공하는 장치 및 방법에 관한 것이다. The present invention relates to an apparatus and method for executing an application in a virtual environment, and more particularly, to an apparatus and method for providing a virtual environment isolated from the kernel of an existing operating system to execute a specific application.
하나의 어플리케이션이 수행되는 메커니즘을 계층적으로 도시해보면 도 1과 같다. 어플리케이션(4)은 API를 통하여 라이브러리 함수를 호출하고, 라이브러리(3)는 시스템 호출(System Call)을 통해 운영체제(2)에 하드웨어 자원(1)을 요청하고, 운영체제는 ISA를 통해 하드웨어 자원을 제어한다. 가상화 기법은 공통의 하드웨어 자원 상에 복수의 운영체제가 지원되도록 하여 서로 다른 운영체제를 기반으로 하는 어플리케이션들이 실행될 수 있는 환경을 제공하는 기법이다. 이러한 가상화 개념은 그것이 구현되는 레이어에 따라 분류될 수 있다. 이 중 ISA 레벨 가상화는 하나의 하드웨어 상에 복수의 운영체제가 실행될 수 있도록 복수의 운영체제의 ISA를 에뮬레이션하는 기법으로, 복수의 운영체제로부터의 하드웨어에 대한 명령을 모두 전환해주어야 하므로 그 속도가 너무 느리다는 단점이 있었다. 그리하여 하드웨어에 대한 연산 명령은 기존의 코드를 그대로 쓰고 그 외의 상태 변화에 관계된 명령만을 에뮬레이팅하여 ISA의 일부만을 가상화하는 하드웨어 추상화 계층(HAL:Hardware Abstraction Layer) 레벨의 가상화가 등장하였다. 도 2는 HAL 레벨 가상화의 일반적인 개념을 도시하고 있다.A hierarchical illustration of a mechanism in which one application is performed is shown in FIG. 1. The application 4 calls the library function through the API, the
HAL 레벨 가상화는 공통의 하드웨어(33) 상에 호스트 운영체제(31)가 탑재된 상태에서 호스트 운영체제와는 다른 게스트 운영체제(12,22)에서 실행되는 어플리케이션들(11,21)이 게스트 운영체제를 기반으로 시스템 호출을 통해 하드웨어를 액세스하게 되고, 가상 머신(13,23) 및 가상 머신 모니터(32)는 이들 호출 중 연산 명령은 호스트 운영체제의 연산 코드를 그대로 쓸 수 있도록 중계하고 그 외 상태 변환 관련 명령의 경우 새로 정의된 코드를 제공함으로써 복수의 운영체제 상의 어플리케이션들(11,21)이 하드웨어를 할당 받을 수 있도록 한다. 그러나 HAL 레벨 가상화도 복수의 운영체제에 대한 인터럽트를 공통의 하드웨어에 매핑시켜줘야 하므로 각기 다른 운영체제에 의한 인터럽트를 핸들링하는데 매우 큰 오버헤드가 있다는 문제가 있었다.HAL level virtualization is based on the guest operating system by the applications (11, 21) running in the guest operating system (12, 22) different from the host operating system with the host operating system (31) mounted on the common hardware 33 The hardware is accessed through system calls, and the
본 발명이 이루고자 하는 기술적 과제는, 하나의 어플리케이션이 기존 운영체제의 커널과 격리되어 수행될 수 있는 가상 환경을 제공하는 것으로 기존의 HAL 레벨 가상화 기법과 같이 별도의 추가적인 게스트(Guest) 운영체제의 필요 없이 가상 환경에서 수행되는 어플리케이션 코드만을 위한 최적화된 커널만을 구축함으로써 기존의 가상화에 비해 획기적으로 적은 오버헤드만으로 어플리케이션을 기존 운영체제의 커널과 격리시켜 수행할 수 있는 가상 환경에서의 어플리케이션의 실행 장치 및 방법을 제공하고자 하는 것이다. The technical problem to be achieved by the present invention is to provide a virtual environment in which one application can be executed in isolation from the kernel of the existing operating system and virtually without the need for an additional guest operating system like the existing HAL level virtualization technique. By providing an optimized kernel only for the application code executed in the environment, it provides a device and method for executing an application in a virtual environment that can be isolated from the kernel of the existing operating system with dramatically less overhead than the existing virtualization. I would like to.
본 발명이 이루고자 하는 다른 기술적 과제는 컨텍스트 스위칭 메커니즘을 이용하여 가상 환경에서 실행되는 어플리케이션과 실제 환경에서 실행되는 어플리케이션간에 전환이 일어나도록 함으로써 오버헤드가 적은 가상 환경에서의 어플리케이션 실행 장치 및 방법을 제공하고자 하는 것이다.Another object of the present invention is to provide an apparatus and method for executing an application in a virtual environment with low overhead by causing a switch between an application running in a virtual environment and an application running in a real environment using a context switching mechanism. It is.
본 발명이 이루고자 하는 또 다른 기술적 과제는 보호하고자 하는 코드 또는 운영체제에 영향을 미치지 않고 실행하고자 하는 코드를 기존 운영체제의 커널과 격리된 가상 환경에서 수행되도록 함으로써, 해킹 툴에 의한 코드의 디버깅 또는 코드 수행에 의한 운영체제 및 시스템의 피해를 방지할 수 있는 가상 환경에서의 어플리케이션 실행 장치 및 방법을 제공하고자 하는 것이다.Another technical problem to be achieved by the present invention is to debug code or to execute code by a hacking tool by allowing a code to be executed to be executed in a virtual environment isolated from the kernel of an existing operating system without affecting the code to be protected or the operating system. It is an object of the present invention to provide an apparatus and a method for executing an application in a virtual environment that can prevent damage to an operating system and a system.
본 발명의 목적들은 이상에서 언급한 목적들로 제한되지 않으며, 언급되지 않은 또 다른 목적들은 아래의 기재로부터 당업자에게 명확하게 이해되어질 수 있 을 것이다.The objects of the present invention are not limited to the above-mentioned objects, and other objects which are not mentioned will be clearly understood by those skilled in the art from the following description.
상기 목적을 달성하기 위하여, 본 발명의 실시예에 따른 가상 환경에서의 어플리케이션 실행 장치는, 가상 환경 구축을 위한 초기화를 수행하는 수단, 가상 환경의 커널 레벨로 전환하는 수단, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 수단, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 수단, 가상 환경 내에서 실행되는 어플리케이션의 CPU 상태 정보인 제 2 CPU 상태 정보를 복원하는 수단, 복원된 제 2 CPU 상태 정보를 이용하여 어플리케이션을 실행하는 수단, 어플리케이션의 실행이 완료되지 않고 중단되는 경우 제 2 CPU 상태 정보를 저장하는 수단, 및 제 2 CPU 상태 정보 저장 단계 수행 후 제 1 CPU 상태 정보를 복원하는 수단을 포함한다. In order to achieve the above object, the application execution apparatus in the virtual environment according to an embodiment of the present invention, means for performing initialization for building a virtual environment, means for switching to the kernel level of the virtual environment, the current CPU state information Means for storing the first CPU state information, means for modifying the contents of the current CPU register to a value generated by performing the initialization step after performing the first CPU state information storing step, and CPU state information of an application running in the virtual environment. Means for restoring the second CPU state information, means for executing the application using the restored second CPU state information, means for storing the second CPU state information if the execution of the application is interrupted without being completed, and the second CPU Means for restoring the first CPU state information after performing the state information storing step.
상기 목적을 달성하기 위하여, 본 발명의 실시예에 따른 가상 환경에서의 어플리케이션 실행 방법은, 가상 환경 구축을 위한 초기화를 수행하는 단계, 가상 환경의 커널 레벨로 전환하는 단계, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계, 가상 환경 내에서 실행되는 어플리케이션의 CPU 상태 정보인 제 2 CPU 상태 정보를 복원하는 단계, 복원된 제 2 CPU 상태 정보를 이용하여 어플리케이션을 실행하는 단계, 어플리케이션의 실행이 완료되지 않고 중단되는 경우 제 2 CPU 상태 정보를 저장하는 단계, 및 제 2 CPU 상태 정보 저장 단계 수행 후 제 1 CPU 상태 정보를 복원하는 단계를 포함한다. In order to achieve the above object, an application execution method in a virtual environment according to an embodiment of the present invention, performing the initialization for the virtual environment, the step of switching to the kernel level of the virtual environment, the current CPU state information Storing the first CPU state information, modifying the contents of the current CPU register to a value generated by performing an initialization step after performing the first CPU state information storing step; CPU state information of an application running in the virtual environment. Restoring the second CPU state information, executing the application using the restored second CPU state information, storing the second CPU state information if the execution of the application is interrupted without being completed, and the second CPU Restoring the first CPU state information after performing the state information storing step.
기타 실시예들의 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다. Specific details of other embodiments are included in the detailed description and the drawings.
상기한 바와 같은 본 발명의 가상 환경에서의 어플리케이션 실행 장치 및 방법에 따르면 다음과 같은 효과가 하나 혹은 그 이상 있다. According to the apparatus and the method for executing an application in the virtual environment of the present invention as described above, there are one or more effects as follows.
첫째, 하나의 어플리케이션이 기존 운영체제의 커널과 격리되어 수행될 수 있는 가상 환경을 제공하는 것으로 기존의 HAL 레벨 가상화 기법과 같이 별도의 추가적인 게스트(Guest) 운영체제의 필요 없이 가상 환경에서 수행되는 어플리케이션 코드만을 위한 최적화된 커널만을 구축함으로써 기존의 가상화에 비해 획기적으로 적은 오버헤드만으로 어플리케이션을 기존 운영체제의 커널과 격리시켜 수행할 수 있다는 장점이 있다. First, it provides a virtual environment in which an application can be executed in isolation from the kernel of the existing operating system. Only the application code executed in the virtual environment without the need of an additional guest operating system like the existing HAL level virtualization technique. By building only the optimized kernel, the application can be isolated from the kernel of the existing operating system with significantly less overhead than the existing virtualization.
둘째, 컨텍스트 스위칭 메커니즘을 이용하여 가상 환경에서 실행되는 어플리케이션과 실제 환경에서 실행되는 어플리케이션간에 전환이 일어나도록 함으로써 오버헤드가 적다는 장점도 있다. Second, there is an advantage that the overhead is reduced by using a context switching mechanism to switch between the application running in the virtual environment and the application running in the real environment.
셋째, 보호하고자 하는 코드 또는 운영체제에 영향을 미치지 않고 실행하고자 하는 코드를 기존 운영체제의 커널과 격리된 가상 환경에서 수행되도록 함으로써, 해킹 툴에 의한 코드의 디버깅 또는 코드 수행에 의한 운영체제 및 시스템의 피해를 방지할 수 있다는 장점도 있다.Third, the code to be executed without affecting the code or operating system to be protected is executed in a virtual environment separate from the kernel of the existing operating system, thereby preventing damage to the operating system and the system by debugging the code or executing the code by the hacking tool. It also has the advantage of being prevented.
본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다 Advantages and features of the present invention and methods for achieving them will be apparent with reference to the embodiments described below in detail with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but can be implemented in various different forms, and only the embodiments make the disclosure of the present invention complete, and the general knowledge in the art to which the present invention belongs. It is provided to fully inform the person having the scope of the invention, which is defined only by the scope of the claims. Like reference numerals refer to like elements throughout.
이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수 있음을 이해할 수 있을 것이다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It will be appreciated that the combination of each block in the accompanying block diagram and each step in the flowchart may be performed by computer program instructions. These computer program instructions may be mounted on a processor of a general purpose computer, special purpose computer, or other programmable data processing equipment such that instructions executed through the processor of the computer or other programmable data processing equipment may not be included in each block or flowchart of the block diagram. It will create means for performing the functions described in each step. These computer program instructions may be stored in a computer usable or computer readable memory that can be directed to a computer or other programmable data processing equipment to implement functionality in a particular manner, and thus the computer usable or computer readable memory. It is also possible for the instructions stored in to produce an article of manufacture containing instruction means for performing the functions described in each block or flowchart of each step of the block diagram. Computer program instructions It can also be mounted on a computer or other programmable data processing equipment, so a series of operating steps are performed on the computer or other programmable data processing equipment to create a computer-implemented process to perform the computer or other programmable data processing equipment. It is also possible for the instructions to provide steps for performing the functions described in each block of the block diagram and in each step of the flowchart.
또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실행예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.In addition, each block or step may represent a portion of a module, segment or code that includes one or more executable instructions for executing a specified logical function (s). It should also be noted that in some alternative implementations, the functions noted in the blocks or steps may occur out of order. For example, the two blocks or steps shown in succession may in fact be executed substantially concurrently or the blocks or steps may sometimes be performed in the reverse order, depending on the functionality involved.
도 3은 본 발명의 일 실시예에 따라 어플리케이션이 실행되는 가상 환경을 구축하는 프로그램을 수행한 경우의 계층 구조를 보여주는 도면이다.3 is a diagram illustrating a hierarchical structure when a program for building a virtual environment in which an application is executed is executed according to an embodiment of the present invention.
가상 환경 구축 어플리케이션을 실행하면 기존의 운영체제(43)와 격리된 가상 환경 커널(44)이 구축되고, 가상 환경 내에서 실행하고자 하는 어플리케이션(41)은 가상 환경 커널로의 시스템 호출을 지원하는 에뮬레이션 API(42)를 통해 운영체제에 시스템 호출을 하게 된다. 이 때 가상 환경 커널은 가상 환경 내에서 실행되는 어플리케이션을 위한 CPU 레지스터 및 메모리에 관한 운영체제 코드를 제외하고는 기존 운영 체제 커널 코드(43)를 그대로 이용할 수 있게 된다. 예를 들어 인터럽트 처리에 있어 기존 운영체제의 인터럽트 처리 코드를 그대로 이용할 수 있다. 가상 환경 커널과 기존 운영체제의 관계 및 가상 환경에서 어플리케이션이 실행되는 메커니즘은 도 4를 참조하여 좀 더 구체적으로 살펴보기로 한다.When the virtual environment building application is executed, the
먼저 가상 환경 내 실행 어플리케이션(61)이 수행되기 위한 가상 환경을 만들기 위해 가상 환경 구축 어플리케이션(52)이 실행되면 이는 기존 운영체제, 즉 도 4의 경우 윈도우 운영체제(54)의 입장에서는 다른 어플리케이션(51)과 동등한 하나의 어플리케이션으로 인식되게 된다. 가상 환경 구축 어플리케이션(52)은 미리 정의해 놓은 가상 환경 커널(62)에 대한 최초 진입 경로를 통해 가상 환경 커널 레벨로 전환하게 된다. 가상 환경 커널(62)에 대한 최초 진입 경로는 여러 가지 형태로 구현될 수 있는데, 예를 들어 호출 게이트(CallGate)가 하나의 구현 형태가 될 수 있다. First, when the virtual
가상 환경 구축 어플리케이션(52)은 호출 게이트에 의해 가상 환경 커널 레벨로 전환한 후 컨텍스트 스위칭 메커니즘에 의하여 기존 운영 체제의 커널(54)과는 격리된 가상 환경 커널(62)을 생성하고 가상 환경 내 실행 어플리케이션(61)이 가상 환경 커널(62)을 통해 하드웨어 자원(55)을 액세스 할 수 있게 한다. The virtual
여기서 컨텍스트 스위칭이란 복수의 프로세스가 하나의 CPU 자원을 공유할 수 있도록 CPU의 상태(컨텍스트)를 저장(storing)하고 복원(restoring)하는 컴퓨팅 프로세스로, 레지스터 컨텍스트 스위치, 태스크 컨텍스트 스위치, 쓰레드 컨텍스트 스위치 또는 프로세스 컨텍스트 스위치 등을 의미할 수 있다. 무엇이 컨텍스트를 구성하는가는 프로세서와 운영체제에 의해 결정된다.Here, context switching is a computing process that stores and restores the state (context) of a CPU so that a plurality of processes can share a single CPU resource, and is a register context switch, a task context switch, a thread context switch, or It can mean a process context switch. What constitutes a context is determined by the processor and operating system.
실제 환경에서 실행되는 어플리케이션(51)과 가상 환경 내 실행 어플리케이션(52)간에 CPU 할당이 전환되는 과정을 좀 더 자세히 살펴보면 다음과 같다. 멀티태스킹 환경 하에서 어플리케이션(51)과 가상 환경 구축 어플리케이션(52)은 컨텍스트 스위칭 메커니즘에 의해 CPU를 할당받을 수 있다. 가상 환경 구축 어플리케이션(52)이 CPU를 할당받게 되면 가상 환경 구축 어플리케이션(52)은 자신의 CPU 컨텍스트를 저장하고 가상 환경 내 실행 어플리케이션(61)의 CPU 컨텍스트를 복원함으로써 어플리케이션을 기존 운영 체제와는 격리된 가상 환경에서 실행할 수 있게 된다. 그러나, 그 외에는 기존 운영 체제의 커널 코드, 예를 들어 인터럽트 처리 코드 등을 그대로 사용할 수 있게 된다.Looking at the process of the CPU allocation is switched between the
도5는 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 장치의 구성을 나타내는 블록도이다.5 is a block diagram illustrating a configuration of an application execution apparatus in a virtual environment according to an embodiment of the present invention.
가상 환경에서의 어플리케이션 실행 장치(70)는 크게 초기화부(71), 작업 관리자(72), 가상 환경 전환부(73), 어플리케이션 실행부(74) 및 실제 환경 복원부(75)로 구성된다.The
초기화부(71)는 가상 환경 커널 레벨로의 최초 진입 경로를 정의하는 호출 게이트를 구성하고 가상 환경을 위한 초기화 작업을 수행한다. 가상 환경을 위한 초기화 작업은 CPU 레지스터 값을 초기화하고 메모리를 할당하는 작업을 포함한다.The
작업 관리자(72)는 외부로부터 가상 환경 내 실행 어플리케이션(61)의 실행 에 관한 지시를 입력 받고 그 지시에 따라 가상 환경의 사용자 레벨에서 어플리케이션(61)의 동작을 관리한다. 지시는 가상 환경 내 실행 어플리케이션(61)의 실행을 잠시 멈추거나, 잠시 멈춘 어플리케이션의 실행을 재개하거나, 현재 시점의 메모리의 내용을 출력 또는 하드 디스크에 저장하거나, 어플리케이션의 실행을 종료하는 등의 명령이 될 수 있을 것이다.The
가상 환경 전환부(73)는 초기화부에 의해 구성된 호출 게이트에 의해 가상 커널 레벨로 진입하여 기존 운영체제의 사용자 레벨에서 최근까지 실행되었던 CPU의 레지스트리 정보, 즉 현재 실제 환경의 CPU 컨텍스트 정보를 저장한다. 그리고 이후 시스템 퀀텀 타임 아웃(Quantum Time Out)으로 다른 어플리케이션(51)이 수행된 후 가상 환경 구축 어플리케이션(52)이 다시 CPU를 할당받을 때 사용자 레벨의 코드 실행 전 가상 환경 내 실행 어플리케이션의 CPU 컨텍스트를 저장하고 실제 환경의 CPU 컨텍스트, 즉 가상 환경 구축 어플리케이션(52)의 CPU 컨텍스트를 복원하는 단계가 수행될 수 있도록 해당 코드를 APC(Asynchronous Procedure Call)로 등록한다. The virtual
본 실시예에서는 실제 환경에서 실행되는 어플리케이션으로부터 가상 환경 내 실행 어플리케이션으로의 전환 방법을 APC 등록에 의한 컨텍스트 스위칭 기법을 위주로 설명하였지만 이는 일 실시예에 불과하므로 본 발명의 권리범위는 이에 한정되지 않는다. 본 발명의 권리범위는 가상 환경 구축 어플리케이션(52)이 다시 CPU 타임을 할당받았을 때 기존의 운영체제 입장에서는 인식할 수 없는 가상 환경 내 실행 어플리케이션(61)의 CPU 컨텍스트를 일정한 곳에 저장해놓음으로써 다시 가상 환경으로 전환했을 때 가상 환경 내에서 실행되었던 어플리케이션(61)을 연속하여 실행할 수 있도록 하는 모든 구현 방법을 포함하는 것으로 해석되어야 할 것이다.In the present embodiment, a method of switching from an application executed in a real environment to an executed application in a virtual environment has been described based on a context switching technique by APC registration. However, the scope of the present invention is not limited thereto. According to the scope of the present invention, when the virtual
가상 환경 전환부(73)는 APC 등록 단계 수행 후 CPU 시스템 레지스터의 값을 가상 환경을 위한 값으로 수정한다. 즉, 구축하고자 하는 가상 환경에 맞춰 CR3 레지스터 및 IDT(Interrupt Description Table) 레지스터 등의 값을 변경하는 것이다. 그리고 가상 환경 내에서 실행되는 어플리케이션의 CPU 컨텍스트를 복원함으로써 어플리케이션이 실행되는 가상 환경으로의 전환을 완료한다.The virtual
어플리케이션 실행부(74)는 가상 환경 전환부(73)에 의해 마련된 가상 환경에서 어플리케이션(61)이 가상 환경 커널을 통해 CPU 자원에 액세스 할 수 있도록 함으로써 기존 운영 체제와 격리된 환경에서 어플리케이션이 실행될 수 있도록 한다. 어플리케이션 실행부(74)는 작업 관리자(72)의 제어에 의해 어플리케이션을 실행하게 된다.The
실제 환경 복원부(75)는 가상 환경 구축 어플리케이션(52)이 새로이 CPU 자원을 할당받게 되면 가상 환경 전환부(73)에 의해 APC로 등록된 코드를 수행하여 가상 환경 구축 어플리케이션(52)이 실행되던 실제 환경을 복원한다. 즉, 가상 환경 내에서 실행되었던 어플리케이션의 CPU 컨텍스트 정보를 저장하고 실제 환경의 CPU 컨텍스트 정보를 복원함으로써 가상 환경 구축 어플리케이션의 실행을 재개하고 가상 환경 커널 레벨로 전환될 수 있도록 하는 것이다. 한편, 실제 환경 복원부(75)는 퀀텀 타임 동안 가상 환경 내 실행 어플리케이션의 수행이 완료되면 실제 환경의 CPU 컨텍스트 정보를 복원함으로써 가상 환경 구축 어플리케이션의 실행을 재개하고 가상 환경 커널 레벨로 전환될 수 있도록 한다.When the virtual
지금까지 도 5의 각 구성요소는 소프트웨어(software) 또는, FPGA(field-programmable gate array)나 ASIC(application-specific integrated circuit)과 같은 하드웨어(hardware)를 의미할 수 있다. 그렇지만 상기 구성요소들은 소프트웨어 또는 하드웨어에 한정되는 의미는 아니며, 어드레싱(addressing)할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 실행시키도록 구성될 수도 있다. 상기 구성요소들 안에서 제공되는 기능은 더 세분화된 구성요소에 의하여 구현될 수 있으며, 복수의 구성요소들을 합하여 특정한 기능을 수행하는 것으로 구현할 수도 있다. 뿐만 아니라, 상기 구성요소들은 시스템 내의 하나 또는 그 이상의 컴퓨터들을 실행시키도록 구현될 수 있다.Until now, each component of FIG. 5 may refer to software or hardware such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). However, the components are not limited to software or hardware, and may be configured to be in an addressable storage medium and may be configured to execute one or more processors. The functions provided in the above components may be implemented by more detailed components, or may be implemented by combining a plurality of components to perform a specific function. In addition, the components may be implemented to execute one or more computers in a system.
도 6은 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 방법을 보여주는 흐름도이다.6 is a flowchart illustrating a method of executing an application in a virtual environment according to an embodiment of the present invention.
가상 환경 구축 어플리케이션(52)은 가상 환경 커널 레벨로의 진입을 위한 호출 게이트를 생성하고(S1) 가상 환경 구축을 위한 초기화를 수행한다(S2). 가상 환경 구축 초기화 단계에서는 가상 환경에서 사용될 CPU 레지스터 값들이 초기화되고 메모리의 할당 및 초기화가 이루어진다. 가상 환경 커널 레벨로 전환하기 전 외부로부터 가상 환경 내 실행 어플리케이션의 실행에 관한 지시를 입력받는다(S3). 가상 환경 내 실행 어플리케이션(61)의 실행에 관한 지시는 도 5에서 상술한 바와 같이 어플리케이션의 실행을 잠시 멈춤, 어플리케이션을 수행하는 동안 특정 시점 의 램의 내용을 프린트하거나 기록매체에 복사는 덤프, 잠시 멈추었던 어플리케이션의 실행을 재개, 어플리케이션의 실행을 종료하는 등의 명령을 포함한다. 가상 환경 구축 어플리케이션은 S1 단계에서 생성한 호출 게이트를 통하여 사용자 레벨에서 가상 환경 커널 레벨로 전환하게 된다(S4).The virtual
가상 환경 커널 레벨에서는 기존 운영 체제의 사용자 레벨에서 마지막까지 실행되었던 CPU 컨텍스트 정보를 저장하고(S5), 다음 번 스케줄링시 가상 환경 내 실행 어플리케이션의 CPU 컨텍스트 정보를 보존하고 기존 실제 환경의 CPU 컨텍스트 정보를 복원하기 위한 APC를 등록한다(S6). 이 후, 가상 환경 전환부(73)는 현재 CPU의 시스템 레지스터와 일반 레지스터(General register)들의 값을S2 단계에서 가상 환경에서 사용되도록 하기 위해 초기화된 값으로 변경(S7)함으로써 CPU를 현재의 운영체제와 분리 시키게 된다(S9). At the virtual environment kernel level, the CPU context information that was executed at the user level of the existing operating system to the last is stored (S5), and the CPU context information of the running application in the virtual environment is preserved at the next scheduling and the CPU context information of the existing physical environment is stored. The APC for restoring is registered (S6). Thereafter, the virtual
가상 환경 사용자 레벨에서의 어플리케이션의 실행이 시스템 퀀텀 타임의 종료로(S10의 '아니오') CPU가 실제 환경의 어플리케이션에 할당된 후 다음 번에 가상 환경 구축 어플리케이션으로의 컨텍스트 스위칭이 일어날 때, S6에서 APC로 등록된 코드의 수행에 의해 가상 환경 내에서 실행되었던 어플리케이션의 CPU 컨텍스트 정보를 저장하고(S12) 기존 실제 환경의 사용자 레벨에서 최종적으로 실행되었던 어플리케이션의 레지스터들에 대하여 해당 프로세스의 트랩 프레임(Trap Frame)을 수정해줌으로써 컨텍스트 스위칭 단계에서 다시 실제 환경으로의 실행이 가능하도록 만들어 준다(S13).When the execution of the application at the virtual environment user level is the end of the system quantum time (No in S10), the next time the context switch to the virtual environment building application occurs after the CPU is allocated to the application in the real environment, in S6 By executing the code registered with the APC, the CPU context information of the application executed in the virtual environment is stored (S12), and the trap frame of the corresponding process is applied to the registers of the application that was finally executed at the user level of the existing real environment. By modifying the frame), execution is made possible again in the actual environment in the context switching step (S13).
반면, 시스템 퀀텀 타임이 끝나기 전에 가상 환경 내에서의 어플리케이 션(61)의 실행이 완료되면(S10의 '예') 가상 환경 사용자 레벨에서의 어플리케이션 실행 전 실제환경의 사용자 레벨에서 최종적으로 실행되었던 CPU 컨텍스트 정보를 복원하고(S11) 외부로부터의 지시를 입력받은 후(S3) 호출 게이트를 통해 다시 가상 환경 커널 레벨로 전환하게 된다(S4).On the other hand, if the execution of the
이상 첨부된 도면을 참조하여 본 발명의 실시예를 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. Although embodiments of the present invention have been described above with reference to the accompanying drawings, those skilled in the art to which the present invention pertains may implement the present invention in other specific forms without changing the technical spirit or essential features thereof. I can understand that. Therefore, it should be understood that the embodiments described above are exemplary in all respects and not restrictive.
도 1은 통상적인 컴퓨터에서의 어플리케이션 실행의 계층도이다. 1 is a hierarchical diagram of application execution on a typical computer.
도 2는 종래의 하드웨어 추상화 계층(HAL:Hardware Abstraction Layer) 에서의 가상화 개념을 보여주는 도면이다.FIG. 2 is a diagram illustrating a virtualization concept in a conventional hardware abstraction layer (HAL).
도 3은 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 프로그램의 계층도이다. 3 is a hierarchical diagram of an application execution program in a virtual environment according to an embodiment of the present invention.
도 4는 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 메커니즘을 보여주는 도면이다.4 illustrates an application execution mechanism in a virtual environment according to an embodiment of the present invention.
도5는 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 장치의 구성을 나타내는 블록도이다.5 is a block diagram illustrating a configuration of an application execution apparatus in a virtual environment according to an embodiment of the present invention.
도 6은 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 방법을 보여주는 흐름도이다.6 is a flowchart illustrating a method of executing an application in a virtual environment according to an embodiment of the present invention.
<도면의 주요 부분에 관한 부호의 설명> <Explanation of symbols on main parts of the drawings>
70 : 가상 환경 내 어플리케이션 실행 장치 71: 초기화부70: application execution device in the virtual environment 71: initialization unit
72: 작업 관리자 73: 가상 환경 전환부72: Task Manager 73: Virtual Environment Switcher
74: 어플리케이션 실행부 75: 실제 환경 복원부74: application execution unit 75: real environment restore unit
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070091659A KR100928866B1 (en) | 2007-09-10 | 2007-09-10 | Apparatus and method for running an application in a virtual environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070091659A KR100928866B1 (en) | 2007-09-10 | 2007-09-10 | Apparatus and method for running an application in a virtual environment |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20090026579A KR20090026579A (en) | 2009-03-13 |
KR100928866B1 true KR100928866B1 (en) | 2009-11-30 |
Family
ID=40694497
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020070091659A KR100928866B1 (en) | 2007-09-10 | 2007-09-10 | Apparatus and method for running an application in a virtual environment |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100928866B1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101868386B1 (en) * | 2011-12-13 | 2018-06-19 | 삼성전자주식회사 | Method for providing application and Display apparatus, and server |
US9396041B2 (en) * | 2012-02-01 | 2016-07-19 | Google Technology Holdings LLC | Optimization of resource usage in a multi-environment computing system |
KR102032521B1 (en) * | 2018-12-26 | 2019-10-15 | 래블업(주) | Method and system for GPU virtualization based on container |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000069891A (en) * | 1997-01-07 | 2000-11-25 | 사이트릭스 시스템스, 인크. | Object and method for providing efficient multi-user access to shared operating system kernal code using instancing |
KR20070083569A (en) * | 2004-08-18 | 2007-08-24 | 쟈루나 에스에이 | Operating systems |
-
2007
- 2007-09-10 KR KR1020070091659A patent/KR100928866B1/en active IP Right Grant
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000069891A (en) * | 1997-01-07 | 2000-11-25 | 사이트릭스 시스템스, 인크. | Object and method for providing efficient multi-user access to shared operating system kernal code using instancing |
KR20070083569A (en) * | 2004-08-18 | 2007-08-24 | 쟈루나 에스에이 | Operating systems |
Also Published As
Publication number | Publication date |
---|---|
KR20090026579A (en) | 2009-03-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9870324B2 (en) | Isolating guest code and data using multiple nested page tables | |
JP4291301B2 (en) | Supporting migration to a single virtual machine monitor based on guest software privilege level | |
US7421533B2 (en) | Method to manage memory in a platform with virtual machines | |
US10255090B2 (en) | Hypervisor context switching using a redirection exception vector in processors having more than two hierarchical privilege levels | |
US8370832B2 (en) | Method and system for virtual machine migration | |
US9430642B2 (en) | Providing virtual secure mode with different virtual trust levels each having separate memory access protections, interrupt subsystems and private processor states | |
US10169075B2 (en) | Method for processing interrupt by virtualization platform, and related device | |
CN104598294B (en) | Efficient and safe virtualization method for mobile equipment and equipment thereof | |
US9176763B2 (en) | Apparatus and method thereof for efficient execution of a guest in a virtualized environment | |
US10019275B2 (en) | Hypervisor context switching using a trampoline scheme in processors having more than two hierarchical privilege levels | |
US9740519B2 (en) | Cross hypervisor migration of virtual machines with VM functions | |
US20210389966A1 (en) | Micro kernel based extensible hypervisor and embedded system | |
US20160034300A1 (en) | Information processing devicing and method | |
US10120738B2 (en) | Hypervisor techniques for performing non-faulting reads in virtual machines | |
US10452420B1 (en) | Virtualization extension modules | |
US20140143372A1 (en) | System and method of constructing a memory-based interconnect between multiple partitions | |
WO2016164424A1 (en) | Isolating guest code and data using multiple nested page tables | |
EP3356983B1 (en) | Multi-tenant environment using pre-readied trust boundary components | |
KR100928866B1 (en) | Apparatus and method for running an application in a virtual environment | |
KR100939210B1 (en) | Apparatus and method for prevention an debugging in a virtual environment | |
US20140026132A1 (en) | Method and System for Emulation of Instructions and Hardware Using Background Guest Mode Processing | |
Suzuki et al. | Analysis of the ARM architecture’s ability to support a virtual machine monitor through a simple implementation | |
US11550609B2 (en) | Unified hypercall interface across processors in virtualized computing systems | |
CN113268726B (en) | Method for monitoring program code execution behavior and computer equipment | |
US20230195470A1 (en) | Behavioral implementation of a double fault stack in a computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20121220 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20131120 Year of fee payment: 5 |
|
FPAY | Annual fee payment |
Payment date: 20141120 Year of fee payment: 6 |
|
FPAY | Annual fee payment |
Payment date: 20151120 Year of fee payment: 7 |
|
FPAY | Annual fee payment |
Payment date: 20161121 Year of fee payment: 8 |
|
FPAY | Annual fee payment |
Payment date: 20171120 Year of fee payment: 9 |
|
FPAY | Annual fee payment |
Payment date: 20181120 Year of fee payment: 10 |
|
FPAY | Annual fee payment |
Payment date: 20191120 Year of fee payment: 11 |