Page 1 of 1

the structure of context in java card

Posted: Mon Jun 27, 2016 2:57 am
by Elisadl
Hi everybody in here!

I am designing all the structures in java card, which include Frame, Context.. But I didn't know Context structure. Does anyone know the structure of context in javacard?

For example, the structure of Frame is

typedef struct frame {
u1 last_pc;
u2 *lvars;
u2 *ostack;
method_info *mi;
class_info *ci;
struct frame *prev;
} Frame;

Re: the structure of context in java card

Posted: Mon Jun 27, 2016 5:00 am
by Crawford
Context is only an identifier, that is associated with different packages or JCRE.

Its structure may be like this:
context{
u1 context_id
u2 package_addr;
u2 applet_instance_addr;
}


if context is JCRE context, all above entry may be *0xFF*.

Re: the structure of context in java card

Posted: Mon Jun 27, 2016 5:49 am
by Crawford
Moreover, in your structure of FRAME, there must include context_id field like this:

Code: Select all

typedef struct frame {
u1 last_pc;
u2 *lvars;
u2 *ostack;
method_info *mi;
class_info *ci;
struct frame *prev;
u1 context_id;
} Frame;