Wednesday, December 16, 2009

Java on Embedded Devices - Internals

Java Virtual Machine is a Layer between the OS and Java Code (byte-code), code that you execute within a JVM first compiles into a byte-code (code that the JVM understands but not your OS - a standardized portable binary format), the JVM in-turn executes appropriate OS specific system calls.

Now what does "issuing system calls" mean for the JVM? simple: it doesn't run in kernel space, JVM runs in user space.

JVM is a middle-ware: soft-ware between the kernel and the operating system user-space. Byte code is standardization of JAVA (not necessarily) source code - write once: you do not need to worry about the target processor architecture/core, the other half of the JVM (kernel interface) takes care of that. JVM is like another processor with an instruction set.

First half of the JVM is the byte code compiler and kernel interface is the second half.

In embedded world we do not really worry about the first half much, second half is sure a concern - should be at least. We do understand that the JVM is an additional processing element within a system: Adding a(n) element(s) to any system results in an increase in overall complexity -> (increase in probability for faults -> probability for reduction in performance) .

Re-visit: JVM is an additional layer between the JAVA Application and the host operating system (e.g. Linux), and by nature use Green threads (not OS Native threads) [very similar to emulation].

A short intro to System-on-chips: A single mega-colony of System-on-chips (SoC) has colonized much of the world, embedded processors are now what server processors used to be in not so old days. Embedded processors come in varieties of cores such as x86 and ARM.

System-on-chips (SoC) package the processor with otherwise external components such as Ethernet and 802.11 PHYs, A/D, Video/Audio in a single chip. This significantly removes the need for analog components that otherwise be required such as (including but not limited to) resistors, capacitors, clocks, inductors, and oscillators. This implies reduced physical space on the PCB, low-power consumption, low heat dissipation, low-latency (removes inter-wiring of components), increased reliability.

Since many embedded devices run off batteries, low-power consumption is a requirements and that comes with a hefty price tag - negative impact on performance-per-watt.

Real-time performance: Low-latency and Deterministic response is usually a requirement (not met for various reasons) for embedded devices.

No comments:

Post a Comment