Jump to content

STLVNUB

STLVNUB

Member Since 17 Jul 2007
Offline Last Active Private
*****

Posts I've Made

In Topic: Bootcamp on hackintosh

07 April 2014 - 02:44 PM

You can also use the DOS or EFI version of DMIEDIT as it uses a config file which you can edit with your Smbios values.

In Topic: Ozmosis

07 April 2014 - 06:30 AM

Hello,

 

I've made a little soft to integrate dsdt in AmiBoardInfo. (Src include)

Alway use original AmiBoardInfo to patch, don't use a patched AmiBoardInfo. (Because of size... ;) )

 

 

https://www.dropbox....p/Dsdt2Bios.zip

 

Need to be tested.

//
//  main.c
//  Dsdt2Bios
//
//  Created by FredWst on 06/04/2014.
//  Copyright (c) 2014 none. All rights reserved.
//
 
 
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
 
typedef struct Header
{
unsigned char o1;
unsigned char o2;
    unsigned char o3;
unsigned char id[16];
    unsigned char o4;
    unsigned short len;
    
} Struct_Header;
 
 
int main(int argc, const char * argv[])
{
    Struct_Header Header;
    
    int fd_amiboard, fd_dsdt, fd_out, i;
    long len;
    unsigned char *d, *n;
 
    
    fd_amiboard = open("AmiBoardInfo.ffs", O_RDWR | O_NONBLOCK);
    fd_dsdt = open("DSDT.aml", O_RDWR | O_NONBLOCK);
    
    if ((fd_amiboard < 0) || (fd_dsdt < 0))
    {
        printf("File must be name AmiBoardInfo.ffs and DSDT.aml.\n");
        printf("File must be in same directory of Dsdt2Bios.\n");
        printf("Output file will be AmiBoardInfo.new.\n");
        if (fd_amiboard < 0) close(fd_amiboard);
        if (fd_dsdt < 0) close(fd_dsdt);
        
        return 255;
    }
    //Get size of AmiBoardInfo in Header
    len = read(fd_amiboard, &Header, sizeof(Struct_Header));
    close(fd_amiboard);
        
    //Read AmiBoardInfo into buffer
    fd_amiboard = open("AmiBoardInfo.ffs", O_RDWR | O_NONBLOCK);
    d = malloc(Header.len+1);
    len = read(fd_amiboard, d, Header.len+1024);
    close(fd_amiboard);
    printf("AmiBoardInfo file size %x.\n",Header.len);
    
    if (len == Header.len)
    {
    
        //Search for DSDT offset
        for ( i = 0 ; i < Header.len; i++)
            if ((d[i] =='D') && (d[i+1] =='S') && (d[i+2] =='D') && (d[i+3] =='T')) break;
 
        //Size of DSDT
        int Size_Ori = (d[i+5] << 8) + d[i+4];
        int Ofs_Ori = i;
        printf("DSDT found at %x size %x.\n",Ofs_Ori,Size_Ori);
 
        fd_dsdt = open("DSDT.aml", O_RDWR | O_NONBLOCK);
        //Get size of DSDT in Header
        unsigned char buffer[6];
        len = read(fd_dsdt, buffer, 6);
        int Size_New = (buffer[5] << 8) + buffer[4];
        close(fd_dsdt);
    
        if ((buffer[0] =='D') && (buffer[1] =='S') && (buffer[2] =='D') && (buffer[3] =='T'))
        {
        
            //Read DSDT into buffer
            fd_amiboard = open("DSDT.aml", O_RDWR | O_NONBLOCK);
            n = malloc(Size_New+1);
            len = read(fd_amiboard, n, Size_New+1024);
            close(fd_amiboard);
            printf("New DSDT size %x.\n",Size_New);
    
            if (len == Size_New)
            {
                if ( Size_New <= Size_Ori)
                {
                    //Replace with new DSDT
                    memcpy(&d[Ofs_Ori], n, Size_New);
        
                    //Zero end
                    for ( i = Ofs_Ori + Size_New  ; i < (Size_Ori + Ofs_Ori); i++)
                        d[i] = 0;
        
                    fd_out = open("AmiBoardInfo.new", O_CREAT | O_RDWR | O_NONBLOCK );
                    write(fd_out,d,Header.len);
                    close(fd_out);
                    printf("AmiBoardInfo.new is create.\n");
        
                }
                else
                    printf("New DSDT is bigger than original, no file generated.\n");
            }
            else
                printf("Bad file DSDT.aml, header size is not equal to file len, no file generated.\n");
            
            free(n);
        }
        else
            printf("Bad file DSDT.aml, header not ok, no file generated.\n");
    }
    else
        printf("Bad file AmiBoardInfo.ffs, header size is not equal to file len, no file generated.\n");
    
    free(d);
 
 
    return 0;
}

Fred

Can you take this one step further and WRITE the DSDT.aml IF its NOT there and then exit.

This way you can edit said DSDT and re-run to put it back.

Good job...

In Topic: Upgraded Mac Mini 1,1 (Late 2007) with OSX >=10.6?

22 February 2014 - 04:37 AM

You guys needn't touch your firmware, all you need is the 64bit cpu and this

http://forums.macrum...59#post18423059

;)

In Topic: Ozmosis

22 February 2014 - 04:27 AM

Maybe idea to put your Motherboard info in your sig, I take it you have Gigabyte ???

In Topic: GA-Z77-DS3H HD4000 HDMI problem

22 February 2014 - 04:25 AM

you only need this in IGPU
Return (Package (0x04)
                {
                   "AAPL,ig-platform-id", 
                    Buffer (0x04)
                    {
                         0x05, 0x00, 0x62, 0x01
                    }, 
                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
should FIX resolution change ;)
© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy