Re: [PATCH V3 2/3] Add support for avoiding firmware in relocations

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:55, Matthew Garrett wrote: EFI and OF both support firmware regions which may be in use during loading. Add support for avoiding these. Also Seth Goldberg noticed that using chunk_align with start=end=target does exactly what we want (as if avoid=1). You may need to modify efi/

Re: [PATCH V3 2/3] Add support for avoiding firmware in relocations

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:55, Matthew Garrett wrote: +if (type == GRUB_MEMORY_AVAILABLE) + return 0; + +if (target>= addr&& target<= end) + overlap = 1; + +if (target + size>= addr&& target + size<= end) + overlap = 1; This won't work. IEEE1275 declares only one type of memory

Re: [PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 21:19, Matthew Garrett wrote: On Wed, Feb 08, 2012 at 09:09:23PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 08.02.2012 21:04, Matthew Garrett wrote: On Wed, Feb 08, 2012 at 08:55:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: + for (i=0; i<(int)grub_strle

Re: [PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Matthew Garrett
On Wed, Feb 08, 2012 at 09:09:23PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 08.02.2012 21:04, Matthew Garrett wrote: > >On Wed, Feb 08, 2012 at 08:55:39PM +0100, Vladimir 'φ-coder/phcoder' > >Serbinenko wrote: > >>>+ for (i=0; i<(int)grub_strlen((char *)var); i++) > >>>+var16

Re: [PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Matthew Garrett
On Wed, Feb 08, 2012 at 08:55:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > >+ for (i=0; i<(int)grub_strlen((char *)var); i++) > >+var16[i] = var[i]; > >+ var16[i] = '\0'; > >+ > We use grub_utf8_to_utf16. Also don't forget to multiply the malloc > length by GRUB_MAX_UTF16_PER_U

Re: [PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 21:04, Matthew Garrett wrote: On Wed, Feb 08, 2012 at 08:55:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: + for (i=0; i<(int)grub_strlen((char *)var); i++) +var16[i] = var[i]; + var16[i] = '\0'; + We use grub_utf8_to_utf16. Also don't forget to multiply the mallo

Re: [PATCH 4/4] Add support for getting EDID via EFI

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:51, Matthew Garrett wrote: EFI gives a couple of defined methods for retrieving the EDID, so make use of them. Some Apple devices don't provide these but do stash the EDID in an nvram variable - grab it from there if it exists. --- ChangeLog |8 + grub-

Re: [PATCH 3/4] Prefer GOP devices which implement the pci_io protocol

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:51, Matthew Garrett wrote: Some systems (especially Apple) implement multiple GOP devices representing the same hardware. The preferred device is the one that also implements the PCI io protocol. Why not check which modes are supported by GOP rather than something we don't use

Re: [PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:51, Matthew Garrett wrote: Code may wish to obtain system information from EFI variables. Add support for making the platform call. --- ChangeLog|6 ++ grub-core/kern/efi/efi.c | 32 include/grub/efi/api.h |4 ++

Re: [PATCH 1/4] Add PCI protocols

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Go ahead. As a note: it may be useful for ia64 in future. On 08.02.2012 17:51, Matthew Garrett wrote: There's various UEFI protocols for handling PCI devices. Add support for them. --- ChangeLog |4 + include/grub/efi/pci.h | 319 ++

Re: [PATCH V3 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:55, Matthew Garrett wrote: We should attempt to load the kernel at its preferred address, and if we can't do that then we should at lesat align it correctly. When doing so we should also make sure to avoid putting the kernel on top of any regions being used by the firmware. ---

Re: [PATCH V3 2/3] Add support for avoiding firmware in relocations

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.02.2012 17:55, Matthew Garrett wrote: EFI and OF both support firmware regions which may be in use during loading. +unsigned +grub_relocator_firmware_overlaps (grub_phys_addr_t target, grub_size_t size) +{ + grub_efi_uintn_t mmapsize = 0, desc_size = 0; + grub_efi_uint32_t descriptor_ver

Re: [PATCH V3 1/3] Update the Linux boot protocol

2012-02-08 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Go ahead. On 08.02.2012 17:55, Matthew Garrett wrote: The Linux boot header includes information on the kernel's desired load address and alignment. Add support for that. --- ChangeLog |6 ++ include/grub/i386/linux.h | 28 +++- 2 files change

Re: Some improvements to EFI GOP support

2012-02-08 Thread Keshav P R
On Wed, Feb 8, 2012 at 22:21, Matthew Garrett wrote: > Add support for grabbing the EDID on GOP devices, along with picking the > better GOP device when we have more than one (Thanks, Apple). > > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > htt

Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Keshav P R
On Wed, Feb 8, 2012 at 22:26, Keshav P R wrote: > On Mon, Feb 6, 2012 at 22:19, Keshav P R wrote: >> On Mon, Feb 6, 2012 at 22:10, Keshav P R wrote: >>> On Mon, Feb 6, 2012 at 22:08, Matthew Garrett wrote: On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote: > loader/i386/pc/pla

Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Keshav P R
On Mon, Feb 6, 2012 at 22:19, Keshav P R wrote: > On Mon, Feb 6, 2012 at 22:10, Keshav P R wrote: >> On Mon, Feb 6, 2012 at 22:08, Matthew Garrett wrote: >>> On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote: loader/i386/pc/plan9_module-plan9.o `test -f 'loader/i386/pc/plan9.c' >>>

[PATCH V3 2/3] Add support for avoiding firmware in relocations

2012-02-08 Thread Matthew Garrett
EFI and OF both support firmware regions which may be in use during loading. Add support for avoiding these. --- ChangeLog| 10 + grub-core/lib/efi/relocator.c| 51 ++ grub-core/lib/ieee1275/relocator.c |

[PATCH V3 1/3] Update the Linux boot protocol

2012-02-08 Thread Matthew Garrett
The Linux boot header includes information on the kernel's desired load address and alignment. Add support for that. --- ChangeLog |6 ++ include/grub/i386/linux.h | 28 +++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog

[PATCH V3 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Matthew Garrett
We should attempt to load the kernel at its preferred address, and if we can't do that then we should at lesat align it correctly. When doing so we should also make sure to avoid putting the kernel on top of any regions being used by the firmware. --- ChangeLog |8 + gr

Some improvements to EFI GOP support

2012-02-08 Thread Matthew Garrett
Add support for grabbing the EDID on GOP devices, along with picking the better GOP device when we have more than one (Thanks, Apple). ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH 1/4] Add PCI protocols

2012-02-08 Thread Matthew Garrett
There's various UEFI protocols for handling PCI devices. Add support for them. --- ChangeLog |4 + include/grub/efi/pci.h | 319 2 files changed, 323 insertions(+), 0 deletions(-) create mode 100644 include/grub/efi/pci.h diff --

[PATCH 3/4] Prefer GOP devices which implement the pci_io protocol

2012-02-08 Thread Matthew Garrett
Some systems (especially Apple) implement multiple GOP devices representing the same hardware. The preferred device is the one that also implements the PCI io protocol. --- ChangeLog |5 + grub-core/video/efi_gop.c | 38 +- 2 files chan

[PATCH 4/4] Add support for getting EDID via EFI

2012-02-08 Thread Matthew Garrett
EFI gives a couple of defined methods for retrieving the EDID, so make use of them. Some Apple devices don't provide these but do stash the EDID in an nvram variable - grab it from there if it exists. --- ChangeLog |8 + grub-core/video/efi_gop.c | 69

[PATCH 2/4] Add grub_efi_get_variable

2012-02-08 Thread Matthew Garrett
Code may wish to obtain system information from EFI variables. Add support for making the platform call. --- ChangeLog|6 ++ grub-core/kern/efi/efi.c | 32 include/grub/efi/api.h |4 include/grub/efi/efi.h |3 ++- 4 files