MacBookPro

From PardusWiki
(Difference between revisions)
Jump to: navigation, search
Line 43: Line 43:
 
Change that line below;
 
Change that line below;
  
  Driver    "nvidia"
+
  Driver    "nv"
  
 
to
 
to
Line 90: Line 90:
 
         if (!strcmp(argv[1],"minus"))
 
         if (!strcmp(argv[1],"minus"))
 
             new = limited(current - 10);
 
             new = limited(current - 10);
 +
        if (!strcmp(argv[1],"set") && argc==3)
 +
            new = limited((int)argv[2]);
 
         printf("New : %d\n",new);
 
         printf("New : %d\n",new);
 
         fprintf(fp,"%d",new);
 
         fprintf(fp,"%d",new);
Line 95: Line 97:
 
     else printf("Usage : %s plus or minus\n",argv[0]);
 
     else printf("Usage : %s plus or minus\n",argv[0]);
 
     fclose(fp);
 
     fclose(fp);
 +
    return 0;
 +
}
 +
 +
=== LCD Backlight Settings ===
 +
You can use the following C code with ''gcc -O2 -o setbrigth setbright.c''
 +
 +
#include <stdio.h>
 +
#include <sys/io.h>
 +
#include <stdlib.h>
 +
#include <string.h>
 +
 +
int limited(int inp) {
 +
    if (inp<0) return 0;
 +
    if (inp>15) return 15;
 +
    return inp;
 +
}
 +
 +
int main(int argc, char *argv[]) {
 +
    int new;
 +
    if (ioperm(0xB2, 0xB3, 1) < 0) {
 +
        perror("ioperm failed (you should be root).");
 +
        exit(1);
 +
    }
 +
    outb(0x03, 0xB3);
 +
    outb(0xBF, 0xB2);
 +
    char t = inb(0xB3) >> 4;
 +
    new = t;
 +
    printf("Current: %d\n",new);
 +
    if (argc >= 2) {
 +
        if (!strcmp(argv[1],"minus"))
 +
            new = limited(t - 1);
 +
        if (!strcmp(argv[1],"plus"))
 +
            new = limited(t + 1);
 +
        if (!strcmp(argv[1],"set") && argc == 3)
 +
            new = limited(atoi(argv[2]));
 +
        printf("New: %d\n",new);
 +
        outb(0x04 | (new << 4), 0xB3);
 +
        outb(0xBF, 0xB2);
 +
    }
 +
    else printf("Usage : %s plus or minus\n",argv[0]);
 
     return 0;
 
     return 0;
 
  }
 
  }

Revision as of 07:46, 9 October 2007

Template:Draft

This article tries to tell how to install Pardus to MacBook Pro 3rd. (Santa Rosa, Nvidia GPU) gen.

Contents

Preparation

For installing dual boot with MacOSX and Pardus you can resize your disk and get free spaces for Pardus installation; there is a tool "diskutil" in MacOSX, but don't forget it is not a toy - you can lose your datas -

Getting Disk Informations

$ diskutil resizeVolume disk1s2 limits
For device disk1s2 USB1:
       Current size:   99686268928 bytes
       Minimum size:   1118990336 bytes
       Maximum size:   99686268928 bytes

It shows (with limits option) you can resize your current disk at least 11~GB. So for resizing it as 75GB;

$ diskutil resizeVolume disk1s2 75G
Started resizing on disk disk1s2 USB
Verifying
Resizing Volume
Adjusting Partitions

Finished resizing on disk disk1s2 USB
WARNING: You must now reboot!

After that you must have a 25G free space on your hard drive.

For mulit boot you also need to install a boot manager from your current Mac OSX. You can use rEFIt, follow the instructions on the project site.After installing rEFIt you can use any bootable device (usb-disk,cd-rom etc.) to boot your MacBook Pro.

Installation

Current Pardus Releases (2007, 2007.1, 2007.2) doesn't support this hardware for basic installation; beacuse of new Nvidia card (8600m GT) but you an use "vesa" driver instead of "nv".To do that boot with 2007.2 CD then;

When black screen appears press "Ctrl+Alt+F1" the you should see a terminal screen. Before changing the driver you must stop yali;

# service yali stop

Now you can edit "/etc/X11/xorg.conf" with nano;

# nano /etc/X11/xorg.conf

Change that line below;

Driver     "nv"

to

Driver     "vesa"

Save and exit and then restart the YALI..

# service yali start

Then installation will begin.. Install Pardus as you wish, but don't erase the first two partition (first one is refit, second one macosx) and dont forget to install bootloader to pardus installed partition.

Configuring

....

Utils

You will need some utilities to use your MacBook Pro efficiently..

Keyboard Light Setting

You can use the following C code with gcc -o setkeybright setkeybright.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TARGET "/sys/devices/platform/applesmc/leds:smc:kbd_backlight/brightness"

int limited(int inp) {
    if (inp<0) return 0;
    if (inp>255) return 255;
    return inp;
}

int main(int argc, char *argv[]) {
    int current,new;
    char tempC[10];
    FILE *fp = fopen(TARGET,"r");
    fread(tempC,4,1,fp);
    fclose(fp);
    fp = fopen(TARGET,"w");
    current=atoi(tempC);
    printf("Current : %d\n",current);
    if (argc==2) {
        if (!strcmp(argv[1],"plus"))
            new = limited(current + 10);
        if (!strcmp(argv[1],"minus"))
            new = limited(current - 10);
        if (!strcmp(argv[1],"set") && argc==3)
            new = limited((int)argv[2]);
        printf("New : %d\n",new);
        fprintf(fp,"%d",new);
    }
    else printf("Usage : %s plus or minus\n",argv[0]);
    fclose(fp);
    return 0;
}

LCD Backlight Settings

You can use the following C code with gcc -O2 -o setbrigth setbright.c

#include <stdio.h>
#include <sys/io.h>
#include <stdlib.h>
#include <string.h>

int limited(int inp) {
    if (inp<0) return 0;
    if (inp>15) return 15;
    return inp;
}

int main(int argc, char *argv[]) {
    int new;
    if (ioperm(0xB2, 0xB3, 1) < 0) {
        perror("ioperm failed (you should be root).");
        exit(1);
    }
    outb(0x03, 0xB3);
    outb(0xBF, 0xB2);
    char t = inb(0xB3) >> 4;
    new = t;
    printf("Current: %d\n",new);
    if (argc >= 2) {
        if (!strcmp(argv[1],"minus"))
            new = limited(t - 1);
        if (!strcmp(argv[1],"plus"))
            new = limited(t + 1);
        if (!strcmp(argv[1],"set") && argc == 3)
            new = limited(atoi(argv[2]));
        printf("New: %d\n",new);
        outb(0x04 | (new << 4), 0xB3);
        outb(0xBF, 0xB2);
    }
    else printf("Usage : %s plus or minus\n",argv[0]);
    return 0;
}
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox