From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NRmiC-00082B-Ip for mharc-grub-devel@gnu.org; Mon, 04 Jan 2010 08:11:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRmi8-0007yS-9V for grub-devel@gnu.org; Mon, 04 Jan 2010 08:11:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRmi3-0007uv-7N for grub-devel@gnu.org; Mon, 04 Jan 2010 08:11:03 -0500 Received: from [199.232.76.173] (port=34211 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRmi2-0007ua-W1 for grub-devel@gnu.org; Mon, 04 Jan 2010 08:10:59 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]:8671) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRmi2-0007vQ-C6 for grub-devel@gnu.org; Mon, 04 Jan 2010 08:10:58 -0500 Received: by fg-out-1718.google.com with SMTP id 19so6309591fgg.12 for ; Mon, 04 Jan 2010 05:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=WqmdiikpaZ5lUPvYldzbapDb4klQc/8RMrQd8KBSQJA=; b=xLecG1GbaoeiBQqp1QJK8mieg/MZi3fhiBD6HC39RpwsUQ5YZhhLiNvi8MSRZmwUQd nxvJNlLyBGJ+SYz/gBVWLwAGw10IufeABoOj0pwCIKP5iG/SfWRykGr8RTl7gGyvE5+o 0VxeYhSiT+IzcG+pR8kpW1h9e0dThIoRYwmdA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=QKAB4WHyPEJPxwiEbzCj6JQlNxgiNFfmdI8t3qEVHEzcrCNSsAFCIVV4p0jaBvyI5a ZwSgnH3iuqbvyKYYYGHaulLlbxyAHrABtBlXRkxrbHLKexmWQknVO8P0UmVdD85JjFLa WTbbMH/uX7jlzfLYYcIgJ+kjMvzteQM8FN1VI= Received: by 10.87.39.34 with SMTP id r34mr13007096fgj.79.1262610656475; Mon, 04 Jan 2010 05:10:56 -0800 (PST) Received: from debian.bg45.phnet ([81.62.107.61]) by mx.google.com with ESMTPS id d4sm42437769fga.26.2010.01.04.05.10.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 04 Jan 2010 05:10:55 -0800 (PST) Message-ID: <4B41E8D4.6050406@gmail.com> Date: Mon, 04 Jan 2010 14:10:44 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20100103222131.GA26625@thorin> <4B41DDBE.6020805@gmail.com> In-Reply-To: <4B41DDBE.6020805@gmail.com> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig1AE7C1AFC4A56ADED97AD956" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: loader/efi/appleloader.c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 13:11:04 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1AE7C1AFC4A56ADED97AD956 Content-Type: multipart/mixed; boundary="------------030803030807030305070002" This is a multi-part message in MIME format. --------------030803030807030305070002 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > Robert Millan wrote: > =20 >> Hi, >> >> I've removed loader/efi/appleloader.c, because it contained blobs of >> binary data. If someone can provide a satisfactory explanation for >> them, it can be added back. However, this command seems to be seldom >> needed. >> >> Please keep in mind binary blobs or other kind of obfuscated data is n= ot >> acceptable in GRUB. If it's machine code, we need its source code. I= f >> it's a magic signature, we need a comment and/or macro explaining that= , >> etc. >> >> =20 >> =20 > They are device identifiers in EFI format. E.g. This > static grub_uint8_t devpath_5[] =3D { > 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, > 0x00, 0x40, 0xCB, 0xFF, 0x00, 0x00, 0x00, 0x00, > 0xFF, 0xBF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, > 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, > 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, > 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, > }; > > Means MMIO(EfiMemoryMappedIO, > 0xffcb4000-0xffffbfff)/PIWGVolume(2B0585EB-D8B8-49A9-8B8CE21B01AEF2B7) > I can add necessary prototypes and structures > > =20 Deblobing patch attached. Binary is the same (checked) --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------030803030807030305070002 Content-Type: text/x-diff; name="appledeblob.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="appledeblob.diff" =3D=3D=3D modified file 'include/grub/efi/api.h' --- include/grub/efi/api.h 2009-09-03 17:19:59 +0000 +++ include/grub/efi/api.h 2010-01-04 13:07:45 +0000 @@ -584,6 +584,16 @@ }; typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_pa= th_t; =20 +#define GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE 6 + +struct grub_efi_piwg_device_path +{ + grub_efi_device_path_t header; + grub_efi_guid_t guid __attribute__ ((packed)); +}; +typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t; + + /* BIOS Boot Specification Device Path. */ #define GRUB_EFI_BIOS_DEVICE_PATH_TYPE 5 =20 =3D=3D=3D modified file 'loader/efi/appleloader.c' --- loader/efi/appleloader.c 2009-12-25 23:50:59 +0000 +++ loader/efi/appleloader.c 2010-01-04 13:07:45 +0000 @@ -59,58 +59,171 @@ return grub_errno; } =20 +struct piwg_full_device_path +{ + struct grub_efi_memory_mapped_device_path comp1; + struct grub_efi_piwg_device_path comp2; + struct grub_efi_device_path end; +}; + /* early 2006 Core Duo / Core Solo models */ -static grub_uint8_t devpath_1[] =3D +static struct piwg_full_device_path devpath_1 =3D { - 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xF9, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, - 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, - 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, + .comp1 =3D + { + .header =3D { + .type =3D GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_memory_mapped_device_path), 0= } + }, + .memory_type =3D GRUB_EFI_MEMORY_MAPPED_IO, + .start_address =3D 0xffe00000, + .end_address =3D 0xfff9ffff + }, + .comp2 =3D + { + .header =3D { + .type =3D GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_piwg_device_path), 0} + }, + .guid =3D {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7}} + }, + .end =3D + { + .type =3D GRUB_EFI_END_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_device_path), 0} + } }; =20 /* mid-2006 Mac Pro (and probably other Core 2 models) */ -static grub_uint8_t devpath_2[] =3D +static struct piwg_full_device_path devpath_2 =3D { - 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xF7, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, - 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, - 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, + .comp1 =3D + { + .header =3D { + .type =3D GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_memory_mapped_device_path), 0= } + }, + .memory_type =3D GRUB_EFI_MEMORY_MAPPED_IO, + .start_address =3D 0xffe00000, + .end_address =3D 0xfff7ffff + }, + .comp2 =3D + { + .header =3D { + .type =3D GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_piwg_device_path), 0} + }, + .guid =3D {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7}} + }, + .end =3D + { + .type =3D GRUB_EFI_END_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_device_path), 0} + } }; =20 /* mid-2007 MBP ("Santa Rosa" based models) */ -static grub_uint8_t devpath_3[] =3D +static struct piwg_full_device_path devpath_3 =3D { - 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, - 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, - 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, + .comp1 =3D + { + .header =3D { + .type =3D GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_memory_mapped_device_path), 0= } + }, + .memory_type =3D GRUB_EFI_MEMORY_MAPPED_IO, + .start_address =3D 0xffe00000, + .end_address =3D 0xfff8ffff + }, + .comp2 =3D + { + .header =3D { + .type =3D GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_piwg_device_path), 0} + }, + .guid =3D {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7}} + }, + .end =3D + { + .type =3D GRUB_EFI_END_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_device_path), 0} + } }; =20 /* early-2008 MBA */ -static grub_uint8_t devpath_4[] =3D +static struct piwg_full_device_path devpath_4 =3D { - 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, - 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, - 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, + .comp1 =3D + { + .header =3D { + .type =3D GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_memory_mapped_device_path), 0= } + }, + .memory_type =3D GRUB_EFI_MEMORY_MAPPED_IO, + .start_address =3D 0xffc00000, + .end_address =3D 0xfff8ffff + }, + .comp2 =3D + { + .header =3D { + .type =3D GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_piwg_device_path), 0} + }, + .guid =3D {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7}} + }, + .end =3D + { + .type =3D GRUB_EFI_END_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_device_path), 0} + } }; =20 /* late-2008 MB/MBP (NVidia chipset) */ -static grub_uint8_t devpath_5[] =3D { - 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x40, 0xCB, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xBF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, - 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, - 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +static struct piwg_full_device_path devpath_5 =3D +{ + .comp1 =3D + { + .header =3D { + .type =3D GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_memory_mapped_device_path), 0= } + }, + .memory_type =3D GRUB_EFI_MEMORY_MAPPED_IO, + .start_address =3D 0xffcb4000, + .end_address =3D 0xffffbfff + }, + .comp2 =3D + { + .header =3D { + .type =3D GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_piwg_device_path), 0} + }, + .guid =3D {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7}} + }, + .end =3D + { + .type =3D GRUB_EFI_END_DEVICE_PATH_TYPE, + .subtype =3D GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, + .length =3D {sizeof (struct grub_efi_device_path), 0} + } }; =20 struct devdata @@ -121,11 +234,11 @@ =20 struct devdata devs[] =3D { - {"Core Duo/Solo", (grub_efi_device_path_t *) devpath_1}, - {"Mac Pro", (grub_efi_device_path_t *) devpath_2}, - {"MBP", (grub_efi_device_path_t *) devpath_3}, - {"MBA", (grub_efi_device_path_t *) devpath_4}, - {"MB NV", (grub_efi_device_path_t *) devpath_5}, + {"Core Duo/Solo", (grub_efi_device_path_t *) &devpath_1}, + {"Mac Pro", (grub_efi_device_path_t *) &devpath_2}, + {"MBP", (grub_efi_device_path_t *) &devpath_3}, + {"MBA", (grub_efi_device_path_t *) &devpath_4}, + {"MB NV", (grub_efi_device_path_t *) &devpath_5}, {NULL, NULL}, }; =20 --------------030803030807030305070002-- --------------enig1AE7C1AFC4A56ADED97AD956 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAktB6NsACgkQNak7dOguQgmVWwEAvpoi+ATv2nApZTCBbdrLD/GE YU5d2IkPbZrj44/Eh1QA/RZmsOzg8NXUbpwvAqIK8Sj7o5HwDwQwAJETmo93sG/3 =OmDJ -----END PGP SIGNATURE----- --------------enig1AE7C1AFC4A56ADED97AD956--