[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] zero-fill entry before asking BIOS for memory map
From: |
Vladimir 'phcoder' Serbinenko |
Subject: |
Re: [PATCH] zero-fill entry before asking BIOS for memory map |
Date: |
Thu, 23 Jul 2009 23:53:39 +0200 |
On Thu, Jul 23, 2009 at 11:31 PM, Pavel Roskin<address@hidden> wrote:
> On Thu, 2009-07-23 at 11:38 +0200, Vladimir 'phcoder' Serbinenko wrote:
>> Hello. According to xen some BIOSes update only lower 32-bit in mmap
>> entries. To workaround this and not get high values in memory map
>> zero-fill before calling BIOS
>
> I think the fix belongs to grub_get_mmap_entry(), not to all of its
> callers.
I'm ok with this too. The main reason for me to decide for one or
another would be core.img size but I haven't checked yet which one is
smaller. Actually asm part is kept to minimum and
grub_machine_mmap_iterate is the C wrapper and I followed this idea.
But as I said your solution is fine for me too.
> Something like this:
>
> diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S
> index be258fb..5468ba8 100644
> --- a/kern/i386/pc/startup.S
> +++ b/kern/i386/pc/startup.S
> @@ -997,6 +997,14 @@ FUNCTION(grub_get_mmap_entry)
> /* push ADDR */
> pushl %eax
>
> + /* clear the request area, buggy BIOSes may not clear it */
> + xor %edi, %edi
> + movl %edi, 4(%eax)
> + movl %edi, 8(%eax)
> + movl %edi, 12(%eax)
> + movl %edi, 16(%eax)
> + movl %edi, 20(%eax)
> +
> /* place address (+4) in ES:DI */
> addl $4, %eax
> movl %eax, %edi
For me this coode looks weird because of using edi as zero register
and eax as pointer. Could we perhaps move this code down and use eax
as 0 and edi as pointer?
>
> I don't know whether it would interfere with the Apple CC workaround.
> It would be great if we get rid of it, perhaps by using labels starting
> with "L_".
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git