The present invention relates to multi-application, secure operating systems for small, secure devices, such as 
smart card microcontrollers. In particular, the present invention relates to mechanisms for secure runtime upload of applications onto small devices, authorisation mechanisms and the ability for authorised execution of 
multiple applications on the devices, where an application may be potentially larger than the 
microcontroller memory size. The mechanism simplifies life-cycle 
smart card management aspects related to post-issuance application (“applet”) upload and 
upgrade. Mechanisms to prepare applications (i.e. 
compiler techniques) using a common set of project files in one 
compiler toolset, for execution in a dual host & 
chip processor environment are described. These help automising the 
programming of the communication interfaces between the host and 
chip applications. An important motivation for the present invention is to provide a secure co-processor environment for general computer applications in order to counter 
software piracy, and to allow new models for secure electronic 
software distribution and 
software licensing.