Author Topic: USBLegacyOff - Experimental [Patch]  (Read 29657 times)

0 Members and 1 Guest are viewing this topic.

Signal64

  • Observer
  • Posts: 11
USBLegacyOff - Experimental [Patch]
« on: October 15, 2009, 08:01:20 AM »
Consider this an experimental alternative to EHCIacquire if you are having issues with that option. 

This was made as a separate option until I can figure out why my 1st controller hands off correctly from BIOS to OS but hangs immediately when setting the hand off on the second controller.  This is regardless of additional clearing/setting of USB legacy registers and so far there is no way to tell if it is going to fail.

I was questioning the need to handoff usb legacy from BIOS to OS when technically the OS we are handing off to is Chameleon at that point.  As far as storage goes, we should be only dealing with keyboard/mouse mapping to PS/2 I/O (eg Legacy mode) and as far as I can tell by the EHCI and USB Legacy specs it "shouldn't" interfere. So I wrote this patch and it does solve the problem for now.

I've also started looking at recent Linux Kernel usb pci-quirks code and mailing lists on the subject where they have elected to shut off usb legacy at their pre-boot stage as well. This is for compatibility with their usb driver code and being able to enumerate correctly usb keyboard/mice/trackpads with their extended capabilities not seen if legacy is enabled.  I mention this as I'm booting successfully from a usb drive with that code.

This patch forgoes the BIOS Handoff to OS and just forces the registers to off.
Note: while the EHCI specs show explicitly how to handoff to/from BIOS, they do not show or recommend methods to turn it off "cleanly".

Bottom line, this is experimental.

If anything, this will help those with MCP79 based boards (including ION) with an AMI bios.

Once installed, use USBLegacyOff=Yes on the Chameleon console or add to boot.plist.


 

 
« Last Edit: October 15, 2009, 08:06:47 AM by Signal64 »

rals2007

  • Observer
  • Posts: 10
Re: USBLegacyOff - Experimental [Patch]
« Reply #1 on: October 20, 2009, 08:45:04 AM »
Patch the 2 diff ?

Signal64

  • Observer
  • Posts: 11
Re: USBLegacyOff - Experimental [Patch]
« Reply #2 on: November 14, 2009, 11:47:23 PM »
Yes, one is to add the USBLegacyOff option and the other adds the code to usb.c.

stefano.ermacora

  • Entrant
  • Posts: 3
Re: USBLegacyOff - Experimental [Patch]
« Reply #3 on: December 02, 2009, 08:05:24 PM »
hi.... this is my first post in this forum... so HI ALL!

Can you please tell me exactly how to patch chameleon with these 2 files? i'm little noob with compilation or stuff like that...
i have an asrock ion 330 pro with chameleon installed and pcefi 10.5. in my bios i have both usb 2.0 and legacy usb enabled and i don't have any other entries in that section, but my usb 2.0 hotplug doesn't work.. even if i've attached pen drives from boot startup... in verbose i receive errors like "UIM initialize error"...
do you think this can resolve my problem? tnx in advance and sorry for my bad english :P keep the great work you all.

Trauma

  • Observer
  • Posts: 28
  • Took too much man !
    • http://www.darwinx86.org - The french OSx86 docs
Re: USBLegacyOff - Experimental [Patch]
« Reply #4 on: December 06, 2009, 10:25:12 PM »
Hi Signal64,

I've just gave a try to this patch on a ION mobo (Asus AT3N7A-I), and hey it did the trick ! :)
USB 2 & Legacy support enabled in BIOS, and no more errors at boot. I was suspecting legacy support to cause those UIM/EHCI errors, and that was the case.

Thanks for this patch, i hope it will be implemented in future releases of Chameleon.
Desktop : GA-EP45-DS4 / E8400 @ 3 Ghz / 2Go 1066Mhz RAM / Shutdown/Reboot/Sleep/Speedstep Os X 10.5.6 Retail + Chameleon v2 Apple Raid + 9.6.0 Vanilla
NetBook : MSi Wind U100-015 2 Gb 667Mhz RAM / Shutdown/Reboot/Sleep/Speedstep / Os X 10.5.6 Retail + Chamelon v2

stefano.ermacora

  • Entrant
  • Posts: 3
Re: USBLegacyOff - Experimental [Patch]
« Reply #5 on: December 07, 2009, 10:57:14 PM »
Hi Trauma, how did you applied the patch? can you please tell me the procedure? i have an ion MCP79 MB. thanx in advance.

Trauma

  • Observer
  • Posts: 28
  • Took too much man !
    • http://www.darwinx86.org - The french OSx86 docs
Re: USBLegacyOff - Experimental [Patch]
« Reply #6 on: December 08, 2009, 02:22:18 AM »
stefano.ermacora,

Download Chameleon src, unarchive it and navigate to the ../i386/libsaio folder in terminal.
then type in this :

Code: [Select]
patch -p1 < path_to_the_diff
and hit enter, repeat the previous step for the two diff files. Once the files are patched, cd into the root folder of chameleon src and type this:

Code: [Select]
make embedtheme
You will find your compiled Chameleon files inside ../sym/i386 folder. Install and enjoy ;)
Make sure to have xcode installed first otherwise gcc compiler won't be present on your machine, and so the "make" comand won't work.

Goodluck.
Desktop : GA-EP45-DS4 / E8400 @ 3 Ghz / 2Go 1066Mhz RAM / Shutdown/Reboot/Sleep/Speedstep Os X 10.5.6 Retail + Chameleon v2 Apple Raid + 9.6.0 Vanilla
NetBook : MSi Wind U100-015 2 Gb 667Mhz RAM / Shutdown/Reboot/Sleep/Speedstep / Os X 10.5.6 Retail + Chamelon v2

stefano.ermacora

  • Entrant
  • Posts: 3
Re: USBLegacyOff - Experimental [Patch]
« Reply #7 on: December 08, 2009, 07:20:43 PM »
... simply works, Trauma! i'm very happy that i've solved the last issue with my asrock ion... i'll post the solution on other forums maybe for help other people in trouble like me. The congratulations goes to Signal64 and you all. :P

dante2003

  • Entrant
  • Posts: 2
Re: USBLegacyOff - Experimental [Patch]
« Reply #8 on: January 27, 2010, 01:39:50 PM »

eugene k2

  • Entrant
  • Posts: 5
Re: USBLegacyOff - Experimental [Patch]
« Reply #9 on: February 11, 2010, 01:09:17 PM »
Please add this patch to the next Chameleon release: it really fixes certain problems with USB Legacy mode and faulty BIOSes.

amf5

  • Entrant
  • Posts: 2
Re: USBLegacyOff - Experimental [Patch]
« Reply #10 on: February 12, 2010, 02:02:54 AM »
Please add this patch to the next Chameleon release: it really fixes certain problems with USB Legacy mode and faulty BIOSes.

Seconding this, great work Signal64.

I'm running into a small problem, though: I noticed that if this is enabled, I can't boot from USB media (Chameleon just hangs at detecting the 9400M), although it's certainly an improvement over not being able to boot with USB media inserted into the computer. Disabling EHCI is an option in my BIOS, and actually allows booting from USB media, although for obvious reasons this is not desirable. I'm unfortunately not familiar with C so I can't really investigate this myself, but I'm using an ASUS 1201N with a MCP79 and would be willing to provide whatever is needed to work around this issue (it's an AMI BIOS, available here).

eberts

  • Observer
  • Posts: 15
Re: USBLegacyOff - Experimental [Patch]
« Reply #11 on: March 16, 2010, 09:08:03 PM »
I'm a bit confused. The debug output says Legacy off but if I enter standby the mac still doesn't want to wake up with USB Legacy mode turned on in BIOS. So obviously, the patch is not properly working here. :(
I patched against the latest trunk. Any ideas what could be wrong?
Thanks a lot
eberts