PreonVM

Last updated
PreonVM
Written in C, Java
Platform ARM Cortex-M
Type Java virtual machine
License Proprietary software
Website PreonVM

PreonVM is an implementation of the Java virtual machine developed by Virtenio. The PreonVM was initially developed to run on the Atmel AVR ATmega256, but has been ported to ARM Cortex-M3 systems. Therefore the VM can run on a microcontroller with 8 kB RAM and 256 kB ROM at a minimum. The PreonVM requires no additional operating system and runs directly on the microcontroller.

Contents

Every class file of the application is transformed via a ClassLinker to strip all parts of class files that is not required. This makes it possible to reduce the class file size by about 80%, which is required for a small device. The ClassLinker builds a .vmm file which combines all application class files in a special format which can be read and executed by the PreonVM on the microcontroller.

The VM supports all Java data types incl. long and double, threads, synchronization, Garbage collection with memory defragmentation, exceptions, system properties and IRQ/event system. The PreonVM comes with a library of driver classes for IO like I2C, SPI, USART, CAN, PWM, IRQ, RTC, GPIO, ADC, DAC and with drivers for some sensors and IC's.

Code example

The following code examples uses an SHT21 sensor and reads the relative humidity.

publicclassSHT21Demo{publicstaticvoidmain(String[]args){// sensor is connected to I2C bus instance 1NativeI2Ci2c=NativeI2C.getInstance(1);i2c.open();// create and init SHT21 sensor instanceSHT21sht21=newSHT21(i2c);sht21.setResolution(SHT21.RESOLUTION_RH12_T14);sht21.reset();// read and print humidity every secondwhile(true){sht21.startRelativeHumidityConversion();Thread.sleep(100);intrawRH=sht21.getRelativeHumidityRaw();floatrh=SHT21.convertRawRHToRHw(rawRH);System.out.println("SHT21: rawRH="+rawRH+"; RH="+rh);Thread.sleep(900);}}}

See also


Related Research Articles

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client-server web applications, with a reported 9 million developers.

Java virtual machine Virtual machine

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

In computing, serialization or serialisation is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of object-oriented objects does not include any of their associated methods with which they were previously linked.

This is a comparison of Java and C++, two prominent object-oriented programming languages.

Humidity Concentration of water vapour present in the air

Humidity is the concentration of water vapour present in the air. Water vapor, the gaseous state of water, is generally invisible to the human eye. Humidity indicates the likelihood for precipitation, dew, or fog to be present.

In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications and libraries written in other languages such as C, C++ and assembly.

Hygrometer Instrument used for measuring the moisture content in the atmosphere

A hygrometer is an instrument used to measure the amount of water vapor in air, in soil, or in confined spaces. Humidity measurement instruments usually rely on measurements of some other quantities such as temperature, pressure, mass, a mechanical or electrical change in a substance as moisture is absorbed. By calibration and calculation, these measured quantities can lead to a measurement of humidity. Modern electronic devices use temperature of condensation, or changes in electrical capacitance or resistance to measure humidity differences. A crude hygrometer was invented by Leonardo da Vinci in 1480. Major leaps came forward during the 1600s; Francesco Folli invented a more practical version of the device, while Robert Hooke improved a number of meteorological devices including the hygrometer. A more modern version was created by Swiss polymath Johann Heinrich Lambert in 1755. Later, in the year 1783, Swiss physicist and Geologist Horace Bénédict de Saussure invented the first hygrometer using human hair to measure humidity.

GNU Classpath

GNU Classpath is a free software implementation of the standard class library for the Java programming language. Most classes from J2SE 1.4 and 5.0 are implemented. Classpath can thus be used to run Java-based applications. GNU Classpath is a part of the GNU Project. It was originally developed in parallel with libgcj due to license incompatibilities, but later the two projects merged.

Not Another Completely Heuristic Operating System, or Nachos, is instructional software for teaching undergraduate, and potentially graduate level operating systems courses. It was developed at the University of California, Berkeley, designed by Thomas Anderson, and is used by numerous schools around the world.

This article compares two programming languages: C# with Java. While the focus of this article is mainly the languages and their features, such a comparison will necessarily also consider some features of platforms and libraries. For a more detailed comparison of the platforms, please see Comparison of the Java and .NET platforms.

In computing, a system resource, or simply resource, is any physical or virtual component of limited availability within a computer system. All connected devices and internal system components are resources. Virtual system resources include files, network connections, and memory areas.

Lego Mindstorms NXT

Lego Mindstorms NXT is a programmable robotics kit released by Lego in late July 2006. It replaced the first-generation Lego Mindstorms kit, which was called the Robotics Invention System. The base kit ships in two versions: the Retail Version and the Education Base Set. It comes with the NXT-G programming software, or optionally LabVIEW for Lego Mindstorms. A variety of unofficial languages exist, such as NXC, NBC, leJOS NXJ, and RobotC. The second generation of the set, the Lego Mindstorms NXT 2.0, was released on August 1, 2009, featuring a color sensor and other upgraded capabilities. The third generation, the EV3, was released in September 2013.

The Java programming language and the Java virtual machine (JVM) have been designed to support concurrent programming, and all execution takes place in the context of threads. Objects and resources can be accessed by many separate threads; each thread has its own path of execution but can potentially access any object in the program. The programmer must ensure read and write access to objects is properly coordinated between threads. Thread synchronization ensures that objects are modified by only one thread at a time and that threads are prevented from accessing partially updated objects during modification by another thread. The Java language has built-in constructs to support this coordination.

Logical Domains is the server virtualization and partitioning technology for SPARC V9 processors. It was first released by Sun Microsystems in April 2007. After the Oracle acquisition of Sun in January 2010, the product has been re-branded as Oracle VM Server for SPARC from version 2.0 onwards.

Dalvik is a discontinued process virtual machine (VM) in Android operating system that executes applications written for Android. Dalvik was an integral part of the Android software stack in the Android versions 4.4 "KitKat" and earlier, which were commonly used on mobile devices such as mobile phones and tablet computers, and more in some devices such as smart TVs and wearables. Dalvik is open-source software, originally written by Dan Bornstein, who named it after the fishing village of Dalvík in Eyjafjörður, Iceland.

The Maxine virtual machine is an open source virtual machine that is developed at the University of Manchester. It was formerly developed by Sun Microsystems Laboratories, since renamed Oracle Labs. The emphasis in Maxine's software architecture is on modular design and code reuse for flexibility, configurability, and productivity for industrial and academic virtual machine researchers. It is one of a growing number of Java virtual machines written entirely in Java in a meta-circular style. Examples include Squawk and Jikes RVM.

Google Compute Engine (GCE) is the Infrastructure as a Service (IaaS) component of Google Cloud Platform which is built on the global infrastructure that runs Google's search engine, Gmail, YouTube and other services. Google Compute Engine enables users to launch virtual machines (VMs) on demand. VMs can be launched from the standard images or custom images created by users. GCE users must authenticate based on OAuth 2.0 before launching the VMs. Google Compute Engine can be accessed via the Developer Console, RESTful API or command-line interface (CLI).

GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The first production-ready version, GraalVM 19.0, was released in May 2019. The most recent version is GraalVM 21.0.0, made available in January 2021.