VirtualBox hardware task switching

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
andymc
Member
Member
Posts: 31
Joined: Tue Feb 01, 2011 6:18 pm
Location: London, UK
Contact:

VirtualBox hardware task switching

Post by andymc »

Hey all, Andy McLaughlin here, I develop the Visopsys OS (http://visopsys.org). New to the forum.

I've done a quick search and haven't found the answer, so I'll just go ahead and ask.

I do most of my testing in VMware without problems, but I've had trouble with a couple of other VM programs, and I think the reason is because I use x86 hardware task switching. At least with VirtualPC I'm virtually certain that's the problem as I've discussed it with one of the engineers at MS. Basically, they haven't really bothered to implement hardware switching because the major OSes don't use it.

I'm now trying to debug startup failures in VirtualBox (version 2.2.4 on a CentOS 5.3 host) and it appears to be a similar problem; switching tasks using a far jump to a TSS selector seems to have no effect. At least that's what I think is happening.

I reckon I'm going to have to bite the bullet and implement software task switches (kind of PITA when you've basically got a stable, years-old multitasker) but has anyone had success with hardware task switching in VirtualBox? Anyone know any gotchas?
M2004
Member
Member
Posts: 65
Joined: Sun Mar 07, 2010 2:12 am

Re: VirtualBox hardware task switching

Post by M2004 »

Have you tried the latest version of Virtualbox? (version 4.0)

Regards
Mac2004
User avatar
andymc
Member
Member
Posts: 31
Joined: Tue Feb 01, 2011 6:18 pm
Location: London, UK
Contact:

Re: VirtualBox hardware task switching

Post by andymc »

I haven't; perhaps I should. :mrgreen:
M2004
Member
Member
Posts: 65
Joined: Sun Mar 07, 2010 2:12 am

Re: VirtualBox hardware task switching

Post by M2004 »

Its worth to try. If it the emulator being buggy?


Regards
Mac2004
Matthew
Member
Member
Posts: 48
Joined: Wed Jul 01, 2009 11:47 am

Re: VirtualBox hardware task switching

Post by Matthew »

I ran VirtualBox a few times with my then-hardware task-switched OS. I don't remember having difficulties like that.

But switching to software turned out to be not so bad. I started out by implementing an assembly routine that basically emulated the behavior of a long-jump to a task selector, so it could be just dropped into place. Later on I optimized it and fixed the data structures.

I also had to separate the usage of STR/LTR in various parts of the kernel, from the notion of get/set current task. But only code within bootstrap and SMP initialization really needs to be concerned with the actual TR.
User avatar
andymc
Member
Member
Posts: 31
Joined: Tue Feb 01, 2011 6:18 pm
Location: London, UK
Contact:

Re: VirtualBox hardware task switching

Post by andymc »

mac2004 wrote:Have you tried the latest version of Virtualbox? (version 4.0)

Regards
Mac2004
Aha, you were right. The latest version, running on a Vista host, works perfectly.

Cheers! =D>
Andy
Post Reply