Page 49 of 123 FirstFirst ... 3947484950515999 ... LastLast
Results 481 to 490 of 1226

Thread: grub2 EFI boot loader internal/external booting

  1. #481
    Join Date
    Mar 2008
    Location
    In a fantasy land
    Beans
    96
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: grub2 EFI boot loader internal/external booting

    Oh, I also have a quick little script for getting the latest version... check attachment.
    EDIT: Before using... read the comments (goes without saying).
    Attached Files Attached Files
    Last edited by shadowdude1794; March 24th, 2009 at 07:24 AM.

  2. #482
    Join Date
    Mar 2008
    Location
    In a fantasy land
    Beans
    96
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: grub2 EFI boot loader internal/external booting

    Also, I got bored and edited the wiki. I added on an example file of a grub.cfg, as well as cleaned up some things.

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

    Re: grub2 EFI boot loader internal/external booting

    Quote Originally Posted by shadowdude1794 View Post
    What is the status on the macbook4,1 drivers (intel gma x3100)?
    I think it is all covered at rev 2036, not sure how far you got.. I have to checkout 2036 myself. EDIT 2043 now.

    links -

    bean123 #453
    http://ubuntuforums.org/showpost.php...&postcount=453
    -----
    loadrom.diff was an addon
    http://lists.gnu.org/archive/html/gr.../msg00314.html
    -------
    Updated grub wiki
    http://grub.enbug.org/TestingOnMacbook
    --------
    SVN rev 2036 last related change by bean.
    http://svn.savannah.gnu.org/viewvc?v...&revision=2036
    boot module replaced by minicmd.
    -----------------------
    Last edited by pxwpxw; March 24th, 2009 at 12:11 PM.

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

    Re: grub2 EFI boot loader internal/external booting

    svn rev 2043 patched loadrom.diff on imac81 x86_64 with ati fglrx.

    I find loadrom needs time when called in menuentry, otherwise linux load fails or loadrom fails. So I had to use sleep.
    Then it works very nicely with agp.
    Code:
    insmod sleep
    
    menuentry "loadrom hd0,4 sda4" {
    	search --set /ivt.bin
    	loadrom /bios.bin /ivt.bin
    	sleep 1
    	root=hd0,4
    	linux /vmlinuz root=/dev/sda4 video=vesafb
    	initrd /initrd.img
    }
    This is not apparent from command line with manual entry pauses.
    ---------------------
    Also posted on grub-devel list.
    Last edited by pxwpxw; March 24th, 2009 at 03:24 PM.

  5. #485
    Join Date
    May 2007
    Beans
    465

    Re: grub2 EFI boot loader internal/external booting

    Hi,

    I have discovered the cause for screen distortion for intel agp driver. It's in drivers/char/agp/intel-agp.c, inside intel_i965_driver structure:

    Code:
    static const struct agp_bridge_driver intel_i965_driver = {
            .owner                  = THIS_MODULE,
            .aperture_sizes         = intel_i830_sizes,
            .size_type              = FIXED_APER_SIZE,
            .num_aperture_sizes     = 4,
            .needs_scratch_page     = true,
            .configure              = intel_i915_configure,
            .fetch_size             = intel_i9xx_fetch_size,
            .cleanup                = intel_i915_cleanup,
            .tlb_flush              = intel_i810_tlbflush,
            .mask_memory            = intel_i965_mask_memory,
            .masks                  = intel_i810_masks,
            .agp_enable             = intel_i810_agp_enable,
            .cache_flush            = global_cache_flush,
            .create_gatt_table      = intel_i965_create_gatt_table,
            .free_gatt_table        = intel_i830_free_gatt_table,
            .insert_memory          = intel_i915_insert_entries,
            .remove_memory          = intel_i915_remove_entries,
            .alloc_by_type          = intel_i830_alloc_by_type,
            .free_by_type           = intel_i810_free_by_type,
            .agp_alloc_page         = agp_generic_alloc_page,
            .agp_destroy_page       = agp_generic_destroy_page,
            .agp_type_to_mask_type  = intel_i830_type_to_mask_type,
            .chipset_flush          = intel_i915_chipset_flush,
    };
    Remove .needs_scratch_page = true and recompile. The reason is that in bios mode, there is a 4K BIOS popup space, which doesn't exists in efi. Setting needs_scratch_page to true would mess up the gart table and therefore the screen. With this line gone, I can boot smoothly into console mode, although the x.org driver still needs to read bios, so loadbios is required as before.

    Besides intel_i965_driver, intel_810_driver,intel_830_driver,intel_915_driver ,intel_g33_driver all have needs_scratch_page set, others having such chipset can test if changing its value to false can solve the screen problem.

    BTW, even without needs_scratch_page, bios mode boots ok.
    Last edited by bean123; March 24th, 2009 at 04:09 PM.

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

    Re: grub2 EFI boot loader internal/external booting

    Quote Originally Posted by pxwpxw View Post
    I think it is all covered at rev 2036, not sure how far you got.. I have to checkout 2036 myself. EDIT 2043 now.

    links -

    bean123 #453
    http://ubuntuforums.org/showpost.php...&postcount=453
    -----
    loadrom.diff was an addon
    http://lists.gnu.org/archive/html/gr.../msg00314.html
    -------
    Updated grub wiki
    http://grub.enbug.org/TestingOnMacbook
    --------
    SVN rev 2036 last related change by bean.
    http://svn.savannah.gnu.org/viewvc?v...&revision=2036
    boot module replaced by minicmd.
    -----------------------
    just to summarize.

    You need to get the bios.bin and ivt.bin in legacy mode, and put them on the file system, then load them in grub-efi with the loadrom command before loading kernel/initrd and booting. Correct?

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

    Re: grub2 EFI boot loader internal/external booting

    Quote Originally Posted by cyberdork33 View Post
    just to summarize.

    You need to get the bios.bin and ivt.bin in legacy mode, and put them on the file system, then load them in grub-efi with the loadrom command before loading kernel/initrd and booting. Correct?
    Yes thats right, details in previous posts or in the greb-devel link above. Does need a short summary. Works for agp on the imac81 radeon fglrx, not the mbp41 nvidia.
    EDIT I mean effective for agp ....
    Last edited by pxwpxw; March 24th, 2009 at 04:58 PM. Reason: effective

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

    Re: grub2 EFI boot loader internal/external booting

    Quote Originally Posted by bean123 View Post
    Hi,

    I have discovered the cause for screen distortion for intel agp driver. It's in drivers/char/agp/intel-agp.c, inside intel_i965_driver structure:

    Code:
    static const struct agp_bridge_driver intel_i965_driver = {
            .owner                  = THIS_MODULE,
            .aperture_sizes         = intel_i830_sizes,
            .size_type              = FIXED_APER_SIZE,
            .num_aperture_sizes     = 4,
            .needs_scratch_page     = true,
            .configure              = intel_i915_configure,
            .fetch_size             = intel_i9xx_fetch_size,
            .cleanup                = intel_i915_cleanup,
            .tlb_flush              = intel_i810_tlbflush,
            .mask_memory            = intel_i965_mask_memory,
            .masks                  = intel_i810_masks,
            .agp_enable             = intel_i810_agp_enable,
            .cache_flush            = global_cache_flush,
            .create_gatt_table      = intel_i965_create_gatt_table,
            .free_gatt_table        = intel_i830_free_gatt_table,
            .insert_memory          = intel_i915_insert_entries,
            .remove_memory          = intel_i915_remove_entries,
            .alloc_by_type          = intel_i830_alloc_by_type,
            .free_by_type           = intel_i810_free_by_type,
            .agp_alloc_page         = agp_generic_alloc_page,
            .agp_destroy_page       = agp_generic_destroy_page,
            .agp_type_to_mask_type  = intel_i830_type_to_mask_type,
            .chipset_flush          = intel_i915_chipset_flush,
    };
    Remove .needs_scratch_page = true and recompile. The reason is that in bios mode, there is a 4K BIOS popup space, which doesn't exists in efi. Setting needs_scratch_page to true would mess up the gart table and therefore the screen. With this line gone, I can boot smoothly into console mode, although the x.org driver still needs to read bios, so loadbios is required as before.

    Besides intel_i965_driver, intel_810_driver,intel_830_driver,intel_915_driver ,intel_g33_driver all have needs_scratch_page set, others having such chipset can test if changing its value to false can solve the screen problem.

    BTW, even without needs_scratch_page, bios mode boots ok.
    Thanks, but

    I cant find it, wheres the source?
    Tried -
    xf86-video-intel-2.6.99.902
    http://cgit.freedesktop.org/xorg/dri...6-video-intel/

  9. #489
    Join Date
    May 2007
    Beans
    465

    Re: grub2 EFI boot loader internal/external booting

    Yeah, although with my new finding with agp, perhaps it would be better to just use fbdev. fbdev is easier to setup, works for every card, and have some 2d acceel. I'm running glxgears in agp enabled fbdev, it's about 1000 FPS, although not as smooth as pc mode.

    Now I'm looking for a way to do the treaking in grub so that users don't need to patch their kernels.

    I cant find it, wheres the source?
    Tried -
    xf86-video-intel-2.6.99.902
    http://cgit.freedesktop.org/xorg/dri...6-video-intel/
    It's in the kernel source, drivers/char/agp directory.

    EDIT: BTW, from your previous log files, I think your mb21 is 945 chipset, so you should change the intel_915_driver structure. mbp41 and mb81 don't use intel-agp though, but I guess the cause should be similar.
    Last edited by bean123; March 24th, 2009 at 05:12 PM.

  10. #490
    Join Date
    May 2007
    Beans
    465

    Re: grub2 EFI boot loader internal/external booting

    Hi,

    I've found the real cause of this issue, it's actually caused by the wired gart layout in efi platform.

    In pc mode, gart is a continuous block, frame buffer first, then 4K bios popup area.

    Code:
    Gart Offset          Physical Address
    0x0000 - 0x3DFB  =>  0x3F000000 - 0x3FF7E000
    But in efi mode, it's split into three blocks:

    Code:
    Gart Offset          Physical Address
    0x0000 - 0x3DBF  =>  0x3F000000 - 0x3FF6F000
    0x3DC0 - 0x3FFF  =>  Not used
    0x4000 - 0x7DBF  =>  0x3F000000 - 0x3FF6F000
    0x7DC0 - 0x7FFF  =>  Not used
    0x8000 - 0x803F  =>  0x3FF70000 - 0x3FF7F000
    The two range 0x0000 - 0x3DBF and 0x4000 - 0x7DBF mapped to the same physical address, changing either one of them would cause screen distortion. 0x8000 - 0x803F could be something similar to the bios popup area.

    The gtt_entries member of agp_brige structure should be set to the number of gtt entries reserved. Linux calculates this value using aperture size plus the bios popup, this is correct for pc mode, but wrong for efi.

    When needs_scratch_page is set, it initializes all the entries beyond gtt_entries to the scratch page address. In efi mode, all entries from 0x4000 is overwritten, this is the reason for screen distortion.

    Therefore, setting needs_scratch_page to false doesn't really solve the problem, it just hides it. Entries from 0x4000 is still treated by system as free, so a latter agp allocation request could get the same range. To fix it properly, we need to increase the value of gtt_entries to include the whole area. In my case, we could do it like this:

    Code:
        if (intel_private.gtt_entries == 3967)
            intel_private.gtt_entries = 8208;
    3967 = 0x3DFC / 4 (pc mode reserved entries)
    8208 = 0x8040 / 4 (efi mode reserved entries)

    This wouldn't break pc, as there is no harm reserving more page than necessary.

    Unfortunately, this patch has to be done in linux side, which needs to change the gtt_entries calculation algorithm to account for the strange gart layout in efi platform.

Page 49 of 123 FirstFirst ... 3947484950515999 ... 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
  •