1

Suppose I have a machine running Mac OS X, which is running VMware, which is running Ubuntu, which is running the canonical helloworld.c in a shell. What are the high-level sequence of events that occur between me pressing enter and Hello World! popping up on my screen?

I can understand that everything sitting above Ubuntu acts obliviously to the virtualization occurring. Additionally, I can somewhat understand from the point of view of Mac OS X, VMware is just another program - nothing special there. However, I don't understand how Ubuntu thinks it's interacting with HW, especially if it's not actually running in kernal-mode?

I'm just learning about OS's - so may not understand the full picture. Is there an additional sw/fw layer underneath the OS which the hypervisor emulates?

Seki
  • 11,135
  • 7
  • 46
  • 70
user167524
  • 87
  • 7
  • 1
    ubuntu itself wouldn't necessarily know it's running virtualized either. which is the whole point of virtualization. the VM software does all the hard lifting of intercepting/translation any "hardware" calls from the guest OS into physical or simulated equivalents on the host OS/hardware. vmware itself only does same-CPU emulation - you couldn't run an emulated PowerPC system inside on an x86 host. Since the hardware is mostly the same, VMware is more of a traffic cop to make sure the various VMs running don't stop on each other's toes – Marc B Oct 23 '14 at 22:03
  • 1
    Welcome to a concept called *abstraction*. – tangrs Oct 24 '14 at 04:08
  • Similar question: http://stackoverflow.com/questions/1365202/how-does-virtualization-software-work and http://stackoverflow.com/questions/9137151/hardware-virtualization and similar answer http://www.intel.com/content/www/us/en/virtualization/virtualization-technology/intel-virtualization-technology.html – xmojmr Oct 24 '14 at 07:15
  • 1
    @xmojmr thanks for the response - these questions are indeed similar and give what I'm confused about a name: virtualization; just didn't know what it was called – user167524 Oct 24 '14 at 18:21
  • If you find an easy to understand - full picture, describing the layers and how they interact - then consider writing a [self-answer](http://stackoverflow.com/help/self-answer) ;) – xmojmr Oct 24 '14 at 18:33

1 Answers1

1

What 'Ubuntu' is (or any other application) is a set of bytes that either represent instructions (opcodes long with their arguemnts) or data.
The instructions are decoded and executed by the CPU. The data is mostly read into the memory (lets say a group of constants, static variables, etc.).

VMware is basically a virtual computer hardware platform (here it's a virtualization of the x86 platform). This means that it reads all the bytes of an application (a raw binary, a PE or ELF exec, whatever) and tries to act as an x86 CPU. If done properly this is indistinguishable to anything interpreted by it.
This isn't abstraction - it doesn't hide the communication method with the hardware abstracting it to some higher-level access method (like the Linux filesystem for example). It just tries to act like a x86 CPU the best it can, an abstraction would be a clearly visible layer.

As an example - C is an abstraction over ASM/machine language, you can tell the difference between them quite clearly.