250 likes | 458 Views
실기기에 KVM Porting 기술 소개. 5/26/2000 Junbom Pyo ZUVIX technology, Co. Agenda. Overview of Java 2 Platform Introduction to Kjava Profile (I-mode, MIDP, etc.) NTT DoCoMo DoJa VM and MIDP VM Porting Scopes (APIs) of KVM Accessing argument from native methods CDMA Software Architecture
E N D
실기기에 KVM Porting 기술 소개 5/26/2000 Junbom Pyo ZUVIX technology, Co.
Agenda • Overview of Java 2 Platform • Introduction to Kjava Profile (I-mode, MIDP, etc.) • NTT DoCoMo DoJa VM and MIDP VM • Porting Scopes (APIs) of KVM • Accessing argument from native methods • CDMA Software Architecture • Where is mapping kvm layer?
Java 2 Platform Java 2 Enterprise Edition Java 2 Standard Edition TV profile Screen Phone/ Commu nicator Profile PDA Profile MID Profile Smart Card Profile Java 2 Micro Edition HotSpot JVM KVM CardVM CDC CLDC
Introduction to Kjava Profile Eg. Yellow pages, train schedules, Games... Applications Profile MIDP Library of Industry Profiles e.g.: TV STB, Wireless Phone, PDA ... JavaPhone Profile JavaTV Profile Set of base Configurations (eg. Supporting Threads, Floats) Core APIs Core APIs “C” VM “K” VM Any Operating System
Activity in MIDP Expert Group • Expert Group • Sun, Motorola, Nokia • Ericsson, Siemens, Telcordia, Symbian, RIM, NEC, Sharp, NTT/Docomo, Samsung, AOL, Matsushita, Fujitsu, Hitachi, Palm • Tentative Schedule for Spec release • March 10, 2000: draft 0.6 (candidate for participant draft) • March 21, 2000: Participant Review start • April 26, 2000: call for vote to move to public draft • May 1, 2000: public review start • June 1, 2000: Spec 1.0 Release
Java in Asia Java enabled subscribers SK Telecom J2ME Standard Version 2001. 5 Shinsegi Telecom 2001. 6 Service Launch LG Telecom 2000.10 Kittyhawk Profile KT F Soon… DoJa Profile NTT-DoCoMo Service Launch 2001. 1 KDDI, JPhone 2001. 6
High Level Architecture MIDP ApplicationIapply Application OEM-Specific Application Native Application Native System Software OEM-Specific Classes MIDP, DoJa CLDC RTOS
Porting Scopes (APIs) of KVM • Application (management) • User interface • Persistent Storage • Networking • Timers • I18N/L10N • Phone number “Dialer”
KVM Application Manager • Application packaging • using JAR • Application Descriptor • set of attributes • Title, version, Vendor, Jar-URL, Jar-Size, Data-Size, Application arguments, etc. • Application Lifecycle • Application interface • initApp(), startApp(), pauseApp(), destroyApp() • Application Context • provides information about the application manager to application • Application Manager • install, de-install, application lifecycle management, etc • mostly written in C (90%)
CLDC Directory Java API Native
Features Eliminated from the Java VM • No profile can require that a KVM support any of the following • Java Native Interface (JNI) • User-defined class loaders • Reflection • Thread groups and daemon threads • Finalization
Compiler Requirements You must have a C compiler capable of compiling ANSI – Compliant C files. The code compiles without any warnings using the following compilers Metrowerks C compiler, GNU C compiler, Solaris C compiler, Microsoft Visual Studio C compiler.
Distribution directories api Contains the Java library class source code that is provided with the release. bin Contains all the binary executables and compiled Java library classes. build Contains makefiles for building the KVM. doc Contains documentation. jam Contains the source code of the optional Java Application Manager (JAM) component that is provided with the KVM.
Directory kvm/VmCommon StartJVM.c Virtual machine startup and command line argument reading. cache.c Inline caching operations for speeding up method lookup. class.c Runtime data structures and operations for representing Java classes. events.c Implementation of a stream-based protocol for event handling. fields.c Runtime data structures and operations for representing fields of objects. frame.c Stack frame and exception handling operations. ETC…
Example Accessing arguments from native methods Java code: static native void drawRectangle(int x, int y, int width, int height); Native implementation: C code static void Java_com_sun_kjava_Graphics_drawRectangle() { int height = popStack(); int width = popStack(); int y = popStack(); int x = popStack(); windowSystemDrawRectangle(x, y, width, height); }
Example Accessing arguments from native methods const NativeImplementationType com_sun_midp_lcdui_DefaultDeviceCaps_natives] = { { "drawLine", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawLine}, { "drawRect", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawRect}, { "drawArc", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawArc}, { "drawChar", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawChar}, { "drawChars", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawChars}, { "drawString", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawString}, { "drawImage", Java_com_sun_midp_lcdui_DefaultDeviceCaps_drawImage},}
JNI Kauai VM Architecture >javac HelloWorld.java HelloWorld.class Class loader Sub system Class files Runtime data areas Native method libraries, Code Execution engine Native method interface
CDMA Software Architecture Diagnostic Task User Interface Task HS Task Diagnostic Monitor Rx Task Layer2 Task Main Control Task Searcher Task MSM Non-Volatile Database Task Tx Task Watchdog Task 80186 EEPROM EPROM (Flash) RAM Watchdog Timer
Where is mapping kvm layer? Application KVM UI HS NV Management Main Control Layer3 Layer2 RxTx MultiplexSublayer Rx Tx Layer 1 Searcher RF VOC
Conclusion Why do you try porting job? personal career? Skill up? Money? Do not do the porting! But, It is the work for the human beings. Even if don’t like it, you must do it.