CN102096598A - Virtual machine system and implementing method thereof - Google Patents

Virtual machine system and implementing method thereof Download PDF

Info

Publication number
CN102096598A
CN102096598A CN2010106138182A CN201010613818A CN102096598A CN 102096598 A CN102096598 A CN 102096598A CN 2010106138182 A CN2010106138182 A CN 2010106138182A CN 201010613818 A CN201010613818 A CN 201010613818A CN 102096598 A CN102096598 A CN 102096598A
Authority
CN
China
Prior art keywords
virtual machine
kaffe
message
task
bytecode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2010106138182A
Other languages
Chinese (zh)
Inventor
彭国标
付少云
宋宝云
邓义宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GUANGZHOU JUHUI ELECTRONIC TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU JUHUI ELECTRONIC TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GUANGZHOU JUHUI ELECTRONIC TECHNOLOGY Co Ltd filed Critical GUANGZHOU JUHUI ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN2010106138182A priority Critical patent/CN102096598A/en
Publication of CN102096598A publication Critical patent/CN102096598A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a kaffe virtual machine system and an implementing method thereof. The system is positioned in a sub-middleware layer of a set-top box. The system consists of a plurality of independent subsystems, namely a class manager, a byte code verifier, a kaffe virtual machine execution engine, a system call subsystem, a storage management subsystem and a local method interface subsystem, wherein the class manager takes charge in loading classes, initializing the classes and the like; the byte code verifier ensures the correctness of a class file format; and the kaffe virtual machine execution engine comprises an interpreter and a just-time compiler. The kaffe virtual machine system has an OpenSource characteristic, a small kernel and high portability, and supports the application of an embedded system in a Linux/million instructions per second (MipS) system.

Description

A kind of dummy machine system and its implementation
Technical field
The present invention relates to digital TV set-top box middleware Technology field, be specifically related to a kind of implementation method of kaffe dummy machine system.
Background technology
Middleware is a class software that is between application software and the system software, and middleware can shield the complicacy of underlying operating system, makes the program development personnel in the face of a simple and unified development environment, reduces the complicacy of program design.Reduced the repeated embryo transfer work of program between the different system environment at technical elements.Java Virtual Machine is the part of set-top box middleware core, and application programming interfaces upwards are provided, downwards accessing operation system and hardware.Under this specific Embedded Application background, transplant requirement and restriction that Java Virtual Machine will be considered software and hardware resources, at first be hardware, this is wherein topmost to be again CPU core, what we used is the MIPS5231 kernel of QED company.Also have memory size, need to select to occupy the less JVM in space.Software is mainly considered operating system, provides built-in Linux, also will consider the degree of support to the upper layer application exploitation, as supporting AWT etc.From technical standpoint, can consider that at present the embedded Java virtual machine of selecting has two kinds, one is the Persnal Basis Profile (PBP) in the J2ME system of Sun Microsystems, another is the Kaffe of TransVitual company.For the MIPS target platform, if adopt PBP, need do a lot of transplanting work at processor, may also can relate to the problem of bottom MIPS instruction set or corresponding compilation and hardware interrupts, more complicated can't guarantee transplantation effect like this.
Summary of the invention
The invention provides a kind of kaffe dummy machine system and its implementation, this system can have improvement greatly at aspects such as transplantability, retractility and high-level efficiency, can be used in more demand occasions.
A kind of kaffe dummy machine system provided by the invention comprises:
The class manager is used for loading classes and to the initialization of class;
The bytecode validator is used to verify bytecode, guarantees the correctness of class file format;
The Kaffe virtual machine is carried out engine, comprises interpreter and just-time compiler, and compiler is used for bytecode compile cost ground machine code, and interpreter is used for that the bytecode through compiling is construed to instruction to be carried out;
The system call subsystem, the system call that is used to call local core library;
The thread subsystem is used for management thread and creates, deletes;
Storage management subsystem is used for garbage reclamation, new object/class/data allocations;
The native method interface subsystem is used for the various interface support.
According to a further aspect in the invention, the present invention also provides a kind of implementation method of kaffe virtual machine, comprises the steps:
(1) default value of acquisition virtual machine environment parameter;
(2) processing command capable in the parameter that is provided with of user;
(3) carry out initialization, storage allocation for virtual machine;
(4) the main classes name that provides in order line according to the user is sought main classes, it is loaded, again to the link and the initialization of load classes;
(5) again the bytecode of compiling the principal function method behind the pool is explained one by one.
Further, the kaffe virtual machine adopts the 0S20 real time operating system, and the size that the operation of task is based on priority in 0S20 is shared resource; The task that priority level is different adopts the mode of seizing to dispatch by the scheduling kernel, and the task that priority level is identical then adopts the mode of round-robin to dispatch.
Further, by Semaphore Mechanism control multitask between the visit of a shared resource and the task synchronously, utilize message queue as a kind of data communication mode between task, a message queue has the certain amount of message buffer zone in 0S20.
Further, described message queue separated into two parts, a part is current otiose message buffer-idle queues; Another part is that message has been sent but also do not had received message buffer-transmit queue, a buffer zone or be empty, carrying message does not also discharge, just circulating between these two formations in all message buffers, makes the total system trouble-free operation by semaphore and message queue.
From technique scheme as can be seen, because the embodiment of the invention is positioned at the set-top box middleware layer of hierarchical design, application program and the bottom layer driving that depends on hardware are separated, made application program have better transplantability, the upgrading of software provides convenience for future.Kaffe has the relevant local library of the platform of oneself, is taken up space and is easy to and transplant by reducing system, and Mu Diku both can be configured to also to can be configured to dynamically static state.Part is realized in this locality that the corresponding Java standard of these libraries class libraries is relevant with system, as I/O operation, mathematical function, figure support, network support etc.And this system's employing modularized program designs, kernel is little, be easy to cutting, thereby has guaranteed its scalability and high-level efficiency, applicable to multi-platform.
Description of drawings
Accompanying drawing 1 is based on the middleware implementation of set-top box;
Accompanying drawing 2 is architectures of Kaffe virtual machine;
Accompanying drawing 3 is Kaffe virtual machine program flowchart.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.
The embodiment of the invention provides a kind of implementation method of kaffe dummy machine system, there is the relevant local library of the platform of oneself in this system, part is realized in this locality that the corresponding Java standard of these libraries class libraries is relevant with system, as I/O operation, mathematical function, figure support, network support etc.This system's employing modularized program designs, kernel is little, be easy to cutting, and scalability and high-level efficiency are good, applicable to multi-platform.Below be elaborated respectively.
Based on the middleware implementation of set-top box as shown in Figure 1, it is divided into four levels: operating system layer, hardware driving layer, middleware layer and application layer.Operating system layer adopts real-time multi-task operating system; The bottom layer driving layer mainly provides the driver of operating system inside and each hardware device; Application layer comprises the application of this machine storage and downloads; Middleware is separated application program and the bottom layer driving that depends on hardware, makes application program have better transplantability, and the upgrading of software provides convenience for future.
From bottom to top each layer carried out brief introduction:
The hardware driving layer: this layer is the hardware environment of set-top box, and the driver of each hardware device is realized control to hardware by the read-write to the hardware device register.Audio/video decoding driving, demultiplexing and tables of data extraction, Tuner tune drive, storage drive, condition receive driving and screen display driving etc. and all realize at this one deck.The device driver hardware equipment is for individual abridged table and JavalTVAPI provide support.
Operating system layer: this layer comprises the 0S20 real-time oss device driver of unifying.The 0S20 that this programme adopted is a kind of high efficiency real-time multi-task operating system, be applicable to all ST20 series processors, task management, memory management, message queue service, semaphore service, clock and functions such as timer management, interrupt management are provided.0S20 is that the virtual machine of Java platform (CDC) and the operation of class libraries provide system-level support.
Middleware layer: middleware system has characteristics such as stability, opening, interactivity, upgradability, make that the exploitation of application program can be based on the unified interface that is provided by middleware, application software engineering teacher can understand the concrete structure of hardware platform, not only make hardware and software development parallel, shorten the construction cycle, also improved the portability of application software on different hardware platforms and operating system greatly.This layer comprises Java platform (CDC) and java application standard interface, and it provides complete Java environment for the operation of java application.Wherein the java application standard interface comprises individual abridged table and JavaTVApl.
Application layer: application layer is one of major part of software development, is positioned at the superiors of software configuration, is the DLL (dynamic link library) of graphic presentation with user interface.The abundant Java application software of standard interface exploitation that this layer utilizes the middle layer to provide provides interactive TV program to the user.
Based on the consideration of system's portability and scalability aspect, the Kaffe virtual machine adopts modular program design.As shown in Figure 2: it is made up of a plurality of independent subsystem:
(1) class manager is responsible for loading classes and to the initialization of class etc.;
(2) bytecode validator is verified bytecode, guarantees the correctness of class file format;
(3) Kaffe virtual machine execution engine comprises interpreter and just-time compiler, and just-time compiler is responsible for elder generation using bytecode compile cost ground machine code, and interpreter is responsible for a ground is carried out being construed to instruct through the bytecode that compiles.Carry out local machine code, can reduce the workload of translation,, raise the efficiency so that abdicate CPu time program logic;
(4) system call subsystem, the system call of calling local core library;
(5) thread subsystem, management thread establishment, deletion etc.;
6) storage management subsystem is responsible for garbage reclamation, new object/class/data allocations etc.;
(7) native method interface subsystem is responsible for the various interface support, supports native language support etc. as JUI.
Kaffe has the relevant local library of the platform of oneself, is taken up space and is easy to and transplant by reducing system, and local library both can be configured to also to can be configured to dynamically static state.Part is realized in this locality that the corresponding Java standard of these libraries class libraries is relevant with system, as I/O operation, mathematical function, figure support, network support etc.The Kaffe virtual machine realizes that with the C language all from the main function, Kaffe is no exception in the execution of any C programmer.
The program flow diagram of main function when accompanying drawing 3 is the kaffe operation comprises: comprise the steps: that (1) obtains the default value of virtual machine environment parameter; (2) processing command capable in the parameter that is provided with of user; (3) carry out initialization, storage allocation for virtual machine; (4) the main classes name that provides in order line according to the user is sought main classes, it is loaded, again to the link and the initialization of load classes; (5) again the bytecode of compiling the principal function method behind the pool is explained one by one.
It also is the flowchart of whole virtual machine, and the specific procedure implementation is as follows:
1. at first obtain the default value of virtual machine environment parameter, the function that obtains this default value is by function JNI_GetDefaultJavaVMInitArgs (﹠amp; Vmargs) realize that this function can copy structure Kaffe_JavaVMInitArgs among the vmargs to.
2. processing command capable in the parameter that is provided with of user, this function is by function static int options (char *Argv) finish.This function parameters is main (argc, the argy) argv in, the just part of Kaffe back during the utility command row.Its rreturn value is a shaping amount, represents the parameter amount that this function is handled.
3. carry out initialization, storage allocation for virtual machine.This function is passed through call function jintJNI_CreateJavaVM (JavaVM in the main function *Vm, JNIEnv *Env, JavaVMInitArgs *Args) realize.Parameter vmags is by the virtual machine parameter sets of initialize in this function, and this function will point to JVM after the generation work of finishing virtual machine pointer leaves among the vm.The work that virtual machine generates mainly is the application internal memory, then parameter is wherein carried out default setting.
4. the main classes name that provides in order line according to the user is sought main classes and with its loading, link, initialization.
This is the emphasis of whole virtual machine implementation.In the main function, realize by calling FindClass ().After finding class, call LoadClass () function and come load classes, call ProcessClass () again and finish the link and the initialization of load classes.After loading, link, initialization are all finished, again the bytecode of compiling the main method behind the pool is explained one by one.
Task (Task) is the main ingredient of real time operating system, the control thread that task is exactly an independent operating, as long as storage space allows, an application program can be divided into any a plurality of task.This kaffe dummy machine system adopts the 0S20 real time operating system, and the size that the operation of task is based on priority in 0S20 is shared resource.The task that priority level is different adopts the mode of seizing to dispatch by the scheduling kernel, and the task that priority level is identical then adopts the mode of round-robin to dispatch.The 0S20 kernel has used the dispatching algorithm of a multitask, guarantees that the task of current operation has the highest priority.
By semaphore (Semaphore) mechanism control multitask between the visit of a shared resource and the task synchronously.Utilize message queue (MessageQueue) as a kind of data communication mode between task.A message queue has certain amount of message buffer zone (the number size determines) when initialization in 0S20.Whole formation separated into two parts, a part are current otiose message buffer-idle queues; Another part is that message has been sent but also do not had received message buffer-transmit queue.A buffer zone or be empty, otherwise carrying message does not also discharge, and just circulate between these two formations in all message buffers.Make the total system trouble-free operation by semaphore and message queue.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, storage medium can comprise: ROM (read-only memory) (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
More than the implementation method of a kind of kaffe dummy machine system that the embodiment of the invention provided is described in detail, for one of ordinary skill in the art, according to thought of the present invention, part in specific embodiments and applications all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (5)

1. a kaffe dummy machine system is characterized in that, comprising:
The class manager is used for loading classes and to the initialization of class;
The bytecode validator is used to verify bytecode, guarantees the correctness of class file format;
The Kaffe virtual machine is carried out engine, comprises interpreter and just-time compiler, and compiler is used for bytecode compile cost ground machine code, and interpreter is used for that the bytecode through compiling is construed to instruction to be carried out;
The system call subsystem, the system call that is used to call local core library;
The thread subsystem is used for management thread and creates, deletes;
Storage management subsystem is used for garbage reclamation, new object/class/data allocations;
The native method interface subsystem is used for the various interface support.
2. the implementation method of a kaffe virtual machine is characterized in that, comprises the steps:
(1) default value of acquisition virtual machine environment parameter;
(2) processing command capable in the parameter that is provided with of user;
(3) carry out initialization, storage allocation for virtual machine;
(4) the main classes name that provides in order line according to the user is sought main classes, it is loaded, again to the link and the initialization of load classes;
(5) again the bytecode of compiling the principal function method behind the pool is explained one by one.
3. method according to claim 2 is characterized in that: the kaffe virtual machine adopts the 0S20 real time operating system, and the size that the operation of task is based on priority in 0S20 is shared resource; The task that priority level is different adopts the mode of seizing to dispatch by the scheduling kernel, and the task that priority level is identical then adopts the mode of round-robin to dispatch.
4. method according to claim 3, it is characterized in that: by Semaphore Mechanism control multitask between the visit of a shared resource and the task synchronously, utilize message queue as a kind of data communication mode between task, a message queue has the certain amount of message buffer zone in 0S20.
5. method according to claim 4 is characterized in that: described message queue separated into two parts, a part are current otiose message buffer-idle queues; Another part is that message has been sent but also do not had received message buffer-transmit queue, a buffer zone or be empty, carrying message does not also discharge, just circulating between these two formations in all message buffers, makes the total system trouble-free operation by semaphore and message queue.
CN2010106138182A 2010-12-30 2010-12-30 Virtual machine system and implementing method thereof Pending CN102096598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106138182A CN102096598A (en) 2010-12-30 2010-12-30 Virtual machine system and implementing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106138182A CN102096598A (en) 2010-12-30 2010-12-30 Virtual machine system and implementing method thereof

Publications (1)

Publication Number Publication Date
CN102096598A true CN102096598A (en) 2011-06-15

Family

ID=44129705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106138182A Pending CN102096598A (en) 2010-12-30 2010-12-30 Virtual machine system and implementing method thereof

Country Status (1)

Country Link
CN (1) CN102096598A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324491A (en) * 2012-03-20 2013-09-25 腾讯科技(深圳)有限公司 Method and device for loading data
CN103530171A (en) * 2013-10-25 2014-01-22 大唐微电子技术有限公司 Smart card virtual machine and implementation method thereof
CN103765379A (en) * 2011-08-30 2014-04-30 微软公司 Cloud-based build service
CN104025074A (en) * 2011-12-30 2014-09-03 英特尔公司 Platform independent isa emulator as middleware
CN105630534A (en) * 2015-04-27 2016-06-01 宇龙计算机通信科技(深圳)有限公司 TrustZone framework-based application program execution method and device as well as terminal
CN107656726A (en) * 2017-10-10 2018-02-02 北京元比特科技有限责任公司 A kind of internet information and Techno-sharing platform and method
CN108170758A (en) * 2017-12-22 2018-06-15 福建天泉教育科技有限公司 High concurrent date storage method and computer readable storage medium
CN112114844A (en) * 2020-08-04 2020-12-22 中国电力科学研究院有限公司 Virtual machine-based electric energy meter special system
CN112905472A (en) * 2021-03-04 2021-06-04 黑芝麻智能科技(上海)有限公司 Kernel debugging system and method
CN117176963A (en) * 2023-11-02 2023-12-05 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593127A (en) * 2008-05-27 2009-12-02 商埃曲网络软件(上海)有限公司 A kind of cross-platform Jave virtual machine of Digital Television middleware system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593127A (en) * 2008-05-27 2009-12-02 商埃曲网络软件(上海)有限公司 A kind of cross-platform Jave virtual machine of Digital Television middleware system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘俊等: "Java虚拟机应用于数字电视机顶盒的研究与实现", 《中国有线电视》 *
夏兵等: "Java虚拟机的研究与实现", 《计算机与信息技术》 *
王瑞胡: "STLite/OS20嵌入式实时操作系统原理及其应用", 《中国有线电视》 *
黄浩等: "基于ST20嵌入式系统的Java虚拟机研究与移植", 《微计算机信息》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10078536B2 (en) 2011-08-30 2018-09-18 Microsoft Technology Licensing, Llc Cloud-based build service
CN103765379A (en) * 2011-08-30 2014-04-30 微软公司 Cloud-based build service
CN103765379B (en) * 2011-08-30 2017-10-17 微软技术许可有限责任公司 Structure service based on cloud
CN104025074A (en) * 2011-12-30 2014-09-03 英特尔公司 Platform independent isa emulator as middleware
CN103324491A (en) * 2012-03-20 2013-09-25 腾讯科技(深圳)有限公司 Method and device for loading data
CN103530171A (en) * 2013-10-25 2014-01-22 大唐微电子技术有限公司 Smart card virtual machine and implementation method thereof
CN105630534A (en) * 2015-04-27 2016-06-01 宇龙计算机通信科技(深圳)有限公司 TrustZone framework-based application program execution method and device as well as terminal
CN107656726A (en) * 2017-10-10 2018-02-02 北京元比特科技有限责任公司 A kind of internet information and Techno-sharing platform and method
CN108170758A (en) * 2017-12-22 2018-06-15 福建天泉教育科技有限公司 High concurrent date storage method and computer readable storage medium
CN112114844A (en) * 2020-08-04 2020-12-22 中国电力科学研究院有限公司 Virtual machine-based electric energy meter special system
CN112905472A (en) * 2021-03-04 2021-06-04 黑芝麻智能科技(上海)有限公司 Kernel debugging system and method
CN112905472B (en) * 2021-03-04 2024-08-13 黑芝麻智能科技(上海)有限公司 Kernel debugging system and method
CN117176963A (en) * 2023-11-02 2023-12-05 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium
CN117176963B (en) * 2023-11-02 2024-01-23 摩尔线程智能科技(北京)有限责任公司 Virtualized video encoding and decoding system and method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102096598A (en) Virtual machine system and implementing method thereof
US9354944B2 (en) Mapping processing logic having data-parallel threads across processors
US7203941B2 (en) Associating a native resource with an application
US9658890B2 (en) Runtime agnostic representation of user code for execution with selected execution runtime
US10592218B2 (en) Dynamic data and compute resource elasticity
US8719839B2 (en) Two way communication support for heterogenous processors of a computer platform
US10585653B2 (en) Declarative programming model with a native programming language
US8972699B2 (en) Multicore interface with dynamic task management capability and task loading and offloading method thereof
US20020099753A1 (en) System and method for concurrently supporting multiple independent virtual machines
CN103793255B (en) Starting method for configurable multi-main-mode multi-OS-inner-core real-time operating system structure
CN1290897A (en) Method and system for dynamic adjustable and formulating waste collective program
US8522001B1 (en) Fast restart on a virtual machine
Kang et al. ConVGPU: GPU management middleware in container based virtualized environment
CA2768752A1 (en) Terminal device of non-android platform for executing android applications, and computer readable recording medium for storing program of executing android applications on non-android platform
CN102841780A (en) Method and equipment for creating and calling universal components
WO2013112282A1 (en) Method and apparatus for register spill minimization
CN110291508A (en) Garbage collector
US20130117549A1 (en) Method for executing multiple operating systems and electronic apparatus
CN104536773B (en) Embedded software dynamic memory recovery method based on internal memory scanning
CN106598647A (en) Intelligent apparatus development platform
CN103631645A (en) Digital family middleware system based on digital medical treatment
Bhattacharya et al. Improving the performance of JVM startup using the shared class cache
US7240176B2 (en) Apparatus and methods for placing a managed heap
CN108647087B (en) Method, device, server and storage medium for realizing reentry of PHP kernel
CN114416031B (en) Operating system for supporting RISC-V processor facing AIoT scene

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
DD01 Delivery of document by public notice

Addressee: Guangzhou Juhui Electronic Technology Co., Ltd.

Document name: Notification of an Office Action

C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 523127, building 1, Choi Yi Plaza, Dongcheng science and Technology Park, Dongguan, Guangdong, Dongcheng District

Applicant after: Guangzhou Juhui Electronic Technology Co., Ltd.

Address before: 510665, Guangzhou, Guangdong, Tianhe District Province Yun Road, No. 16, Guangzhou information port, 2 rooms 901

Applicant before: Guangzhou Juhui Electronic Technology Co., Ltd.

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110615