KVM Porting Guide


CLDC 1.1

March, 2003

 
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.1 and KVM 1.0.3/4

3. Compiler Requirements

4. Required Port-Specific Files and Functions

4.1 File machine_md.h

4.2 File main.c

4.3 Runtime functions that require porting efforts

4.4 Required C library functions

5. Directory Structure

5.1 Overview

5.2 Directory kvm/VmCommon

5.3 Directory kvm/VmExtra

5.4 Directory kvm/VmExtra/src/fp

6. Compilation Flags, Definitions and Macros

6.1 General compilation options

6.2 General system configuration options

6.3 Palm-specific system configuration options

6.4 Memory allocation settings

6.5 Garbage collection options

6.6 Class loading options

6.7 Interpreter execution options (since KVM 1.0)

6.8 Interpreter execution techniques (after KVM 1.0.2)

6.8.1 Copying the virtual machine registers to local variables

6.8.2 Splitting uncommon bytecodes into a separate subroutine

6.8.3 Moving the test for thread rescheduling to branchpoints

6.8.4 Padding out the bytecode space

6.9 Java-level debugging options

6.10 VM-level debugging and tracing options

6.10.1 Including and excluding debugging code

6.10.2 Tracing options

6.11 Error handling macros

6.12 Miscellaneous macros and options

6.13 Overriding the compilation flags and other options from makefiles

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 Porting the class file loading interface

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. Floating-Point Support

10.1 Introduction

10.1.1 IEEE 754 floating-point

10.1.2 Implementing Java virtual machine floating-point semantics

10.1.3 Java virtual machine floating-point semantics: strictfp

10.1.4 Floating-point architectures

10.1.4.2.2 Generating FP-strict code in C

10.1.4.2.3 Default floating-point

10.1.4.3 Other architectures

10.2 Floating-point support in the virtual machine

10.2.1 Floating-point bytecodes implementation

10.3 CLDC 1.1 floating-point libraries and trigonometric functions

10.4 Porting

10.4.1 SPARC

10.4.2 ARM

10.4.3 x86

11. Native Code

11.1 Using the K Native Interface (KNI)

11.2 Implementing old-style native methods

11.2.1 Include files

11.2.2 Accessing arguments from old-style native methods

11.2.3 Returning a result from an old-style native function

11.2.4 Shortcuts

11.2.5 Callbacks

11.2.6 Exception handling in old-style native code

11.2.7 Useful functions in old-style native code

11.2.8 Garbage collection issues

11.2.9 Initialization and reinitialization of global variables

11.3 Native code lookup tables

11.4 Asynchronous native methods

11.4.1 Design of asynchronous methods

11.4.2 Implementation of asynchronous methods

12. Event Handling

12.1 High-level description

12.1.1 Synchronous notification (blocking)

12.1.2 Polling in Java code

12.1.3 Polling in the bytecode interpreter

12.1.4 Asynchronous notification

12.2 Parameter passing and garbage collection issues

12.3 Implementation in KVM

12.4 Battery power conservation

13. Class File Verification

13.1 Overview

13.2 Using the preverifier

13.2.1 General form

13.2.2 Preverifier options

13.2.3 Supported input file formats

13.2.4 JAR support in preverifier (since KVM 1.0.2)

13.3 Porting the verifier

13.3.1 Compiling the preverifier

14. JavaCodeCompact (JCC)

14.1 JavaCodeCompact options

14.2 Porting JavaCodeCompact

14.3 Compiling JavaCodeCompact

14.4 JavaCodeCompact files

14.5 Executing JavaCodeCompact

14.6 Limitations

15. Java Application Manager (JAM)

15.1 Using the JAM to install applications

15.1.1 Application launching

15.1.2 Application updating

15.2 JAM components

15.2.1 Security requirements

15.2.2 JAR file

15.2.3 Application Descriptor File

15.2.4 Network communication

15.3 Application lifecycle management

15.3.1 Termination of the KVM Task

15.4 Error handling

15.4.1 Error conditions

16. Java-Level Debugging Support (KDWP)

16.1 Overall architecture

16.2 Debug Agent

16.2.1 Connections between a debugger and the KVM

16.2.2 Packet processing

16.3 Debugger support within KVM

16.3.1 Events

16.3.2 Breakpoints

16.3.3 Single stepping

16.3.4 Suspend and nosuspend options

16.4 Using the Debug Agent and the JPDA Debugger

16.4.1 Starting a debug session

16.4.2 Debugging example

 


Contents Previous Next