[virtmach] Definition a virtual machine ?

Ian Piumarta Ian.Piumarta@inria.fr
Wed, 17 Nov 1999 15:58:01 +0100 (MET)


> How would you define a virtual machine ?

I've been reading this thread with interest.  After a long initiation
in programming language implementation, I worked for a few years in an
operating systems group.  Something that surprised me was the number
of OS papers that I came across talking about "virtual machines" --
but the meaning of the word in the OS community is superficially very
different from what we understand by it, and a software implementation
of a virtual instruction set is not at all what they are talking
about.  In an OS context a VM is *any* abstraction that changes the
programmers view from that of running on bare hardware: virtual
memory, processes, consistent interfaces to devices, etc...

Thinking about this for a while I decided that the language and OS
communities are essentially talking about the same thing, but they
draw the line between abstract and concrete in a different place.
After all, Unix can be viewed as a huge virtual machine having exactly
one instruction: "trap" -- but it doesn't have the "turing
completeness" that a language person would expect.  Conversely the
first Smalltalk virtual machines were in microcode -- and it's often
entirely reasonable to consider a microcoded instruction set as an
intrinsic part of the hardware on which programmers run programs (it's
as good as hard-wiring the insns into the h/w) -- but they didn't have
stuff like virtual memory, which an OS person would probably consider
an essential intrinsic feature of any modern "virtual machine".

In general OS people tend to draw the "line" in a place that excludes
the instructions used to execute user programs but includes changing
the semantics of the physical resources of the machine without
changing their surface characteristcs.  (But I vaguely remember that
the 360 had something called "usercode" -- I think it was a
"simplified" instruction set interpreted by the OS???)  Language
people tend to draw it in a place that includes the instructions used
to execute programs, but excludes fiddling with the meaning of
physical resources such as memory.

I don't think it's possible (or even realistic) to try to define a
virtual machine in terms of what it should or shouldn't have (complete
instruction set in software, a virtual memory implementation,
whatever...), since wherever you draw the line you'll be making
someone unhappy.  The best we can do (and I think someone already
hinted at this) is to say that a VM is *anything* that extends the
programmer's view from that of running the bare hardware -- a
definition which subsumes both the "OS" and the "language"
interpretations of "virtual".  And like someone else already said, the
existence of a rich, complete virtual instruction set -- bytecoded or
otherwise -- is just an implementation detail related to where one
chose to draw the line between abstract and concrete.

Does any of that sound even vaguely reasonable?

Ciao,

Ian