Warning: I don't write much. At all. Ever. I'm sorry if this is difficult to read, if my thoughts are not conveyed in an efficient or understandable manner, or it just makes no god damned sense whatsoever. Before this is done it will probably be article length which will be a nice accomplishment for me - and a terrible, awful experience for you.
While watching the stream on May 21st revealing the Xbox One, there was some interesting revelations about what the machine was focusing on for the wider market. Lots of people were upset about the multimedia treatment the new console was getting. Even worse was that it turned out the machine would be running three operating systems - something that would clearly leech power away from the gaming side of it. The internet's run rampant about this subject.
The reason I'm writing this is because I've spent the last two years mired in virtual machines and hypervisors. I thought I'd take the chance to explain what they are, how the work, and talk a little bit about what it means for resource management.
The hell is a hypervisor?
The Xbox One is running three operating systems: One is for gaming, one is for the Windows kernel used for apps, and a third to bring them together. This all sounds pretty intensive. What you need to know is that third third operating system is a hyper-visor.
I'm sure some of you are familiar with programs such as VMware Workstation, Parallels Desktop, Oracle's Virtual Box, or Microsoft's Virtual-PC. These are considered type 2 (or Hosted) hypervisors. These are designed to interface with the operating system they are installed within. They then provide emulation of hardware for the virtual machine (or guest OS) to run on.
That isn't what the Xbox One uses. Instead, it uses a type 1 (Bare-Metal) hypervisor. This means it is an operating system designed to interface directly with hardware and provide an environment for the guest OS to work within, all while managing the resources available to those guest operating systems. Comparatively, this means much lower overhead, and the ability to allow operating systems to use actual hardware, not just emulated counterparts.
One of the major advantages of the hypervisor is isolation of operating systems and tasks. Often virtual machines are used in a sandbox environment because you can test programs without any risk of them interfering with the host or other guests on that machine. What this means for you is if the apps side crashes it won't do anything to the games side, and vice-versa. Another advantage is you can suspend the operating systems so that they pick up exactly where you left off. You can even do it individually. This is where we get into resource management.
What resources are needed for this?
Straight up, you're losing some of your memory and a couple CPU cycles to the hypervisor. Another bloated Microsoft operating system, right? Up front this sounds awful, but it's not as bad as you think. As I'm writing this I'm running Hyper-V 2012. Microsoft has been trying to get into the hypervisor business market for a while, and they've made headway by offering their hypervisor for free, you pay for support though. If nothing else, at least Microsoft has experience with building these things.
Disclaimer: Windows Hyper-V 2012 is designed to run a variety of operating systems. This means it has a larger foot print than the Xbox One's hypervisor will have. I need you to understand this before you click this spoiler block.
Windows Hyper-V 2012 with updates, inside of a VMware virtual machine, and provided with 8 gigabytes of memory uses ~600 megabytes of memory. Idle in this case means that the Hyper-V host operating system is not updating or creating new virtual machines. Other virtual machines are running within it.
The hypervisor used on the Xbox One, while definitely based on the same technology, is not Hyper-V 2012. One of the things that has always been lauded in the console versus PC argument is that consoles are a closed environment. Each console is expected to be identical or at the very least have a minimum of resources. Microsoft (especially as a creator) knows exactly what's going into that machine. They can tailor the hypervisor to run those specific operating systems for games and apps. The foot print of the hypervisor will be much smaller than that of Hyper-V 2012.
Why on earth do you care about this?
The whole point behind everything above is to accurately express what resources are available to games. We've all seen the information stating that games are provided with 5 gigabytes of memory, 6 of the CPU cores, and supposedly 90% of the CPU cycles. That's going up against the PS4's 8 gigabytes, and a similar processor. Granted, the memory on the PS4 has almost twice the bandwidth, but there are other pieces in the Xbox One that make up for it. Still sounds like a losing hardware battle.
Here's the reality though. We have 8 gigabytes of memory. 5 of which are untouchable and only for games. A developer can always expect at the very least to have those 5 gigabytes. Let's assume that the hypervisor on this thing takes up half a gig of memory. That leaves 2.5 gigabytes available to the Windows kernel. It's not dedicated, but it has access to that 2.5. That doesn't mean your apps will always consume 5/16th of your Xbox One's memory.
The beauty of a hypervisor is we can shut off or suspend operating systems without any effect to others on that same machine. Got a game that needs to load up 6 gigabytes into memory? That's fine - the apps side won't even get in the way. How about 7 gigabytes? I think that's kind of outlandish but let's just suppose. If apps can't run within that last half gig of memory we can just suspend the whole thing and give the whole 7.5 gigabytes to the game.
I should probably make it clear I'm assuming things about the Xbox One's hypervisor (I hope that's obvious) and this is all based off of knowledge of other hypervisors and how they work. I'm also not an authority on hypervisors, so if I'm wrong about something please clear it up. I'd rather people have real information than assume that I'm right about everything.
If you managed to read the whole thing, thank you. Or more likely, I'm sorry.