Friday, April 24, 2009

openSuse 11.1 on Virtual PC 2K7: noreplace–paravirt i8042.noloop clock=pit explained

Seeing how I have some serious free time at work and have been studying for the Linux+ exam, I decided I needed a Linux machine at work. I am using openSUSE 11.1 with VPC 2K7. Now there are plenty of howtos out there so I won't post another one. I am going to explain something that seems to be a common thread throughout almost all the distros and VM software.


Most people seem to hit a point where the install will freeze on them, they have mouse problems and/or they have system time issues. The common fix is to add noreplace–paravirt i8042.noloop clock=pit to the boot parameters. At first I had little understanding of what this really did aside from clock=pit and most google searches only turn up more howtos than explanations. So, here is my nowhere near expert look at these parameters.

clock=pit:
This was the one command I actually understood in depth. This tells the kernel clock to use Programmable Interval Timer (PIT), the only Linux 2.6 kernel clock that does not correct for lost ticks. It is this lost tick correction that causes Linux 2.6 kernels to gain time ahead of the host OS's system time. FYI, the other two Linux 2.6 kernel clocks are PMTMR and TSC. I do not believe that it is this command that fixes the freezing issue. This simply fixes time keeping issues for once you have Linux up and running, as always I may be wrong.

i8042.noloop:
This command was pretty tough to get a good explanation on. The short answer is that a lot of VM software uses PS/2 mouse emulation and the i8042 mouse and keyboard driver for Linux does not play well with it. This should be enough for most users and the parameter fixes the mouse issues in VP 2K7. Of course I wanted a bit more. Looking into the code for the driver it appears that the driver sends a 3 byte loopback test to the AUX port to detect the mouse. The mouse should send a 3 byte response and then the driver can use the mouse. This looks to me to be how the driver sets up USB mouse support but I am not sure. So why does this cause an issue within a VM...I have no clue! My best guess after about an hour of googling, installing openSUSE to VP takes a loooong time, is that VP uses software emulation that to the driver looks like a USB mouse but responds to the loopback test incorrectly. This cause a error or my guess is an infinite loop in the test and voila no mouse or a frozen mouse. So by disabling this loopback test I am guessing that the driver never probes the AUX port for the mouse and simply responds to the PS/2 emulated mouse as if it were a real PS/2 mouse.

noreplace-paravirt:
This command is pretty simple. the noreplace simply forces the loading of paravirt-ops. paravirt-ops is a virtualization performance enhancement. I did not look into how it works too much but it appears to modify Linux to run specifically on a VM. My guess on this one is that Virtual PC does not natively support paravirt-ops and so that is why we need the noreplace parameter.

Of course all of this could be totally wrong and in which case I owe the Internet some bandwidth...

1 comments:

StaticFrost said...

Thanks for your help!! trying to install in class and wasn't working, teacher didn't even know why !! thanks heaps

 
>