RevoGirl / RevoBoot

The RevoBoot-loader project
http://revogirl.wordpress.com/
Other
50 stars 138 forks source link

Reboot after Bootloader initialization #22

Closed iLeopod closed 12 years ago

iLeopod commented 13 years ago

On the Gigabyte z68 mx-udh2 i have no luck booting with RevoBoot. Immediately after the Bootloader is initialized the system just reboots. I use Prelinked Kernel and for now Static DSDT and SSDT. It makes no difference if i use Lion or Snow Leopard. If more informations are needed just ask.

RevoGirl commented 13 years ago

Hi,

Please set #define DEBUG_BOOT in config/settings.h to 1 and compile with "make lion" for Lion or just "make" for Snow Leopard (can't be used otherwise) and tell me the last debug line(s) you see before it reboots.

iLeopod commented 13 years ago

Last line is: / gVerboseMode is true Video of Booting: http://f.cl.ly/items/1k0Q2q0i3c2B0h3D1C2V/boot.m4v SystemInfo (Ioreg,Kextstat): http://cl.ly/1o0F0R1H230K340X1x2h/SystemInfoStuff.zip

RevoGirl commented 13 years ago

Can't tell you if this is it, but Jeroen looked into it and said that you should check your settings.h against this file:

https://github.com/RevoGirl/RevoBoot/blob/master/i386/config/settings.h

because you don't use string data when you should.

Also. Do not use any static injection until it boots. Let me know if this helps.

iLeopod commented 13 years ago

Hi, You mean the ram stuff ? Tried it, but made no difference. I think settings.h is not the problem. There must be a other problem.

RevoGirl commented 13 years ago

Yes. The memory data has to be strings. And please be aware that errors in SMBIOS can cause this kind of restart issues. Been there myself. Seem thing for ACPI table injection, so do not use any static data until it boots up properly.

Another suggestion is to fill in every value in settings.h Do not use 0 for CPU type for example. To not use a zero anywhere where RevoBoot might expect to get some value from. This would be an error on my side, but I never checked if this is a problem or not.

p.s. I will do a test run with your settings.h after work / hockey training to see what I get. Might be interesting for me.

iLeopod commented 13 years ago

I think i tried every possible setting. On my old board i had no problems with RevoBoot. I believe it's something Hardware related. That's also the cause why I opened the issue here and no just asked at the Forum. Any Gigabyte SandyBridge Users out here?

RevoGirl commented 13 years ago

Ok. I woke up early with a great idea. Why don't you use static CPU and the SMBIOS data produced by Chameleon? This will tell us if it is related to the way RevoBoot handles the CPU and/or SMBIOS data.

Look at the SMBIOS/Tools/ for the command line tool to convert the data you got from IORegistryExplorer.

RevoGirl commented 13 years ago

Easier test. Open i386/libsaio/cpu/Intel/dynamic_data.h and search for:

wrmsr64(MSR_PKG_CST_CONFIG_CONTROL, 0x18008407);

Now add the following lines:

msr = rdmsr64(MSR_FLEX_RATIO); wrmsr64(MSR_FLEX_RATIO, (msr & 0xFFFFFFFFFFFEFFFFULL));

Recompile RevoBoot and try again. Let me know if this takes care of the reboots. I think this is it. Thanks to bcc9 for reporting and fixing this bug for his Gigabyte board ;)

iLeopod commented 13 years ago

Yes thats the problem. With the two lines above it's not working. With changing the CPU Multi to 30 x it's booting, but KP because of AppleIntelSNBGraphicsFB :-( DSM Stuff inDSDT not working ? Installing back the NVIDIA now.

RevoGirl commented 13 years ago

I am confused. You need the two lines or not?

Please set DEBUG_CPU and DEBUG_CPU_TURBO_RATIOS to 1 and make a picture of it. Other debug info is not required now that we know where to look for.

iLeopod commented 13 years ago

The two lines don't solve it. But when i used the old workaround, lowering the base Multi it works. It seem the Flex ratio is calculated on Cpu Multi: Chameleon bdmesg: Underlocked: msr(352): platform_info 70011e00 msr(356): flex_ratio 000f1e00 Sticking with [BCLK: 100Mhz, Bus-Ratio: 300] CPU: Brand String: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz CPU: Vendor/Family/ExtFamily: 0x756e6547/0x6/0x0 CPU: Model/ExtModel/Stepping: 0x2a/0x2/0x7 CPU: MaxCoef/CurrCoef: 0x0/0x1e CPU: MaxDiv/CurrDiv: 0x0/0x0 CPU: TSCFreq: 3008MHz CPU: FSBFreq: 100MHz CPU: CPUFreq: 3008MHz CPU: NoCores/NoThreads: 4/8 CPU: Features: 0x000002ff

Normal: msr(352): platform_info 70012200 msr(356): flex_ratio 000f0000 Unusable flex ratio detected. Patched MSR now 000e0000 Sticking with [BCLK: 100Mhz, Bus-Ratio: 340] CPU: Brand String: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz CPU: Vendor/Family/ExtFamily: 0x756e6547/0x6/0x0 CPU: Model/ExtModel/Stepping: 0x2a/0x2/0x7 CPU: MaxCoef/CurrCoef: 0x0/0x22 CPU: MaxDiv/CurrDiv: 0x0/0x0 CPU: TSCFreq: 3410MHz CPU: FSBFreq: 100MHz CPU: CPUFreq: 3410MHz CPU: NoCores/NoThreads: 4/8 CPU: Features: 0x000002ff

iLeopod commented 13 years ago

Oh just saw that the code was ignored when using static CPU data. Now its working.

Thank you for your effort.

Now have only the SNBFB KP left.

RevoGirl commented 13 years ago

Excellent news about the bug fix. Now we need to know if static CPU data works without this path. Please set the following compiler directives:

define STATIC_CPU_Type 0x603 (0x703 for the i7-2600)

define STATIC_CPU_NumCores 4

define STATIC_CPU_NumThreads 4 (8 for the i7-2600)

define STATIC_CPU_FSBFrequency 100000000ULL

define STATIC_CPU_QPISpeed 0

Now compile RevoBoot and see if it reboots. And if it does then add printf's in CPU/cpu.c like so:

void requestMaxTurbo(uint8_t aMaxMultiplier) { ... initTurboRatios(); printf("MinBusRatio: 0x%x\n", gPlatform.CPU.MinBusRatio); printf("MaxBusRatio: 0x%x\n", gPlatform.CPU.MaxBusRatio); sleep(15); ...

Let me know what values you get.

Thank you very much for testing this!

iLeopod commented 13 years ago

It's not working with static Data and default Bus Ratio. How can this fix be applied to cpu/static_data.h?

RevoGirl commented 13 years ago

That is why I asked you for the value of: gPlatform.CPU.MaxBusRatio What is it?

p.s. It doesn't matter which DEBUG_... directive you set, but set at least one to get printf() output on your screen. I need this value.

Thanks again!

iLeopod commented 13 years ago

This way https://github.com/iLeopod/RevoBoot/commit/717ef0106ae5825d3611b0accce10ffe9961469a ?

iLeopod commented 13 years ago

Got it: MinBusRatio: 0x10 MaxBusRatio: 0x22

RevoGirl commented 13 years ago

Ok so the values you get (1600 & 3400 MHz) are fine, but we have to work around a bug in the Gigabyte BIOS (we have to clear bit 16) and prevent function tsc_init() in tsc.c from setting tscGranularity to 0 (doesn't check for zero).

Consider this done. Will soon update RevoBoot with the required changes.

Thanks again for testing this and helping me!

RevoGirl commented 13 years ago

The changes for dynamic CPU data are now available from my repository. Please check the changes for me, and report back so that I can fix static data as well. Presuming that it working for you of course – I cannot test it myself ;)

Thanks for testing.

iLeopod commented 13 years ago

Ok, will try when i'm back home.

iLeopod commented 13 years ago

Tested: Works fine!! :-) Do you need CPU Debug Stuff?