Contents Previous Next

Contents


1. About This Document

1.1 Who Should Use This Document

1.2 Related Documentation

2. Introduction to KVM

2.1 K Virtual Machine (KVM)

2.2 Differences between KVM 1.0.4 and KVM 1.0.3

3. Compiler Requirements

4. Directory Structure

4.1 Overview

4.2 Directory kvm/VmCommon

4.3 Directory kvm/VmExtra

5. Compilation Flags, Definitions and Macros

5.1 General compilation options

5.2 General system configuration options

5.3 Palm-specific system configuration options

5.4 Memory allocation settings

5.5 Garbage collection options

5.6 Class loading options

5.7 Interpreter execution options (since KVM 1.0)

5.8 Interpreter execution options (since KVM 1.0.2)

5.8.1 Copying the virtual machine registers to local variables

5.8.2 Splitting uncommon bytecodes into a separate subroutine

5.8.3 Moving the test for thread rescheduling to branchpoints

5.8.4 Padding out the bytecode space

5.9 Java-level debugging options

5.10 VM-level debugging and tracing options

5.10.1 Including and excluding debugging code

5.10.2 Tracing options

5.11 Error handling macros

5.12 Miscellaneous macros and options

5.13 Overriding the compilation flags and other options from makefiles

6. Required Port-Specific Files and Functions

6.1 File machine_md.h

6.2 File main.c

6.3 Runtime functions that require porting efforts

6.4 Required C library functions

7. Virtual Machine Startup

7.1 Command line startup

7.2 Alternative VM startup strategies

7.3 Using a JAM (Java Application Manager)

8. Class Loading, JAR Files, and Inflation

8.1 Generic class file loading

8.2 JAR file reader

8.2.1 Opening a JAR file

8.2.2 Closing a JAR file

8.2.3 Reading a JAR file entry

8.2.4 Reading multiple JAR file directory

8.3 Inflation

9. 64-bit Support

9.1 Setup

9.2 Alignment issues

10. Native Code

10.1 Using the K Native Interface (KNI)

10.2 Implementing old-style native methods

10.2.1 Include files

10.2.2 Accessing arguments from old-style native methods

10.2.3 Returning a result from an old-style native function

10.2.4 Shortcuts

10.2.5 Callbacks

10.2.6 Exception handling in old-style native code

10.2.7 Useful functions in old-style native code

10.2.8 Garbage collection issues

10.2.9 Initialization and reinitialization of global variables

10.3 Native code lookup tables

10.4 Asynchronous native methods

10.4.1 Design of asynchronous methods

10.4.2 Implementation of asynchronous methods

11. Event Handling

11.1 High-level description

11.1.1 Synchronous notification (blocking)

11.1.2 Polling in Java code

11.1.3 Polling in the bytecode interpreter

11.1.4 Asynchronous notification

11.2 Parameter passing and garbage collection issues

11.3 Implementation in KVM

11.4 Battery power conservation

12. Class File Verification

12.1 Overview

12.2 Using the preverifier

12.2.1 General form

12.2.2 Preverifier options

12.2.3 Supported input file formats

12.2.4 JAR support in preverifier (since KVM 1.0.2)

12.3 Porting the verifier

12.3.1 Compiling the preverifier

13. JavaCodeCompact (JCC)

13.1 JavaCodeCompact options

13.2 Porting JavaCodeCompact

13.3 Compiling JavaCodeCompact

13.4 JavaCodeCompact files

13.5 Executing JavaCodeCompact

13.6 Limitations

14. Java Application Manager (JAM)

14.1 Using the JAM to install applications

14.1.1 Application launching

14.1.2 Application updating

14.2 JAM components

14.2.1 Security requirements

14.2.2 JAR file

14.2.3 Application Descriptor File

14.2.4 Network communication

14.3 Application lifecycle management

14.3.1 Termination of the KVM Task

14.4 Error handling

14.4.1 Error conditions

15. Java-Level Debugging Support (KDWP)

15.1 Overall architecture

15.2 Debug Agent

15.2.1 Connections between a debugger and the KVM

15.2.2 Packet processing

15.3 Debugger support within KVM

15.3.1 Events

15.3.2 Breakpoints

15.3.3 Single stepping

15.3.4 Suspend and nosuspend options

15.4 Using the Debug Agent and the JPDA Debugger

15.4.1 Starting a debug session

15.4.2 Debugging example

 


Contents Previous Next KVM Porting Guide
CLDC, 1.0.4