MICROEJ VEE ensures your C code is kept safely in its own container, ensuring a smooth experience for your legacy code and new applications alike. And the best part? MICROEJ VEE virtual machine is ultra lightweight, with a footprint of only 50 kB – perfect for microcontrollers and microprocessors with limited memory.
Discover More with Fred Rivard, MicroEJ’s CEO, in an Exclusive Interview with William Wong from Electronic Design!
— TRANSCRIPT —
William Wong – Java is a major part of Android and it is used in a lot of applications in general. So, Fred, could you tell me a little bit about VEE because that’s a specialized virtual machine for Java, isn’t it?
W.W. – So can you tell me a little bit more about Managed-C, because unlike the languages you were talking about, it doesn’t have garbage collection or anything like that. How does that work in terms of isolation, and how does it cooperate with the other things that are out there, like Java applications?
F.R. – I would say we provide the allocation, but it remains in the boundary of the container, so there’s no way for you to escape the boundary of the container. So, you can mess up yourself, but only yourself. You won’t crash the rest of the system. We also provide, inside the container, a sandboxing mechanism for apps. You may have a component written in Managed-C, another component written in Java, and they will be protected one from each other. This makes things extremely safe. You can also reuse such components in a totally secure and reliable way.
W.W. – Now, Java has the managed memory support, whereas C does not. How do you make the two talks together? Do they have a shared memory system? You know, how do the heaps actually work?
F.R. – Basically, it’s a shared heap and objects from C [i.e. allocated structures] are addressable directly from the Java space. The Managed-C and the Java do not point to each other. There is no overlap. You have this notion of C-structure in Java, so you can pass along such objects. The sharing is done with a zero-copy strategy within one heap (one piece of memory).
W.W. – Excellent. Now you also mentioned (actually, you hadn’t mentioned it but we talked earlier about) the fact that you utilize things like ahead of time compilation for the Java and you can also essentially have constants or predefined objects and structures both in C and in Java available to you and stored in Flash instead of RAM.
W.W. – Because this is the containerized system, I’m assuming that you can mix and have various of numbers of containers and number of different kinds of applications. So, you could potentially have two isolated C applications and a couple of Java applications depending upon what you’re building.
F.R. – You are extremely right. That’s exactly it and you are also allowed to load and unload code. We have the capability to link at runtime those little apps or components, and we can do it without sending over all the [link] symbols. We have an ID mechanism, which allows the code to already be inside the device. The code that is getting loaded and linked to the boardis to be extremely compact based on IDs only, and not symbols, which saves bandwidth and also RAM, flash, etc.
W.W. – I can see a number of use cases for this. Would one of them being taking up a standard IoT driver written in C and incorporated into a managed code application?
F.R. – A driver is something hardware related, so probably not. What you are going to put into the managed code is something that is more independent from the hardware, something that you would capitalize across different hardware or hardware innovation, etc. When you take a full communication stack, the upper-part of it would make sense to be turned into managed code. The low-level will remain in assembly, close to the hardware, because in fact this is some kind of a hook to the hardware, like a handle. There is a boundary here, between what you want to capitalize across hardware evolution versus what is really taking advantage of the hardware itself and will be changed across hardware evolution.
W.W. – Oh, very good, it sounds like a very useful platform. Thanks for filling us in on VEE and Managed-C.
F.R. – Thank you very much.