Voodooprojects
Chameleon => DevTalk => Patches => Topic started by: JrCs on January 01, 2010, 03:16:50 PM
-
Hi,
it's the patch that modify the facp table to fix the restart of our hack (no need kext like openhaltrestart anymore).
Credit goes to duvel300. I have refactored the code to simplify it.
A new boolean entry (RestartFix) must be add to com.apple.boot.plist to activate the fix.
Removing the patch because:
- only work for specific chipset
- not fully ACPI compliant
JrCs
-
The new and improved version is in the repo, correct?
-
In my branch YES. Not in the trunk.
-
Good stuff. I know this is related to fadt, so does your branch also include the tables override patch?
-
It seems to be not working for non-Intel processors at this moment. It seems to be specific to Intel (just to let you know)
-
Yeah... we should make it possible to override some of the addresses / values...
For example my previous laptop (Packard Bell EasyNote MZ-35 200) used restart register value 4 instead of 6...
But 0xCF9 address seems to be correct for any Intel CPU.
-
Any news here?
Even having Intel Core2Duo and 965GM chipset I have no good restart with or without this patch.
-
I don't understand why you remove it.
- It works on my intel desktop computer
- I've modified it to make it works in my laptop : using keyboard controller reset (see below)
// Patch FADT to fix restart
if (fix_restart)
{
/*
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x0cf9; // Address of the register
fadt_mod->Reset_Value = 0x06; // Value to write to reset the system
*/
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x64; // Address of the register
fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system
verbose("FADT: Restart Fix applied!\n");
}
After looking in linux sources and this http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html (http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html) and http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html (http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html)
I think these patchs could become an optional feature in com.apple.Boot.plist:- reset fix=keyboard
- reset fix=pci
I've noticed that apple hardware use the pci reset in their FADT and they have no ps/2 keyboard controller.
My laptop, asus 1201N, use MCP79 chipset like macbook6,1 but I have ps/2 keyboard. Unlike the mac, pci reset didn't work but keyboard reset works (before I was using evoReboot with does the same keyboard reset).
-
Thanks toine44.
Finally restart works in my Acer Aspire 5920.
-
Can someone help me with this fix? I don't know which file I need to edit.
Thanks
-
acpi_patcher.c, line 657
-
Thanks! ;D
-
I don't understand why you remove it.
- It works on my intel desktop computer
- I've modified it to make it works in my laptop : using keyboard controller reset (see below)
// Patch FADT to fix restart
if (fix_restart)
{
/*
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x0cf9; // Address of the register
fadt_mod->Reset_Value = 0x06; // Value to write to reset the system
*/
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x64; // Address of the register
fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system
verbose("FADT: Restart Fix applied!\n");
}
After looking in linux sources and this http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html (http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html) and http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html (http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html)
I think these patchs could become an optional feature in com.apple.Boot.plist:- reset fix=keyboard
- reset fix=pci
I've noticed that apple hardware use the pci reset in their FADT and they have no ps/2 keyboard controller.
My laptop, asus 1201N, use MCP79 chipset like macbook6,1 but I have ps/2 keyboard. Unlike the mac, pci reset didn't work but keyboard reset works (before I was using evoReboot with does the same keyboard reset).
I accepted this patch into my branch of Chameleon since rev1200.
-
slice can u attach the diff please either to the issue or here so we can get it merged to the trunk
thanks
-
According to the patch I made the follow: user can choise RestartFix=ACPI | PS2 | NO
My choice
<key>RestartFix</key>
<string>PS2</string>
The patch is located in acpi_patcher as usual
// Restart Fix
- if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */
+// if (Platform->CPU.Vendor == 0x756E6547) { /* Intel */
fix_restart = true;
- getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig);
+ value = getStringForKey(kRestartFix, &bootInfo->chameleonConfig);
+ if (value[0] == 'A') {
+ fix_restart_acpi = true;
+ } else if (value[0] == 'P') {
+ fix_restart_acpi = false;
+ } else {
+ fix_restart = false;
+ }
+/*
} else {
- verbose ("Not an Intel platform: Restart Fix not applied !!!\n");
+ DBG ("Not an Intel platform: Restart Fix not applied !!!\n");
fix_restart = false;
}
-
+*/
.........
if (fix_restart)
{
+ if (fix_restart_acpi) {
+ fadt_mod->Flags|= 0x400;
+ fadt_mod->Reset_SpaceID = 0x01; // System I/O
+ fadt_mod->Reset_BitWidth = 0x08; // 1 byte
+ fadt_mod->Reset_BitOffset = 0x00; // Offset 0
+ fadt_mod->Reset_AccessWidth = 0x01; // Byte access
+ fadt_mod->Reset_Address = 0x0cf9; // Address of the register
+ fadt_mod->Reset_Value = 0x06; // Value to write to reset the system
+ msglog("FADT: ACPI Restart Fix applied!\n");
+ } else {
+ fadt_mod->Flags|= 0x400;
+ fadt_mod->Reset_SpaceID = 0x01; // System I/O
+ fadt_mod->Reset_BitWidth = 0x08; // 1 byte
+ fadt_mod->Reset_BitOffset = 0x00; // Offset 0
+ fadt_mod->Reset_AccessWidth = 0x01; // Byte access
+ fadt_mod->Reset_Address = 0x64; // Address of the register
+ fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system
+ msglog("FADT: PS2 Restart Fix applied!\n");
+ }
}
If you want to see other my diffs look here http://www.projectosx.com/forum/index.php?showtopic=1106&view=findpost&p=15446 (http://www.projectosx.com/forum/index.php?showtopic=1106&view=findpost&p=15446)
-
hey please post a diff with an issue or a request for merge on forge.voodooprojects.org
we will then work w/ it to get it in the trunk
I'd love to have more features and fixes, but we need to establish a baseline of how this is done.
Thanks slice
cos
-
hey please post a diff with an issue or a request for merge on forge.voodooprojects.org
we will then work w/ it to get it in the trunk
I'd love to have more features and fixes, but we need to establish a baseline of how this is done.
Thanks slice
cos
3 weeks passed since my post. The patch is still not in trunk? Is it very hard for voodoo team?
I show you all that you need. If you want there is the diff file but I think it is not more easy to apply.
-
Slice, Please send a diff that will
1) compile with trunk (eg: Platform is a struct pointer in your branch, while just a struct in trunk).
2) submit the patch on forge.voodooprojects.org
3) *always* verify that the return value is *non null* for getStringForKey before you use it.
4) Verify the complete string, not just the first letter.
5) Values such as 0x756E6547 should be replaced with the corresponding #define
Also, when possible, submit separate patches for separate features.
-
Apply my diff and then correct all what you want. I think you are able to do this.
4) I don't know how.
-
Apply my diff and then correct all what you want. I think you are able to do this.
4) I don't know how.
Slice as a developer with access to the trunk you do not find writing proper code to be important?
You need some employees or intern to fix your code?