What is technically wrong with fast OS switching?

6

2

An application (fast switcher) stays resident before the OS starts, and will be activated using a key combination (for example: Ctrl + Alt + Shift + Esc). After detecting the key combination, the switcher runs and stores all system registers + RAM (maybe use a RAM offset to avoid saving RAM into file) into a file and switches to the other OS register + RAM.

So it would be a fast OS switch without requiring a PC restart.

I want to know what is technically wrong with fast OS switching (remember hibernate).

user24263

Posted 2010-01-18T19:56:45.583

Reputation: 546

@Chet A after editing, you're right, I agree. It's valid and should be opened. I apologize for that! – alex – 2010-01-18T20:44:18.313

Even before editing it was a real question. Only a simpleton would assume that it is not a question because it contained no question mark. – Geoffrey Chetwood – 2010-01-18T20:46:04.097

While I agree this feature may not be interesting to many, I do not think it is not a valid question. Just the opposite (from a technical viewpoint). +Open – Rook – 2010-01-18T22:14:10.463

1

Isn't that pretty much what OS/2 1.x did on a 286 to run DOS programs in real mode?

http://pages.prodigy.net/michaln/history/os213/index.html

– Andrew J. Brehm – 2010-01-18T23:38:57.913

Answers

9

What you are describing are some of the (more minor) features of a Type 1 (or baremetal) Client Hypervisor - there are a few out there at the moment but most of those do not run on x86 or traditional PC platforms. The big players in the x86 Virtualization market (Citrix\Vmware\Microsoft) haven't released any yet but there are solid indications that both Citrix and VMware are actively developing them.

There isn't much demand in userland for these because (as others have said) you can pretty much achieve all of this with a Type 2 Client Hypervisor. There is a belief that these will be popular in business environments though for the same reasons that they have found a niche in some embedded\mobile platforms - they should provide for simplifying manageability and support. You can find a relatively old (late 2008) blog post about the prospects for Type 1 x86 Client Hypervisors by Brian Madden here.

Helvick

Posted 2010-01-18T19:56:45.583

Reputation: 1 103

He suggested using 40-50% of the RAM for one OS and 40-50% RAM for the other. It may seem like all this needs is a sane IO system... it may also be very wrong though - maybe that's why he asked. – n611x007 – 2012-12-18T20:25:54.547

1It seems to me his idea related to a type 1 hypervisor like task-switching relates to multitasking. With a type 1 hypervisor both OS actually run at the same time. The OS switcher would only allow one OS to run at a time and wouldn't have control over that OS while it is running (until called again by the user). – Andrew J. Brehm – 2010-01-18T23:40:25.070

I agree with your point and that was one of the reasons I said these were some of the more minor features of a baremetal client hypervisor. The very fast hibernation "switcher" he suggested would have no need for many of the things (like hardware abstraction and resource sharing) that make building a hypervisor hard but such a solution would require insanely fast storage in order to be useful. I don't think even an SSD RAID on 6Gbps SATA would be anywhere near fast enough, while a bare metal client hypervisor could deliver it even with todays storage performance and we will see them soon. – Helvick – 2010-01-19T01:07:24.230

7

Not terribly interesting to most people since you can just spin up a VM of almost any OS inside any other nowadays. RAM is very cheap too. If not for RAM and virtualization, this idea might be worthwhile. However, I don't see it gaining much traction in today's market.

Brian Knoblauch

Posted 2010-01-18T19:56:45.583

Reputation: 4 313

-1 -ed because I think this is not a technical reason but a social one. – n611x007 – 2012-11-23T02:04:21.190

1Er... why -1? +1 from me, /agree. – RJFalconer – 2010-01-18T20:13:01.300

1+1 from here as well. I agree as not being IMHO that interesting. – Rook – 2010-01-18T20:15:47.410

2some of my laptop hardwares are not working with linux such as modem for sending fax!, and it is not possible(?) to forward modem from linux to VM – user24263 – 2010-01-19T05:15:07.513

1Who uses a fax anymore? WTF. – Geoffrey Chetwood – 2010-01-19T20:21:37.370

3Well, I do. All my time sheets from work are faxed in to the payroll processing company. Orders are faxed in to us. We have to fax things to shipping companies, etc. Fax is still a very important part of business! – Brian Knoblauch – 2010-01-19T20:36:09.987

3me, in my country have to use fax, and sometime dialup – user24263 – 2010-01-20T03:08:43.487

5

Hibernate works because the OS has a guarantee that when it wakes up, everything is exactly in the state it was in when the OS went to sleep.

If you allow a second OS to run while the first OS is sleeping, it could make changes to the hard disk; when you switch back to the first OS, it would look as though the disk had instantaneously changed. Either the OS must be prepared for that or you would need to keep each OS on separate partitions and make sure they don't interfere with each other.

So, you could probably get it to work, but the two OSes couldn't communicate with each other at all, which would probably make the feature less interesting than running the second OS in a virtual machine.

benzado

Posted 2010-01-18T19:56:45.583

Reputation: 521

There's little difference between hibernate or sleep for the purposes of OS switching. Either way, the disk must be in the same state when the computer wakes up, or problems will occur. – benzado – 2010-02-08T15:57:58.493

We could make it so that each OS only access certain parts (partitions) of the hard drive. Although the states of the partitions belonging to a different OS than the current one changes, it is still theoretically possible to switch back and forth. – Frank – 2011-12-03T18:44:00.010

This is reasonable to say about the system disk/partition, but what about other (data) disks/partitions? The OS may be in the process of writing to them. Hibernate must be making sure that the OS is not doing things like this. I think it's safer if you configure the drive as a removable device and eject it before switching. – n611x007 – 2012-12-18T20:13:23.740

i thinks that hibernate is not sleep , it is completely power off – user24263 – 2010-01-19T05:15:48.340

1

So basically you're asking to be able to hibernate and then reboot into another OS, but save the few seconds of time it takes to go through BIOS? Seems like a lot of effort just to save those few seconds. The majority of the time would be spent hibernating one OS and un-hibernating the other OS, so it would only save you a small fraction of the total time.

davr

Posted 2010-01-18T19:56:45.583

Reputation: 4 809

5 seconds? Some pretty fast and fancy disk IO to do that as everything has to load off disk, into memory and light off. I'd not be seeing that 5 seconds with the 10GB memory I'm currently running. So VM system it is and it works very well. Run both at the same time. – Fiasco Labs – 2011-12-03T20:48:54.313

not a pure technical reason, if you ask me (although defensible). also... comment-like. good point with the SSD and the calculations, though! – n611x007 – 2012-12-18T20:21:18.923

not to save a few seconds, i want to switch in less than 5 seconds. – user24263 – 2010-01-19T05:17:19.897

1There's no way it could switch that fast...if you have 2GB of memory, it's gotta write that whole thing out to disk for the one OS, then load in the 2GB of memory state saved from the other OS. Even if you have a really fast SSD that can do 200MB/sec, that's still 10 seconds to save one, and 10 seconds to load the other, 20 seconds minimum. Things get even worse if you have more than 2GB of memory. – davr – 2010-01-19T23:26:46.430

you can use half of ram for one os , and other half (using an offset ) for another os – user24263 – 2010-01-20T03:10:20.050