Contents Previous Next

Chapter   5

Directory Structure


5.1 Overview

Unzip the release package into any directory of your choice. This will create a directory j2me_cldc with the following subdirectories:

The contents of these directories are detailed in TABLE 3.

TABLE 3  –  Distribution directories
Subdirectory
Description
api
Contains the Java library source code that is provided with the release.
bin
Contains all the binary executables and compiled Java library classes.
build
Contains makefiles for building the KVM.
doc
Contains documentation.
jam
Contains the source code of the optional Java Application Manager (JAM) component that is provided with the KVM.
kvm
Contains the source code of the KVM.
tools
Contains the source code for a number of tools (JavaCodeCompact, preverifier, KDWP Debug Proxy) that are provided with the release.

5.2 Directory kvm/VmCommon

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/VmPort/src/ and kvm/VmPort/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/VmPort/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/.

TABLE 4  –  Files in VmCommon
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
cache.c
Inline caching operations for speeding up method lookup and for supporting “fast” bytecodes.
class.h
class.c
Internal runtime data structures and operations for representing Java classes.
events.h
events.c
Event system implementation.
execute.h
execute.c
Interpreter execution macros and operations needed by the redesigned bytecode interpreter (since KVM 1.0.2).
fields.h
fields.c
Internal runtime data structures and operations for representing fields and methods.
fp_math.h
fp_math.c
High-level floating point function interface.
frame.h
frame.c
Stack frame and exception handling operations.
garbage.h
garbage.c
collector.c
collectorDebug.c
Garbage collector and memory management.
global.h
global.c
Miscellaneous global variables and definitions.
hashtable.h
hashtable.c
Hashtable implementation that is used internally by the virtual machine.
interpret.h
interpret.c
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
kni.c
K Native Interface (KNI) support.
loader.h
loader.c
Class loader and class format checks required by the class file verifier.
log.h
log.c
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.c
nativeCore.c
Native function table operations and core native library functions.
pool.h
pool.c
Runtime data structures and operations for representing constant pools.
profiling.h
profiling.c
Data declarations and operations for profiling virtual machine execution.
property.h
property.c
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
thread.c
Internal runtime data structures and operations for multithreading and Java thread management.
verifier.h
verifier.c
verifierUtil.h
verifierUtil.c
Classfile verifier (see Chapter 13 for details).

5.3 Directory kvm/VmExtra

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.

TABLE 5  –  Files in VmExtra
File
Description
async.h
async.c
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
inflate.h
inflateint.h
inflatetables.h
jar.c
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.

5.4 Directory kvm/VmExtra/src/fp

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.

 


Contents Previous Next KVM Porting Guide
, CLDC 1.1