Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50

Thread: Experiments in refit shell to enable 9400M on MBP 5,1

  1. #1
    Join Date
    Jan 2009
    Beans
    320
    Distro
    Ubuntu Development Release

    Experiments in refit shell to enable 9400M on MBP 5,1

    So I've been experimenting with the refit shell to see if its possible to enable the 9400M instead of the 9600M GT.

    The refit shell is part of the standard refit installation and you can load it by choosing the little terminal icon from the refit menu when you first boot. The following will walk you through using the shell to try and activate the 9400M on the MBP 5,1.

    <disclaimer>Warning: If you are not very familiar with things like hex editors and low level stuff, or if you are just careless, you could mess with your EFI in a bad way, so please proceed with caution (if you are careful and know what you're doing it is perfectly safe).</disclaimer>.

    First thing to know if you're using the shell is that most shell commands can take the option -b which means to break each output page. They all also take the option -? which means to show a help page about the command. ie. from the refit shell do:

    Code:
    help -? -b
    to get info about the help command or you can just do

    Code:
    help -b
    which will show you all the different commands the shell supports. The first one to look at is

    Code:
    pci -b
    which will show us that we can see both display controllers (9400 & 9600) with pci id's 00 02 00 00 and 00 03 00 00 respectively.

    If we do

    Code:
    pci 00 02 00 -i
    we find that the 9400M just has 0xFF for all values, and so I think is not power up maybe, whereas the 9600M GT has some sane information.

    The next thing we can do is get a list of all the efi devices:

    Code:
    devices -b
    Which again lists the 2 video controllers with handles e5 and e7 respectively. You can get some more info by doing:

    Code:
    dh -b e5
    and same for e7 - this seems to show that handle e7 is being used as the active graphics card (which is the 9600M GT from what I can tell).

    Next we can see all the EFI variables with

    Code:
    dmpstore -b
    and there are 2 pretty interesting ones there - gpu-power-prefs and LEGACYVGAHANDLE. If you look carefully you'll notice that the value of LEGACYVGAHANDLE (on my machine it is 18 4A 6D 7E 00 00 00 00 - where the first 4 bytes are the same as the handle shown when you do a dh -b e7 - 7E6D4A18 - but just in reverse byte order since it's little endian). The other thing to note is that gpu-power-prefs is stored in NVRAM (indicated by the NV) whereas LEGACYVGAHANDLE is not, and from what I've been able to gather LEGACYVGAHANDLE gets set as a result of the value of gpu-power-prefs. The default value of gpu-power-prefs is 01 00 00 00 (ie 1) and I've been experimenting with different values to see if we can get the 9400M powered up at boot (since I assume it is powered down normally).

    You can use dmpstore to save a variable to a file or to load a variable from a file, so we can use this to change the values of these variables. So try something like the following to save the original value of gpu-power-prefs to a file and edit a copy of the file to set a new value from:

    Code:
    dmpstore gpu-power-prefs -s fs0:\gpu-power-prefs.orig
    cp fs0:\gpu-power-prefs.orig fs0:\gpu-power-prefs
    hexedit fs0:\gpu-power-prefs
    now change the 01 00 00 00 and the end of the file to 00 00 00 00 (ie effectively change the value from 1 to 0). You can check that you didn't make any major screwups by doing a:

    Code:
    comp fs0:\gpu-power-prefs.orig fs0:\gpu-power-prefs
    and it should show just a single byte change from 01 to 00.

    We can now set the value of gpu-power-prefs to our new value by using dmpstore again:

    Code:
    dmpstore gpu-power-prefs -l fs0:\gpu-power-prefs
    So with this new value you can exit the shell and power on and off the machine. Now go back into the shell and do a dmpstore gpu-power-prefs and you'll see its got your new value of 00 00 00 00 AND if you do a dmpstore legacyvgahandle you can see the handle should now be changed to that of the device e5 (ie the 9400M) instead of the device e7 (the 9600M GT).

    So at this point it looks like we've got the 9400M enabled as the legacy mode GPU - YAY - BUT unfortunately though when I then go and boot into Ubuntu it still only lists the 9600M GT and there is still no sign of the 9400M.

    So after all that I still can't seem to get it to use the 9400M over the 9600M GT - I've posted the instructions here though in case anyone else can get further with it or wants to experiment more.
    Last edited by alexmurray; February 23rd, 2009 at 12:01 AM. Reason: Added info about refit shell and warning for unfamiliar users

  2. #2
    Join Date
    Apr 2006
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Quote Originally Posted by alexmurray View Post
    So I've been experimenting with the refit shell to see if its possible to enable the 9400M instead of the 9600M GT.


    So after all that I still can't seem to get it to use the 9400M over the 9600M GT - I've posted the instructions here though in case anyone else can get further with it or wants to experiment more.
    Hi, very interesting/useful.

    Question - is grub legacy pc-bios ubuntu linux boot actually using EFI legacyvgahandle.

    But thanks for the info on using EFI shell, can use some of that to look at grub.efi booting video and other issues. I have only single video display MBP4,1/iMac8.1, not much help for your topic,

  3. #3
    Join Date
    Feb 2009
    Beans
    5
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Interesting thread. I got MB 5.1 (not pro). I think I might be having only one graphics card?

    One thing I wanted to ask - where do the commands "pci" and "devices" come from?
    I don't have them by default. I searched for them with the Synaptic thing and it returned way too much stuff...

  4. #4
    Join Date
    Jan 2009
    Beans
    320
    Distro
    Ubuntu Development Release

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    The commands are in the refit shell - not in Ubuntu - if you've got refit installed, when you power on, instead of selecting Linux to boot, choose the little terminal icon on the second row which will drop you into the refit shell.

  5. #5
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Quote Originally Posted by pxwpxw View Post
    Question - is grub legacy pc-bios ubuntu linux boot actually using EFI legacyvgahandle.
    This is what I was thinking too. It may be that the legacy loader ignores these, or even sets them "appropriately" when it is activated.

    I bet if you boot from EFI that Alex's method would work. You might at least be able to get to a commandline and do lspci to see if the device is seen in Linux (that is if you have a working keyboard).

    Quote Originally Posted by pxwpxw View Post
    But thanks for the info on using EFI shell, can use some of that to look at grub.efi booting video and other issues. I have only single video display MBP4,1/iMac8.1, not much help for your topic,
    and on that note, I wanted to point out that there is a command to change the resolution in the efi terminal, so you can see a bit more at once.

    Quote Originally Posted by alexmurray View Post
    The commands are in the refit shell - not in Ubuntu - if you've got refit installed, when you power on, instead of selecting Linux to boot, choose the little terminal icon on the second row which will drop you into the refit shell.
    Yes, and I think that a warning is in order to users that do not know what they are doing. If you are not careful, you may be able to change some EFI variable that causes problems with your machine. Happy Hacking.

  6. #6
    Join Date
    Dec 2005
    Location
    Greece
    Beans
    436

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Great experiment. Hopefully it will be useful at some point.

    Quote Originally Posted by alexmurray View Post
    The commands are in the refit shell - not in Ubuntu - if you've got refit installed, when you power on, instead of selecting Linux to boot, choose the little terminal icon on the second row which will drop you into the refit shell.
    I can't see any terminal icon!? Out of my memory I have only OSX, Linux and on the bottom row there are 4 icons. The terminal is missing. I 've checked the refit.conf file and there is no disabled shell option or similar.

    Is it supposed to appear by default?

    Cheers, Nikos

  7. #7
    Join Date
    Dec 2005
    Location
    Greece
    Beans
    436

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Interesting: ...switch between graphics processors on the "Unibody" MacBook Pro without restarting?

    http://i.gizmodo.com/5067433/confirm...in-macbook-pro

    [...]
    It can support up to 8GB of RAM. It can do on-the-fly GPU switching. And it can work together with the MacBook Pro's discrete 9600M GT. But it doesn't do any of those things. Yet.
    [...]
    But since it's Apple it's also entirely possible we'll never see any of this to come to pass...
    [...]
    Imagine that Linux can make the break-through Imagine that Linux will make the break-through

    Common, let's set-up a project to attract dev's on it. There are many geeks who like apple-machines out there.

    Cheers, Nikos
    ---

    Look also at http://www.everymac.com/systems/appl...rocessors.html

  8. #8
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Quote Originally Posted by Nikos.Alexandris View Post
    Interesting: ...switch between graphics processors on the "Unibody" MacBook Pro without restarting?

    http://i.gizmodo.com/5067433/confirm...in-macbook-pro



    Imagine that Linux can make the break-through Imagine that Linux will make the break-through

    Common, let's set-up a project to attract dev's on it. There are many geeks who like apple-machines out there.

    Cheers, Nikos
    ---

    Look also at http://www.everymac.com/systems/appl...rocessors.html
    I think that it will not be possible in legacy OS mode. You will need to boot Ubuntu via EFI. See the EFI booting thread. We have made quite a bit of progress there...

  9. #9
    Join Date
    Dec 2005
    Location
    Greece
    Beans
    436

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Quote Originally Posted by cyberdork33 View Post
    I think that it will not be possible in legacy OS mode. You will need to boot Ubuntu via EFI. See the EFI booting thread. We have made quite a bit of progress there...
    Well, yes whatever will work

  10. #10
    Join Date
    Oct 2009
    Beans
    1

    Re: Experiments in refit shell to enable 9400M on MBP 5,1

    Hi to all, is there any progress on this problem ?
    My experiments finished at the point, when I was starting ubuntu after enabling 9400 GPU through rEfi.
    I noticed some interesting things:
    1. changing 'gpu-power-prefs' to my 9400 value, after that 'dmpstore legacyvgahandle' shows my 9400 value
    a) when I run rEfit shell -> than exit rEfit shell -> than try from menu linux lounch -> it stucks, nothing happens and macbook freeze with rEfit pinguins image.
    b) when I run linux from menu, skiping rEfit shell -> than ubuntu starting OK
    2. changing 'gpu-power-prefs' to my 9600 value, after that 'dmpstore legacyvgahandle' shows my 9600 value
    a) when I run rEfit shell -> than exit rEfit shell -> than try from menu linux lounch -> it stucks, nothing happens, but macbook freeze with black screen, like when we boot linux.
    b) when I run linux from menu, skiping rEfit shell -> than ubuntu starting OK

    From that results, I'm thinking that rEfit uses another values than our values which we changing through rEfit shell, because in two cases we stuck, and in other two cases we run ubuntu without any problems.
    But when we look at cases when we stuck, we can result that in one case was more progress than in other.

    I think need to dig in refit startup, when I'll have time, I would look. And for purity of experiment I whant to reinstall rEfit, because I could corrupt something in the past - I must satisfy that linux stucks after we run rEfit shell.


    MBP 5.2, rEfit 0.13

Page 1 of 5 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •