Unzip the release package into any directory of your choice. This will create a directory j2me_cldc
with the following subdirectories:
api
bin
build
doc
jam
kvm
tools
The contents of these directories are detailed in TABLE 3.
All common, platform-independent source code of KVM is located in the directory kvm/VmCommon/src/
. All common include files are in the directory kvm/VmCommon/h/
.
Port specific source and include files should go into the directories kvm/Vm
Port/src/
and kvm/Vm
Port/h/
, where Port is replaced by the name of your platform (e.g., kvm/VmWin
, kvm/VmPilot
, kvm/VmUnix
.)
Some ports may choose to create a kvm/Vm
Port/build/
subdirectory which holds files that are part of the build process, but are not part of the source code per se.
TABLE 4 gives an overview of the KVM source code files contained in kvm/VmCommon/src/
and kvm/VmCommon/h/
.
File
|
Description
|
|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StartJVM.c
|
Virtual machine startup and command line argument reading.
|
|||||||||||||
bytecodes.c
|
The definition of Java bytecodes for the redesigned bytecode interpreter (since KVM 1.0.2).
|
|||||||||||||
cache.h
|
Inline caching operations for speeding up method lookup and for supporting “fast” bytecodes.
|
|||||||||||||
class.h
|
Internal runtime data structures and operations for representing Java classes.
|
|||||||||||||
events.h
|
Event system implementation.
|
|||||||||||||
execute.h
|
Interpreter execution macros and operations needed by the redesigned bytecode interpreter (since KVM 1.0.2).
|
|||||||||||||
fields.h
|
Internal runtime data structures and operations for representing fields and methods.
|
|||||||||||||
fp_math.h
|
High-level floating point function interface.
|
|||||||||||||
frame.h
|
Stack frame and exception handling operations.
|
|||||||||||||
garbage.h
|
Garbage collector and memory management.
|
|||||||||||||
global.h
|
Miscellaneous global variables and definitions.
|
|||||||||||||
hashtable.h
|
Hashtable implementation that is used internally by the virtual machine.
|
|||||||||||||
interpret.h
|
Bytecode interpreter. Note that starting from KVM 1.0.2 the actual interpreter code and bytecode definitions are located in other files (
bytecodes.c , execute.h , execute.c ).
|
|||||||||||||
kni.h
|
K Native Interface (KNI) support.
|
|||||||||||||
loader.h
|
Class loader and class format checks required by the class file verifier.
|
|||||||||||||
log.h
|
Logging/diagnostic operations for debugging and profiling.
|
|||||||||||||
long.h
|
Special macros to handle 64-bit operations in a portable fashion.
|
|||||||||||||
main.h
|
Compilation options and system-wide default settings.
|
|||||||||||||
messages.h
|
Error and warning messages.
|
|||||||||||||
native.h
|
Native function table operations and core native library functions.
|
|||||||||||||
pool.h
|
Runtime data structures and operations for representing constant pools.
|
|||||||||||||
profiling.h
|
Data declarations and operations for profiling virtual machine execution.
|
|||||||||||||
property.h
|
Operations for accessing Java system properties.
|
|||||||||||||
rom.h
|
Macros needed by the ROMizer (JavaCodeCompact tool).
|
|||||||||||||
runtime.h
|
Function templates for certain machine-specific operations that need to defined for each KVM port.
|
|||||||||||||
stackmap.c
|
Stackmap operations that are used for supporting exact garbage collection.
|
|||||||||||||
thread.h
|
Internal runtime data structures and operations for multithreading and Java thread management.
|
|||||||||||||
verifier.h
verifierUtil.h
verifierUtil.c
|
Classfile verifier (see Chapter 13 for details).
|
|||||||||||||
The directory kvm/VmExtra/
contains additional components that are potentially useful to a large number of ports. These files include an implementation of the most commonly needed networking protocols for Windows/Unix, a file interface for supporting class loading on those target platforms that have a regular file system, and a JAR file reader/inflater. This directory also contains the implementation of the Java-level debugger and the KDWP (KVM Debug Wire Protocol) interface.
In addition, the directory defines some optional macros for asynchronous event handling, and defines the virtual machine startup operations that are needed on non-embedded, command line based target platforms such as Windows and Solaris.
A description of the VmExtra
files is provided in TABLE 5.
File
|
Description
|
|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
async.h
|
Macros for supporting asynchronous I/O (see Section 11.4 "Asynchronous native methods” and Section 12.1.4 "Asynchronous notification”).
|
|||||||||||||
loaderFile.c
|
Low-level binding between the file system, class loader and JAR reader for those platforms that have a “real” file system.
|
|||||||||||||
main.c
|
Default main program for those platforms that have a file system and support VM startup from a command line.
|
|||||||||||||
jar.h
inflateint.h
inflate.c
|
Jar file reader and inflater (decompressor).
|
|||||||||||||
resource.c
|
Implementation of a stream-based protocol for reading external resources.
|
|||||||||||||
debugger.h
debugger.c
debuggerCommands.h
debuggerStreams.h
debuggerInputStream.c
debuggerOutputStream.c
debuggerSocketIO.c
|
Implementation of the Java-level debugger and the KDWP (KVM Debug Wire Protocol) interface.
|
|||||||||||||
The directory kvm/VmExtra/src/fp
contains library functions that are needed for supporting various floating-point functions required by CLDC Specification version 1.1. For more information on floating point support, refer to Chapter 10.
KVM Porting Guide , CLDC 1.1 |
Copyright © 2003 Sun Microsystems, Inc. All rights reserved.