From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MRWUX-0007c3-Vw for mharc-grub-devel@gnu.org; Thu, 16 Jul 2009 15:19:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRWUW-0007XY-24 for grub-devel@gnu.org; Thu, 16 Jul 2009 15:19:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRWUR-0007MO-9F for grub-devel@gnu.org; Thu, 16 Jul 2009 15:19:39 -0400 Received: from [199.232.76.173] (port=34757 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRWUR-0007MB-5d for grub-devel@gnu.org; Thu, 16 Jul 2009 15:19:35 -0400 Received: from c60.cesmail.net ([216.154.195.49]:57114) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MRWUQ-0000OX-LZ for grub-devel@gnu.org; Thu, 16 Jul 2009 15:19:34 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 16 Jul 2009 15:19:29 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 4DEE934C6D for ; Thu, 16 Jul 2009 15:29:10 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <844C0E3A-87BD-4982-9249-520A2B8F431A@zetam.org> References: <844C0E3A-87BD-4982-9249-520A2B8F431A@zetam.org> Content-Type: text/plain Date: Thu, 16 Jul 2009 15:19:28 -0400 Message-Id: <1247771968.5896.7.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Support for OSX X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2009 19:19:40 -0000 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