Steps for Building a Custom RI
Before building a custom RI, the software listed in Prerequisites to Installing the Development Kit must be installed on the system. This section describes the basic step you must follow when creating a custom RI.
To build a custom RI:
Convert your packages using the Converter tool and generate Java Card Assembly files.
Note:
Converting and Exporting Java Class Files provides a detailed description of using the Converter tool.
For example, the output Java Card Assembly (
.jca) files could be located at:.\api_export_files\com\sun\javacard\installer\javacard\installer.jcaor
JC_CLASSIC_HOME
\samples\classic_applets\HelloWorld\applet\build\classes\com\sun\jcclassic\samples\helloworld\javacard\helloworld.jcaAdd the location for the Java Card Assembly files for your new packages in these files:
src\vm_16.insrc\vm_32.in
This step is required for new packages. If you are modifying existing packages, this step is not required.
Build the
crefexecutable.Note:
Building the 32-Bit Custom RI, and Building the 16-Bit Custom RI provide detailed procedures for building the
crefexecutable.The new
crefis built with the new packages masked in. Masked applications can be instantiated without requiring download after the runtime environment starts up.Test the custom RI.
Note:
Testing the 32-Bit Custom RI and Building the 16-Bit Custom RI provide detailed procedures for testing different custom RIs.
Building the 32-Bit Custom RI
The following procedure builds the 32-bit version of the RI. To build the 16-bit version see Building the 16-Bit Custom RI.
To build the 32-bit custom RI:
Testing the 32-Bit Custom RI
To test the 32-bit custom RI:
Example 12-1 Expected Console Output When Building 32-Bit Custom RI
Java Card 3.0.5 C Reference Implementation Simulator
32-bit Address Space implementation - with cryptography support
T=1 / T=CL Dual interface APDU protocol (ISO 7816-4)
Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
Memory configuration -
Type Base Size Max Addr
RAM 0x0 0xc78 0xc77
ROM 0x2000 0xc800 0xe7ff
E2P 0x10020 0xffe0 0x1ffff
ROM Mask size = 0x8b3e = 35646 bytes
Highest ROM address in mask = 0xab3d = 43837 bytes
Space available in ROM = 0x3cc2 = 15554 bytes
Mask has now been initialized for use
Building the 16-Bit Custom RI
By default the procedure described in Building the 32-Bit Custom RI builds the 32-bit cref. To build cref with 16-bit support you must modify those steps.
Note:
Building the 16-bit version creates only one cref_t0.exe file with no t1 or tdual version, so the resulting cref.bat file executes only cref_t0.exe.
To build the 16-bit custom RI:
Example 12-2 Expected Console Output When Building 16-Bit Custom RI
Java Card 3.0.3 C Reference Implementation Simulator
16-bit Address Space implementation - with cryptography support
T=0 Extended APDU protocol (ISO 7816-3)
Copyright (c) 2010 Oracle Corporation All rights reserved.
Use is subject to license terms.
Memory configuration
Type Base Size Max Addr
RAM 0x0 0x600 0x5ff
ROM 0x600 0xbc00 0xc1ff
E2P 0xc200 0x3be0 0xfddf
ROM Mask size = 0x9fb0 = 40880 bytes
Highest ROM address in mask = 0xa5af = 42415 bytes
Space available in ROM = 0x1c50 = 7248 bytes
Mask has now been initialized for use

