All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Support for OSX
Date: Thu, 16 Jul 2009 15:19:28 -0400	[thread overview]
Message-ID: <1247771968.5896.7.camel@mj> (raw)
In-Reply-To: <844C0E3A-87BD-4982-9249-520A2B8F431A@zetam.org>

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



  parent reply	other threads:[~2009-07-16 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 17:45 [PATCH] Support for OSX Yves Blusseau
2009-07-16 18:25 ` Vladimir 'phcoder' Serbinenko
2009-07-16 19:19 ` Pavel Roskin [this message]
2009-07-16 19:38   ` Yves Blusseau
2009-07-18 18:28 ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247771968.5896.7.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.