Chameleon

Issue 107: Restart Fix not work while the system running for a long time

Reported by King Fright, Jul 8, 2011

I use the Chameleon booter for a long time, at every version I found 
that the system may fail to restart if I had run many programs(This 
could be the most exactly case I could tell). It shows like the 
screen is power off, keyboard not working any more, but my 
notebook's bluetooth indicator lights forever now(normally it only 
lights few seconds on the restart time).

Comment 1 by King Fright, Jul 14, 2011

I have test out my fail case now (It's able to restart when I just 
enter the system):
1)Open the brower and see online video
2)Maybe 2 hours or more, sleep the system
3)Wakeup the system, then will restart fail

Comment 2 by King Fright, Jul 14, 2011

update 1:
Nothing chnages, I just put Evoreboot to my S/L/E, cause I use this 
to fix the restart issue before I use Chameleon to handle it. Did 
the samethings as I said in #1, then it works, the restart works~! 
Could some body tell the diffence between the kext and bootloader?

Comment 3 by Cosmosis Jones, Jul 18, 2011

can u reboot prior to sleeping w/out Evoreboot?

Comment 4 by Cosmosis Jones, Jul 18, 2011

Labels: Target:2.1

Comment 5 by King Fright, Jul 22, 2011

Failure reboot only happen when the system running for a long time. 
So I could reboot before/after sleeping w/out Evoreboot if I just 
enter the system. Cause the reboot will shut down the screen, I 
can't get more information even in verbose mode.

Comment 6 by Sergey Slice, Jul 22, 2011

May be this is a solution?
http://forum.voodooprojects.org/index.php/topic,1056.0.html

Comment 7 by King Fright, Jul 23, 2011

I merge the source code in slice's 1185, then the restart function 
not work.
http://forge.voodooprojects.org/p/chameleon/source/commit/1185/

Comment 8 by King Fright, Aug 3, 2011

update 2:
1)I merge Slice's 1185, result is not working
2)I directly compile Slice's branch - trunkM, still not working!

above two points, I already change the value of RestartFix from APCI 
to PS2 or reverse.

3)I found the code provided by toine44 only change 2 places:
/******************************************/
fadt_mod->Reset_Address = 0x0cf9 -> 0x64
fadt_mod->Reset_Value = 0x06 -> 0xfe
/******************************************/

So what I'm gonna to do is... yes, you are right! I just change 
these two value and recompile the source.

Result:Working these days, no fail restart any more! I don't know if 
I merge a wrong logic, but simplely change the original one works 
perfect to me, cheers~!

Comment 9 by King Fright, Aug 11, 2011

update 3:
Because the new values are really work for Laptop, so I finally 
dicide to use Slice's code to add more strings for this RestartFix, 
but seems the code can't get the value of the RestartFix key

/**********************************/
	// Restart Fix
	if (Platform.CPU.Vendor == 0x756E6547) {	/* Intel */
		fix_restart = true;
		value = getStringForKey(kRestartFix, 
&bootInfo->chameleonConfig);
		verbose("value[0] is \n", value[0], "Key is 
\n", kRestartFix);
		if (value[0] == 'A') {
			fix_restart_acpi = true;
			verbose("FADT: ACPI\n");
		} else if (value[0] == 'P') {
			fix_restart_acpi = false;
			verbose("FADT: PS2\n");
		} else {
			fix_restart = false;
			verbose("FADT: Fail\n");
		}
	} else {
		verbose ("Not an Intel platform: Restart Fix not applied 
!!!\n");
		fix_restart = false;
	}
/**********************************/

Output as below:
/**********************************/
value[0] is
FADT: Fail
FADT: Using custom DSDT!
value[0] is
FADT: Fail
FADT: Using custom DSDT!
/**********************************/

Comment 10 by Cosmosis Jones, Aug 11, 2011

you verbose line is bogus.

you need to use it like a sprintf and pass parms to it so it knows 
what to print.

like sprintf("Value is %d and key is %s, value, kRestartFix)

Comment 11 by Cosmosis Jones, Aug 12, 2011

really like this: 

verbose("Value is %s and key is 
%s\n",value[0],kRestartFix);

Comment 12 by Cosmosis Jones, Aug 12, 2011

and if value is a char* you dont' want [0]

Comment 13 by King Fright, Aug 13, 2011

value is define as below
const char * value;

I use below command to output
verbose("value is %s  \n Key is %s\n",  value, 
kRestartFix);

even I change the RestartFix value to ABCDEFG, it still prints value 
'S'

value[0] is S
 Key is RestartFix
FADT: Fail
FADT: Using custom DSDT!
value[0] is S
 Key is RestartFix
FADT: Fail
FADT: Using custom DSDT!

http://www.projectosx.com/forum/index.php?showtopic=1106&view=fin
dpost&p=15647

Comment 14 by Cosmosis Jones, Aug 13, 2011

myabe its' %S ?

i can't remember do a man printf

Comment 15 by King Fright, Aug 13, 2011

Hi, all. I think the problem is not about how to print the value, 
it's for the value retrieve from RestartFix is not 'PS2' or 
'ABCDEFG'. Is there anybody could give me how to get the value from 
the boot plist?

Comment 16 by King Fright, Aug 13, 2011

my boot plist currently using

Comment 17 by King Fright, Aug 13, 2011

please close the issue, it solved. Please don't add <!-- -> in 
boot plist, this will cause the program fail to get the key value. 
Thanks for meklort's helping!

Comment 18 by Evan Lojewski, Aug 13, 2011

The XML parser cannot handle <!-- <blah> --> type 
comments (it does not know to end on the --> instead of the >, 
as such, value is being set to 0.

Please not that before value is used, it should always be checked 
for a non zero value.

Comment 19 by Evan Lojewski, Aug 13, 2011

If you with to have the PS2 vs ACPI vs other restart fix code merged 
into trunk, please comment on this and (preferable) send in a patch 
file for the latest revision.
Status: Invalid

Created: 12 years 8 months ago by King Fright

Updated: 12 years 7 months ago

Status: Invalid

Followed by: 3 persons

Labels:
Priority:Medium
Type:Defect
Target:2.1