2 copy-paste in a Mac Terminal : please contribute to the Linux kernel !

Discussion in 'macOS' started by metatech, Aug 18, 2010.

  1. metatech macrumors newbie

    Joined:
    Mar 2, 2010
    #1
    Hello,

    Can I kindly ask you to run the following command from a Terminal under MacOS X :
    sudo ioreg -lw0 |grep manufacturer|cut -b25-80;sudo ioreg -lw0|grep "product-name"|cut -b 25-80;sudo dtrace -qn 'BEGIN{boot_args=((struct boot_args*)(`PE_state).bootArgs);printf("FrameBufferBase: 0x%08x\nPixelsPerScanLine: %d\nHorizontalResolution: %d\nVerticalResolution: %d", boot_args->Video.v_baseAddr, boot_args->Video.v_rowBytes/4, boot_args->Video.v_width, boot_args->Video.v_height);exit(0)} '

    This command does not change anything to your system, it only reads the low-level EFI video values with the "ioreg" and the "dtrace" command.
    So basically the risk is 0.

    This will allow the "pure EFI boot" on Linux to work "out of the box" (ie without recompiling the Linux kernel) on all Mac models.

    I am sure that with all the Mac passionates on this forum, in a few days we can cover all Apple models...
    Submissions from all Intel-based Mac models are welcome (iMac, MacBook, MacBook Pro, ...).

    On my machine, when the 9400M is active at boot time the output is the following :
    <"Apple Inc.">
    <"MacBookPro5,3">
    FrameBufferBase: 0xd0010000
    PixelsPerScanLine: 2048
    HorizontalResolution: 1440
    VerticalResolution: 900

    On my machine, when the 9600M is active at boot time the output is the following :
    <"Apple Inc.">
    <"MacBookPro5,3">
    FrameBufferBase: 0xc0030000
    PixelsPerScanLine: 2048
    HorizontalResolution: 1440
    VerticalResolution: 900

    If the graphic card is switched after boot time (in "Energy Saving" preference pane or with gfxCardStatus), the FrameBufferBase value does not change anymore, it keeps its previous value.

    Please copy the terminal output on your machine and paste it in a reply to this post !
    As soon as the output is collected for all models, I will consolidate them and submit it as a patch to the Linux kernel.

    Many thanks in advance for your help in this collaborative work !

    Sorry if the thread is "off topic" on this forum, but I could not find a "Linux on Mac" forum...

    metatech

    P.S. : The thread with the original investigation is here :
    http://ubuntuforums.org/showthread.php?t=1076879&page=2
     
  2. RedReplicant macrumors 6502a

    Joined:
    Mar 31, 2010
    #2
    To get what you need we need to run this, instead of what you have
    Code:
    sudo ioreg -lw0|grep "product-name"|cut -b 25-80; sudo dtrace -qn 'BEGIN{printf("FrameBufferBase: 0x%08x\n", ((struct boot_args*)(`PE_state).bootArgs)->Video.v_baseAddr);exit(0)} '
    Anyway, this is my output
    Code:
     <"MacBookPro7,1">
    FrameBufferBase: 0xc0010000
    
    2010 13" MBP w/ Nvidia 330M

    Good luck
     
  3. metatech thread starter macrumors newbie

    Joined:
    Mar 2, 2010
    #3
    Thanks RedReplicant, I fixed the command line in my first post
     
  4. stuarthatto macrumors regular

    Joined:
    Nov 5, 2008
    #4
    <"MacBookPro3,1">
    FrameBufferBase: 0xc0030000
     
  5. Alfihar macrumors member

    Joined:
    Aug 7, 2010
    Location:
    UK
    #5
    <"MacPro1,1">
    FrameBufferBase: 0xe0010000

    EDIT: Not sure if this is relevant or not, but I'm currently running an XFX ATi 4870 1GB graphics card in mine.
     
  6. jimc macrumors newbie

    Joined:
    Oct 26, 2006
    Location:
    Edinburgh, Scotland
    #6
    Code:
     
    <"iMac11,3">
    FrameBufferBase: 0xc0010000
    
    Mid 2010 27" iMac ATI Radeon HD 5750 with 1GB
     
  7. jimc macrumors newbie

    Joined:
    Oct 26, 2006
    Location:
    Edinburgh, Scotland
    #7
    Code:
     
    <"MacBookPro5,1">
    FrameBufferBase: 0xc0010000
    
     
  8. metatech thread starter macrumors newbie

    Joined:
    Mar 2, 2010
    #8
    Thanks RedReplicant, stuarthatto, Alfihar and jimc (x2).
    I will include you in the credits of the kernel patch contribution…

    If you have 2 graphics cards in your machine, can you please tell me which one was activated at boot time ? And which is the "manufacturer" string (see updated command line) ?

    Anyone else with a different machine ??

    Thanks in advance,

    metatech
     
  9. Alfihar macrumors member

    Joined:
    Aug 7, 2010
    Location:
    UK
    #9
    I'd actually forgotten, but I do have two graphics cards installed. How do you know which is active at boot time?
    Both cards should be active, though I don't have anything hooked up to the second card at the moment.
    Though in the past I have, and both are working at boot.

    First card is an XFX ATi HD 4870 1GB, second card is an Apple ATi HD 2600 XT.
    Also of note is that neither card was shipped with the Mac Pro 1,1.


    If this is being done on the model number e.g. Mac Pro 1,1 many of Apples computers are/were able to be ordered with different graphics cards.
     
  10. jimc macrumors newbie

    Joined:
    Oct 26, 2006
    Location:
    Edinburgh, Scotland
    #10
    Had forgotten about having two gfx cards/chips in the MBP. Updated details are


    NVIDIA GeForce 9600M GT (Discrete)
    <"Apple Inc.">
    <"MacBookPro5,1">
    FrameBufferBase: 0xb0030000

    NVIDIA GeForce 9400M (Integrated)
    <"Apple Inc.">
    <"MacBookPro5,1">
    FrameBufferBase: 0xc0010000
     
  11. metatech thread starter macrumors newbie

    Joined:
    Mar 2, 2010
    #11
    jimc,

    You were so nice to do a reboot to get the other address !

    Are there other people with different machines ?

    Thanks !

    metatech
     

Share This Page