grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Support for OSX


From: Pavel Roskin
Subject: Re: [PATCH] Support for OSX
Date: Thu, 16 Jul 2009 15:19:28 -0400

On Thu, 2009-07-16 at 19:45 +0200, Yves Blusseau wrote:
> Hi,
> 
> here's a patch so grub-setup can be compiled and work on MacOSX.

>  # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>      if (ioctl (fd, DIOCGMEDIASIZE, &nr))
> +# elif defined(__APPLE__)
> +       if (ioctl (fd, DKIOCGETBLOCKCOUNT, &nr))
>  # else
...

> +#if defined (__APPLE__)
> +       disk->total_sectors = nr;
> +#else
>      disk->total_sectors = nr / 512;

This is misleading.  The same variable "nr" is used for different values
that are obtained by different calls.

> @@ -1047,11 +1063,10 @@ grub_util_biosdisk_get_grub_dev (const char
> *os_dev)
>  
>      if (strncmp ("/dev/", os_dev, 5) == 0)
>        {
> -        const char *p;
> -        char *q;
> +        char *p, *q;
>          long int n;
>  
> -        for (p = os_dev + 5; *p; ++p)
> +        for (p = (char *) os_dev + 5; *p; ++p)

The change to grub_util_biosdisk_get_grub_dev() is not described.

> The only problem remaining is trampoline (nested functions), because  
> OSX don't want
> to execute code in the heap.

I think we should start an effort to eliminate the nested functions one
at a time.

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]