ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

8 Pages V  « < 4 5 6 7 8 >  
Start a new topicClosed
> My Bootloader, Chameleon 2 based
maceshka
post Mar 17 2011, 10:56 AM
Post #101
Hello Slice. Could you upload latest revision of your Bootloader, please.

This post has been edited by maceshka: Mar 18 2011, 09:47 AM
Slice
post Mar 19 2011, 10:12 PM
Post #102
QUOTE (maceshka @ Mar 17 2011, 02:56 PM) *
Hello Slice. Could you upload latest revision of your Bootloader, please.

I stopped the project working on EFI bootloader. The version RC5m-721 is the last and best Chameleon. @topic.

OK. There is rev749 in topic
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 26 2011, 10:36 PM
Post #103
Slice,

Question on install - I use extra/extensions and boot from EFI. I don't build an .mkext as I only have FakeSMC and LegacyHDA kexts with an otherwise vanilla install. With Asere's bootloader and now Chameleon RC5 it boots fine. Your bootloader doesn't work for me - do you check for and use extensions in /Volumes/EFI/Extra/Extensions?

bdmesg from Chameleon RC5 r750 boot.

Attached File  RC5_r750_bdmesg.txt ( 6.99K ) Number of downloads: 33


Regards,
SMF

This post has been edited by SMF: Mar 26 2011, 10:37 PM
Slice
post Mar 27 2011, 02:15 PM
Post #104
QUOTE (SMF @ Mar 27 2011, 02:36 AM) *
Slice,

Question on install - I use extra/extensions and boot from EFI. I don't build an .mkext as I only have FakeSMC and LegacyHDA kexts with an otherwise vanilla install. With Asere's bootloader and now Chameleon RC5 it boots fine. Your bootloader doesn't work for me - do you check for and use extensions in /Volumes/EFI/Extra/Extensions?

bdmesg from Chameleon RC5 r750 boot.

Attached File  RC5_r750_bdmesg.txt ( 6.99K ) Number of downloads: 33


Regards,
SMF

I didn't change this part of base Chameleon. Extensions should be loaded from bt(0,0)/Extra/Extensions.
Try to play with modules - remove unnecessary.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 27 2011, 07:02 PM
Post #105
Slice,

I tried booting with GUI, HPET, klibc, Memory, Networking, and Resolution. I can only get it to boot if I use -f (ignore caches) and it appears that my DSDT is not being processed - my screen resolution is locked at 1024 x 768.

Here's my bdmesg.

Attached File  bdmesg.txt ( 5.71K ) Number of downloads: 15


I understand you've moved on to the EFI booter but wanted to send on my results for you in case it i helpful. If you would like me to test something let me know.

Regards,
SMF
Slice
post Mar 27 2011, 07:57 PM
Post #106
QUOTE (SMF @ Mar 27 2011, 11:02 PM) *
Slice,

I tried booting with GUI, HPET, klibc, Memory, Networking, and Resolution. I can only get it to boot if I use -f (ignore caches) and it appears that my DSDT is not being processed - my screen resolution is locked at 1024 x 768.

Here's my bdmesg.

Attached File  bdmesg.txt ( 5.71K ) Number of downloads: 15


I understand you've moved on to the EFI booter but wanted to send on my results for you in case it i helpful. If you would like me to test something let me know.

Regards,
SMF

No, resolution doesn't depend on DSDT. BIOS reads EDID if possible. In your case it is not happen.
About cache - something wrong in your kext's set. Try to delete all caches.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 27 2011, 08:41 PM
Post #107
Slice,

I tried deleting all caches - I can boot without -f but still have problems with resolution. With Chameleon I get full resolution at the graphic bootscreen and in OSX after booting. With your booter I'm stuck at 1024x768. Looking at the bdmesg I see the booter is trying PCI Root x0 and my system uses x1 (Gigabyte P35-DQ6). I also notice that it's not reading my FSB speed consistently - I have overclocked to 400 but in some places it's reading 333 - you'll see that in my bdmesg. For some reason it still seems that it's not reading my DSDT.aml.

Sorry that my programming skills are so rusty I can't dig through your code and try to figure it out on my own.

Regards,
SMF
Slice
post Mar 28 2011, 06:23 AM
Post #108
Not sure if it works
CODE
PciRoot=<value>         Use an alternate value for PciRoot (default value 0).
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 28 2011, 10:34 AM
Post #109
QUOTE (Slice @ Mar 28 2011, 02:23 AM) *
Not sure if it works
CODE
PciRoot=<value>         Use an alternate value for PciRoot (default value 0).



Slice,

I thought of that but won't have an ability to test for a few days. However that is not necessary with Chameleon - it keeps me going back to a belief that my DSDT is not being processed with your bootloader. With Chameleon and Asere's bootloader I don't need that in my boot.plist. It's taken care of in my DSDT.

Regards,
SMF
Slice
post Mar 29 2011, 04:28 PM
Post #110
QUOTE (SMF @ Mar 28 2011, 02:34 PM) *
Slice,

I thought of that but won't have an ability to test for a few days. However that is not necessary with Chameleon - it keeps me going back to a belief that my DSDT is not being processed with your bootloader. With Chameleon and Asere's bootloader I don't need that in my boot.plist. It's taken care of in my DSDT.

Regards,
SMF

Nonsense.
How did you imagine a bootloader for hackintosh that can not process DSDT.aml?
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 30 2011, 02:29 AM
Post #111
QUOTE (Slice @ Mar 29 2011, 12:28 PM) *
Nonsense.
How did you imagine a bootloader for hackintosh that can not process DSDT.aml?


Slice,

I know it's crazy but if I look at the bdmesg when I boot Chameleon (posted above) I can see that it's processing my DSDT.aml and my /Extra/Extensions. If you look at the bdmesg from when I boot with your bootloader I see none of that reported. I've checked permissions on my DSDT.aml and the file structure of my /Extra folder matches yours and it's the same I have been using with Asere's bootloader and now with Chameleon RC5. The only difference is the addition of the modules directory. I have GUI, klibc, Memory, and Resolution installed. When I boot with your bootloader I'm stuck with 1024x768 resolution in the bootloader gui and at the OSX desktop. It all seems to point to my DSDT.aml not being processed.

Regards,
SMF
Slice
post Mar 30 2011, 01:49 PM
Post #112
No, I just disabled messages from ReadFile to speedup booting. DSDT is loading that you can check by making some patch for cosmetics.
For example
CODE
                Device (GIGE)
                {
                    Name (_ADR, Zero)
                    Name (_SUN, 0x02)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package ()
                            {
                                "model",
                                Buffer (0x21)
                                {
                                    "Marvell Yukon 8040 Fast Ethernet"
                                },

                                "device_type",
                                Buffer (0x09)
                                {
                                    "Ethernet"
                                },
                                
                                "built-in",
                                Buffer (One)
                                {
                                    0x00
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

You problem seems to be unsupported Video card by my GraphicsEnabler.
Hmm, you didn't install it?
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
SMF
post Mar 30 2011, 09:41 PM
Post #113
Slice,

I'll try again. I have an NVIDIA GeForce 9800 GT. I think I've tried it with and without the graphics enabler module. I'm so stumped with why it's not working that I'll have to go back to square one with more modules installed and try it. I thought that even if I didn't use the graphics enabler for boot my DSDT would take care of that in OSX. It certainly works with Chameleon. I'll try it and see what I get in System Profiler. Attached is a picture of what I get with Chameleon RC5 and my DSDT.

Regards,
SMF

Attached File  Chameleon_Graphics___DSDT.png ( 79.9K ) Number of downloads: 38


SMF
post Apr 1 2011, 03:39 PM
Post #114
Slice,

Yes. I wasn't clear in my last message. None of the customizations in my DSDT - the graphics card name, etc. is shown after I boot with your bootloader. My DSDT is not being loaded.

Regards,
SMF


QUOTE (Slice @ Mar 31 2011, 03:43 AM) *
Did you try my advice to check if DSDT is loaded?
Slice
post Apr 3 2011, 09:16 AM
Post #115
QUOTE (SMF @ Apr 1 2011, 07:39 PM) *
Slice,

Yes. I wasn't clear in my last message. None of the customizations in my DSDT - the graphics card name, etc. is shown after I boot with your bootloader. My DSDT is not being loaded.

Regards,
SMF

Place your dsdt into root of booted partition and name it exactly "DSDT.aml".

You also can customize from prompt
"dsdt=/test/test_dsdt.aml"
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
akbar102
post Jul 21 2011, 09:39 PM
Post #116
hi slice
i am get your last version on your trankm branche after installing i am geting instand reboot after this:
loading driver :....../extra/extension.mkext
please.can you provide a doc about change that you make in your branch?
thanks for your work.
Slice
post Jul 22 2011, 05:42 PM
Post #117
First of all, I want to say that I based on latest trunk and keep my codes in sync with it.
I didn't change anything concerning /Extra b/c I didn't like it. Let it be the same as trunk.
About your issue try the follow:
- boot with -f option;
- erase the mkext;
- take latest revision of the bootloader.

Now I want to report what is the difference.
1. i386/Cconfig
CODE
    string "Optimization Level"
-    default "-Oz"
+    default "-Os"

AFAIK there is no -Oz for Apple's gcc-4.2.1. Level -Os gives me fastest and smallest codes.
2. i386/boot2/boot.c
CODE
char gMacOSVersion[8];
+void *gRootPCIDev;
+void *gPlatform;
+void *gBootOrder;
+void *gSMBIOS;
+int gDualLink;

I need these global variables to exchange data between modules.
3. i386/boot2/boot.h
CODE
+extern char gMacOSVersion[];
+extern int     bvCount;
+extern void *gRootPCIDev;
+extern void* gPlatform;
+extern void* gBootOrder;
+extern uint16_t vgaVendor;;

External definitions for them.
4. i386/boot2/graphics.h
CODE
+extern int gDualLink;

This variable is needed for GraphicsEnabler after modules Resolution do its work.
5. i386/boot2/gui.c
CODE
+    gDualLink =((screen_params[0] * screen_params[1]) > (1<<20))?1:0; //Slice - needed for GMAX3100

Thus for screen 1024x768 gDualLink=0 while for 1440x900 gDualLink=1.
6. i386/boot2/modules.c
CODE
-        verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);
+//        verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);

sad.gif Just disable the message as I don't know a reason for it.
7. i386/libsaio/Makefile
CODE
-    convert.o aml_generator.o console.o
+    convert.o aml_generator.o console.o exfat.o

Added support for exFAT file system by dmazar
8. i386/libsaio/acpi_patcher.c
CODE
+#include "smbios_getters.h"

I need some relations between SMBIOS and ACPI.
CODE
+bool fix_restart;
+uint64_t acpi10_p;
+uint64_t acpi20_p;
+
+int rsdplength;
+void *new_dsdt=NULL;
+
+extern char* gSMBIOSBoardModel;
+

These variables defined as local in different procedures. I made them common for all module.
CODE
-        verbose("ACPI table not found: %s\n", filename);
+        //verbose("ACPI table not found: %s\n", filename);

-                printf("Couldn't read table %s\n",dirspec);
+                //verbose("Couldn't read table %s\n",dirspec);

These spam about missing SSDT is not interesting. The user knows that these files are absent.
CODE
-    if (Platform.CPU.Vendor != 0x756E6547) {
+    if (Platform->CPU.Vendor != 0x756E6547) {

I changed Platform structure definition to pointer and allocate the structure dynamically because I had an issue with losing address of static variable in modules system.
CODE
-                    case 0x0D:                // ???
+                    case CPU_MODEL_PENTIUM_M:                // ???

CPU_MODEL_PENTIUM_M=0x0d. Why not write it explicitly?
CODE
-    struct acpi_2_fadt *fadt_mod;
+    struct acpi_2_fadt *fadt_mod = NULL;
    bool fadt_rev2_needed = false;
-    bool fix_restart;
+    bool fix_restart_acpi = false;

These variables may be used uninitialized.
CODE
    // 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;
+        }
+/*

Now RestartFix has three states = ACPI | PS2 | NO. http://forum.voodooprojects.org/index.php/topic,1056.0.html
CODE
+        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");            
+        }

So the user can choose the best method for him.
CODE
    // Determine system type / PM_Model
+    if (fadt_mod && Platform->Type) {
+        fadt_mod->PM_Profile = Platform->Type;
+    } //else do not change anything
+

Sometimes FACP contains wrong value for PM_Profile. I want to force the setting based on calculation in SMBIOS (will be explained later).
CODE
    /* XXX aserebln why uint32 cast if pointer is uint64 ? */
-    acpi10_p = (uint32_t)getAddressOfAcpiTable();
-    acpi20_p = (uint32_t)getAddressOfAcpi20Table();
+            //Slice because rsdp_mod is a pointer (32bit in i386) to a structure uint64_t*
+    acpi10_p = (uint64_t)(uint32_t)getAddressOfAcpiTable();
+    acpi20_p = (uint64_t)(uint32_t)getAddressOfAcpi20Table();

Warning eliminatings.
CODE
+static struct acpi_2_xsdt* createNewXSDTfromRSDT(struct acpi_2_rsdt * rsdt)
+{

And many new codes correspond to conversion from ancient ACPI1.0 to ACPI2.0 that obligatory for MacOSX.
CODE
    // Load replacement DSDT
    new_dsdt = loadACPITable(dirSpec);
+    struct acpi_2_dsdt* dsdt = (struct acpi_2_dsdt*)new_dsdt;
+    if (new_dsdt) {
+        msglog("DSDT.aml loaded from %s\n", dirSpec);
+        strncpy(dsdt->OEMID, "Apple ", 6);
+        strncpy(dsdt->OEMTableId, MacModel, 8);
+        dsdt->OEMRevision = ModelRev;
+        dsdt->Checksum=0;
+        dsdt->Checksum=256-checksum8(new_dsdt,dsdt->Length);
+        
+    }

Cosmetics(?) for System Profiler. http://www.insanelymac.com/forum/index.php...&start=560#
CODE
            {                
                ssdt_count++;
            }
-            else
+/*            else
            {
                break;
-            }
+            }*/

Before if SSDT.aml, SSDT-1.aml and SSDT-3.aml are present the loading breaks before SSDT-3 was loading. Now continue search all 30 tables.
CODE
+                    //Now I want to replace DSDT in place
+                    // it is only way to patch DSDT on some platform
+                    old_dsdt = (char *)fadt->DSDT;

And some new codes to copy new_dsdt in place of old_dsdt. It works!
CODE
                /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT.
                 * A Better strategy would be to generate
                 */
+                //Slice - it is possible only for ACPI20
+                if (version) {
+                    if(rsdp->RsdtAddress){
+                        rsdp_mod->XsdtAddress =
+                        (uint64_t)(uint32_t)createNewXSDTfromRSDT((struct acpi_2_rsdt*)rsdp->RsdtAddress);
+                        continue;
+                    }
+                    else
+                        DBG(" no sample to create XSDT, dropping\n");
+                }

This FIXME comment origins from mackerintel AFAIK and still remain in newest trunk.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Slice
post Jul 22 2011, 07:18 PM
Post #118
Continue.
9. i386/libsaio/acpi_patcher.h
CODE
+//Slice - it's bullshit to define variables in header file
+//uint64_t acpi10_p;
+//uint64_t acpi20_p;
+//uint64_t smbios_p;

If a header file are included in two different c files then variables will be different.
10. i386/libsaio/cpu.c
CODE
-                DBG("msr(%d): platform_info %08x\n", __LINE__, bitfield(msr, 31, 0));
+                DBG("msr(0x%04x): platform_info %08x-%08x\n", MSR_PLATFORM_INFO,
+                (msr >> 32) & 0xffffffff, msr & 0xffffffff);

What do you want to see in bdmesg.log, source line number or number of used MSR?
CODE
-        /* Mobile CPU */
-        if (rdmsr64(MSR_IA32_PLATFORM_ID) & (1<<28)) {
+        /* Mobile CPU ? */
+//Slice
+        msr = rdmsr64(MSR_IA32_PLATFORM_ID);
+        DBG("msr(0x%04x): MSR_IA32_PLATFORM_ID 0x%08x\n", MSR_IA32_PLATFORM_ID, msr & 0xffffffff); //__LINE__ - source line number :)
+        if (msr) {
+            p->CPU.Mobile = FALSE;
+            switch (p->CPU.Model) {
+                case 0x0D:
+                    p->CPU.Mobile = TRUE; // CPU_FEATURE_MOBILE;
+                    break;
+                case 0x0F:
+                    p->CPU.Mobile = FALSE; // CPU_FEATURE_MOBILE;
+                    break;
+                case 0x02:
+                case 0x03:
+                case 0x04:
+                case 0x06:    
+                    p->CPU.Mobile = (rdmsr64(MSR_P4_EBC_FREQUENCY_ID) && (1 << 21));
+                    break;
+                default:
+                    p->CPU.Mobile = (rdmsr64(MSR_IA32_PLATFORM_ID) && (1<<28));
+                    break;
+            }
+            if (p->CPU.Mobile) {
            p->CPU.Features |= CPU_FEATURE_MOBILE;
        }

The mobility calculation is not common for any CPU.
11. i386/libsaio/device_inject.c
CODE
-    verbose("efi_inject_get_devprop_string NULL trying stringdata\n");
+//    verbose("efi_inject_get_devprop_string NULL trying stringdata\n");

The spam.
CODE
-  uint32_t strlength;
-  char *string = efi_inject_get_devprop_string(&strlength);
+//  uint32_t strlength;
+  char *string = efi_inject_get_devprop_string(&stringlength);

-    cnt = strlength * 2;
+    cnt = stringlength * 2;

Reusing variable instead of creating new one. Is it a bug?
12. i386/libsaio/disk.c
CODE
+                    case FDISK_LINUX:
+                        bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap,
+                                          0, 0, 0, 0, 0, 0, EX2GetDescription,
+                                          (BVFree)free, 0, kBIOSDevTypeHardDrive, 0);
+                        break;

An attempt to detect Linux. http://forum.voodooprojects.org/index.php/topic,1832.0.html
CODE
BVRef diskScanBootVolumes( int biosdev, int * countPtr )
{
-    struct DiskBVMap *        map;
+    struct DiskBVMap *        map = NULL;

The variable may be used uninitialized.
13. i386/libsaio/fake_efi.c
CODE
-#include "smbios.h"
+#include "smbios_getters.h"

I need more relations between SMBIOS and EFI.
CODE
+    smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED);    // process smbios asap
+    bool useDMIinfoCPU = true;
+    getBoolForKey("GetCPUfromBIOS", &useDMIinfoCPU, &bootInfo->bootConfig);
+    if (useDMIinfoCPU) {
+        scan_cpu_DMI(); //Platform);
+    }

Here I want to explain more.
For example. Intel Core 2 Duo E6300. Native BusSpeed=266MHz, default CPU speed=266*6=1600MHz. It is very low and I can easy to overclock it.
366*7=2562MHz. But coeff=7 is turbo, MSR inform us about max=6 turbo=7. So what Chameleon will calculate?
TSC speed=2560Mhz ratio=6 and follow FSB=467MHz with following system bugs.
On the other hand, if we took FSB from MSR it will be 266 but not 366 as we set.
Other user report http://forum.voodooprojects.org/index.php/topic,1912.0.html
So I suppose to not calculate CPU and FSB speed and just take them from DMI. So some additional codes in SMBIOS_patcher needed.
CODE
    // Generate efi device strings
+        //Slice - remember globals
+    Platform = (PlatformInfo_t *)gPlatform;
+    root_pci_dev = (pci_dt_t*)gRootPCIDev;
    setup_pci_devs(root_pci_dev);
+    smbios_p = (EFI_PTR32)getSmbios(SMBIOS_ORIGINAL);
+#if DEBUG    
+    verbose("SMBIOS_ORIGINAL=%x \n", smbios_p);
+#endif    
    
-    readSMBIOSInfo(getSmbios(SMBIOS_ORIGINAL));
+    getSmbiosTableStructure((void*)(EFI_PTR32)smbios_p);
+    readSMBIOSInfo((void*)(EFI_PTR32)smbios_p);

+    getSmbiosProductName();
+    getSmbiosMacModel();
+    setupAcpi();

These codes appears to do the work.
14. i386/libsaio/gma.c
CODE
+#include "graphics.h"

Remember globals.
CODE
-uint8_t GMAX3100_vals[22][4] = {
-    { 0x01,0x00,0x00,0x00 },
....
+//Slice - correct all values, still not sure
+uint8_t GMAX3100_vals[23][4] = {
+    { 0x01,0x00,0x00,0x00 },    //0 "AAPL,HasPanel"

I correct these values according to my working X3100.
CODE
+        devprop_add_value(device, "AAPL01,DualLink", &gDualLink, 1);        //GMAX3100_vals[10]

As calculated by Resolution module.
CODE
+//        devprop_add_value(device, "AAPL01,InverterCurrency",GMAX3100_vals[15], 4);

What is the Currency?
15. i386/libsaio/hfs.c
CODE
-    verbose("Read HFS%s file: [%s/%s] %d bytes.\n",
-            (gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length);
+//    verbose("Read HFS%s file: [%s/%s] %d bytes.\n",
+//            (gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length);

I consider this as a main patch to Chameleon smile.gif
I do not want to see 200 lines about loading kexts in IgnoreCache mode. 5 minutes to see them !!!
16. i386/libsaio/msdos.c
CODE
-    verbose("Read FAT%d file: [%s/%s] %d bytes.\n",
-            msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread);
+//    verbose("Read FAT%d file: [%s/%s] %d bytes.\n",
+//            msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread);

Same here.
17. i386/libsaio/nvidia.c
CODE
-static uint8_t default_dcfg_0[]        =    {0xff, 0xff, 0xff, 0xff};
-static uint8_t default_dcfg_1[]        =    {0xff, 0xff, 0xff, 0xff};
+static uint8_t default_dcfg_0[]= {0x03, 0x01, 0x03, 0x00};
+static uint8_t default_dcfg_1[]= {0xff, 0xff, 0x00, 0x01};

Default values should be reliable for users who can't set own values.
CODE
+static uint8_t default_NVPM[]= {
+    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00
+};

This is useful setting.
CODE
+    delay(50);

Wait for PCI bus.
18. i386/libsaio/pci.c
CODE
+            new->subclass                = pci_config_read8(pci_addr, PCI_CLASS_PROG);

I want to see more info about PCI devices.
CODE
+    
+    if (!root_pci_dev)
+        return;
+    gRootPCIDev = (void*)root_pci_dev;

Safety. The reason is losing pci pointer in some cases.
CODE
-        printf("%02x:%02x.%x [%04x] [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
+        msglog("%02x:%02x.%x [%04x%02x] [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
            current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func,
-            current->class_id, current->vendor_id, current->device_id,
+               current->class_id, current->subclass, current->vendor_id, current->device_id,

Dump more PCI infos.
19. i386/libsaio/pci.h
CODE
-    }                        subsys_id;
-
+    }subsys_id;
+    uint8_t        revision;
+    uint8_t        subclass;

Required change in definition.
20. i386/libsaio/pci_setup.c
CODE
+uint16_t vgaVendor;
......
-                    switch (current->vendor_id)
+                {
+                    vgaVendor = current->vendor_id;
+                    switch (vgaVendor)
                    {

The variable needed for SMBIOS patch.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Slice
post Jul 22 2011, 08:06 PM
Post #119
Continue.
21. i386/libsaio/platform.c
CODE
void scan_platform(void)
{
-    memset(&Platform, 0, sizeof(Platform));
+    Platform = malloc(sizeof(PlatformInfo_t));
+    memset(Platform, 0, sizeof(PlatformInfo_t));
+    gPlatform = (void*)Platform;

As I already mentioned I want to make Platform structure is dynamically allocated.
22. i386/libsaio/platform.h
CODE
+extern void scan_cpu();
+
+#define bit(n)            (1ULL << (n))
+#define bitmask(h,l)        ((bit(h)|(bit(h)-1)) & ~(bit(l)-1))
+#define bitfield(x,h,l)        (((x) & bitmask(h,l)) >> l)
+#define MEGA 1000000LL

defined here instead of two places.
CODE
+        float            MaxRatio;        // non-integer ratio    
+        float            MinRatio;
+        float            CurrRatio;                
        uint64_t        TSCFrequency;            // TSC Frequency Hz
        uint64_t        FSBFrequency;            // FSB Frequency Hz
        uint64_t        CPUFrequency;            // CPU Frequency Hz
-        uint32_t        MaxRatio;                // Max Bus Ratio
-        uint32_t        MinRatio;                // Min Bus Ratio
+        bool            Mobile;                    // Mobile CPU

Ratio may be non-integer.
CODE
-extern PlatformInfo_t Platform;
+extern PlatformInfo_t* Platform;

Now it is a pointer.
23. i386/libsaio/smbios.c
CODE
#define kDefaultMacBook                                "MacBook4,1"
-#define kDefaultMacBookBIOSVersion                    "    MB41.88Z.0073.B00.0903051113"
+#define kDefaultMacBookBIOSVersion                    "    MB41.88Z.0073.B00.0809221748"

Some default values corrected
CODE
+#define MAX_DMI_TABLES 255
+typedef struct DmiNumAssocTag {
+    SMBStructHeader* dmi;
+    uint8_t type;
+} DmiNumAssoc;
+
+static DmiNumAssoc DmiTablePair[MAX_DMI_TABLES];
+static int DmiTablePairCount = 0;
+static int current_pos=0;
+static bool ftTablePairInit = true; //use twice first run and after

New structures and variables to do smbios patching.
CODE
+void getSmbiosTableStructure(struct SMBEntryPoint *smbios)
+{
...

and so on...
CODE
-    if (platformCPUFeature(CPU_FEATURE_MOBILE))
+    if (Platform->Type == 2)        //platformCPUFeature(CPU_FEATURE_MOBILE))
    {

Platform mobility must not be related to CPU mobility but Enclosure type because there are Books with desktop CPU and iMacs with mobile CPU.
CODE
-        if (Platform.CPU.NoCores > 1)
+        if (vgaVendor != PCI_VENDOR_ID_INTEL) //Slice

Choice between MacBook and MacBookPro. It is not Nr of Cores b/c MacBook4,1 (which is default) has Core 2 Duo T8200 with 2 cores.
CODE
void addSMBOemProcessorBusSpeed(SMBStructPtrs *structPtr)
{
...
                default:
-                    return;
+                    tmp = (Platform->CPU.FSBFrequency * 4) / MEGA;
+                    break;
+                    //return;
            }

This is defined in AppleSMBIOS http://opensource.apple.com
CODE
+            case kSMBTypeSystemEnclosure:
+                tmp = ((SMBSystemEnclosure *)structHeader)->type;
+                Platform->Type = (tmp >=8)?2:1;
+                break;
+            case kSMBTypeProcessorInformation:
+                tmpW = ((SMBProcessorInformation *)structHeader)->externalClock;
+                Platform->CPU.FSBFrequency = tmpW * MEGA + (tmpW & 7) * 110000; //According to Intel 133->133.33MHz
+                tmpW = ((SMBProcessorInformation *)structHeader)->currentClock;
+                Platform->CPU.CPUFrequency = tmpW * MEGA + (tmpW & 7) * 110000;
+                msglog("From SMBIOS: FSB=%d CPU=%d\n", Platform->CPU.FSBFrequency, Platform->CPU.CPUFrequency);
+                break;
+

Took values from original SMBIOS.
24. i386/libsaio/smbios_decode.c
CODE
-    DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version));
+//    DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version));

These values are not printable and mess debug and bdmesg.
25. i386/libsaio/smbios_getters.c
CODE
+//Slice - for ACPI patcher templates
+int        ModelLength = 0;
+char    MacModel[8] = "MacBook";
+unsigned int ModelRev = 0x00010001;
+uint64_t smbios_p;
+char*    gSMBIOSBoardModel;

Data exchange with ACPIpatcher.
CODE
bool getSMBOemProcessorBusSpeed(returnType *value)
{
.......
                    case CPU_MODEL_YONAH:        // Intel Mobile Core Solo, Duo
                    case CPU_MODEL_MEROM:        // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx
                    case CPU_MODEL_PENRYN:        // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx
                    case CPU_MODEL_ATOM:        // Intel Atom (45nm)
-                        return false;
+                        value->word = ((Platform->CPU.FSBFrequency * 4)/1000000); //Slice
+                        return true;

Double.
CODE
                    case CPU_MODEL_WESTMERE_EX:    // Intel Xeon E7
+                    case CPU_MODEL_SANDY:
+                    case CPU_MODEL_SANDY_XEON:    
                    {
                        // thanks to dgobe for i3/i5/i7 bus speed detection

Why not?
CODE
+void getSmbiosMacModel(void)
+{
+#define MAX_MODEL_LEN    32
+    
+    //Slice - I want to use MacModel for ACPITables so I need char* representation

Calculated here.
CODE
+void getSmbiosProductName()
+{
........
+        strncpy(gSMBIOSBoardModel, tempString, tmpLen);
+        Node* node = DT__FindNode("/", false);
+        DT__AddProperty(node, "orig-model", tmpLen, gSMBIOSBoardModel);
+    }
+    verbose("Actual model name is '%s'\n", tempString);
+}

Nice cosmetic from other chameleon codes.
CODE
+void scan_cpu_DMI(void) //PlatformInfo_t *p)
+{
........
+            Platform->CPU.FSBFrequency = (cpuInfo->externalClock) * MEGA;
...
+            Platform->CPU.CPUFrequency = cpuInfo->currentClock * MEGA;
....
+            Platform->CPU.NoCores = cpuInfo->coreCount;
...
+            Platform->CPU.NoThreads = cpuInfo->Threads;

Instead of scan_cpu calculations.
26. i386/libsaio/sys.c
CODE
+// zef - ramdisk variables
+extern BVRef  gRAMDiskVolume;
+extern bool   gRAMDiskBTAliased;
+
...
+            // turbo - bt(0,0) hook
+            if ((dp->biosdev + unit) == 0x101) {
+                // zef - use the ramdisk if available and the alias is active.
+                if (gRAMDiskVolume != NULL && gRAMDiskBTAliased) {
+                    bvr = gRAMDiskVolume;
+                } else {
+                    bvr = gBIOSBootVolume;
+                }
+            } else {
            bvr = newBootVolumeRef(dp->biosdev + unit, partition);
+            }
...
-        bvr = newBootVolumeRef(biosdev, part);
+
+        // turbo - bt(0,0) hook
+        if (biosdev == 0x101)
+        {
+          // zef - use the ramdisk if available and the alias is active.
+          if (gRAMDiskVolume != NULL && gRAMDiskBTAliased)
+            bvr = gRAMDiskVolume;
+          else
+            bvr = gBIOSBootVolume;
+        }
+        else
+        {
+            bvr = newBootVolumeRef(biosdev, part);
+        }

Don't know about this codes. I found it in some other branch.
27. i386/libsaio/xml.c
CODE
+    TagPtr tmpTag;
...
-    TagPtr tmpTag = NewTag();
+    tmpTag = NewTag();
...
-        tmpTag = NewTag();

In this algo I reorder assignment to aviod losing pointers and uninitialized variables.


Also I am experimenting with modules from meklort, cparm, azimutz but still no news. Only Resolution is working.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
nobb1x
post Jul 26 2011, 10:20 AM
Post #120
hello, i'm trying rev1208 with lion. i get a immediate reset after the initial loading,i tried erasing cache,with -x,with -f, with no changes. currently i'm using a usb stick for boot and the bootloader is installed on it.
Using -v i can see (until it reboot)

(...smbios infos...)
Actual modelname is 'N/A
/ (i see some activity on the hdd)
Starting darwin kernel (immediate reboot)
the smbios infos appear as parsed correctly,cpu recognized too with correct clock.

my system (a laptop) boot ok with chameleon v1187.

this is the Extra folder i use with the loader.

Attached File  Extra.zip ( 512.5K ) Number of downloads: 16


fakesmc and ps2 support are on S/L/E.

8 Pages V  « < 4 5 6 7 8 >
ClosedStart a new topic
4 User(s) are reading this topic (4 Guests and 0 Anonymous Users)
0 Members: