Does anyone know any good references for creating a virtual machine?
In what sense?
In general, a VM is a software simulation of computing hardware. A good book and/or class on Machine Organization will teach you a lot about how hadrware works.
Its very similar to building emulators. (Emualtors really re virtual machines modeling a specific peice of already existing hardware.)
Im sure there are books and articles on building emualtors in general. When I’ve nedded a virtual machine in the past I’ve genreally built a simple stack based processor as thats abotu as simple as it gets.
The Java VM in specific is defined in the Java Virtual Machine Specification.
Building an interpreter type VM is realtively easy. Building a basic garbage colelctor is a bit harder but there are some free implementations from universities otu there (the “classic” Java VM used one of these originally). Building a good non-intrusive GC is a bleeding edge type of science. Bullding dynamic compilers can go from moderately easy (for a very simple JIT) to very complex and againr ather bleeding edge(for an ioptimizing dynamic compiler such as hotspot).
At my university, they used to have an Opal (http://uebb.cs.tu-berlin.de/~opal/) compiler for the Java VM as a student assignment…
What do you want a Virtual Machine for?