* loader/efi/appleloader.c
@ 2010-01-03 22:21 Robert Millan
2010-01-04 12:23 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 4+ messages in thread
From: Robert Millan @ 2010-01-03 22:21 UTC (permalink / raw)
To: grub-devel
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 not
acceptable in GRUB. If it's machine code, we need its source code. If
it's a magic signature, we need a comment and/or macro explaining that,
etc.
--
Robert Millan
"Be the change you want to see in the world" -- Gandhi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: loader/efi/appleloader.c
2010-01-03 22:21 loader/efi/appleloader.c Robert Millan
@ 2010-01-04 12:23 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-04 13:10 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-01-04 12:23 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]
Robert Millan wrote:
> 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 not
> acceptable in GRUB. If it's machine code, we need its source code. If
> it's a magic signature, we need a comment and/or macro explaining that,
> etc.
>
>
They are device identifiers in EFI format. E.g. This
static grub_uint8_t devpath_5[] = {
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
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: loader/efi/appleloader.c
2010-01-04 12:23 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-01-04 13:10 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-07 19:35 ` loader/efi/appleloader.c Robert Millan
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-01-04 13:10 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1.1: Type: text/plain, Size: 1295 bytes --]
Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Robert Millan wrote:
>
>> 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 not
>> acceptable in GRUB. If it's machine code, we need its source code. If
>> it's a magic signature, we need a comment and/or macro explaining that,
>> etc.
>>
>>
>>
> They are device identifiers in EFI format. E.g. This
> static grub_uint8_t devpath_5[] = {
> 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
>
>
Deblobing patch attached. Binary is the same (checked)
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: appledeblob.diff --]
[-- Type: text/x-diff; name="appledeblob.diff", Size: 8261 bytes --]
=== 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_path_t;
+#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
=== 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;
}
+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[] =
+static struct piwg_full_device_path devpath_1 =
{
- 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 =
+ {
+ .header = {
+ .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+ },
+ .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+ .start_address = 0xffe00000,
+ .end_address = 0xfff9ffff
+ },
+ .comp2 =
+ {
+ .header = {
+ .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+ },
+ .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+ 0x01, 0xAE, 0xF2, 0xB7}}
+ },
+ .end =
+ {
+ .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_device_path), 0}
+ }
};
/* mid-2006 Mac Pro (and probably other Core 2 models) */
-static grub_uint8_t devpath_2[] =
+static struct piwg_full_device_path devpath_2 =
{
- 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 =
+ {
+ .header = {
+ .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+ },
+ .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+ .start_address = 0xffe00000,
+ .end_address = 0xfff7ffff
+ },
+ .comp2 =
+ {
+ .header = {
+ .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+ },
+ .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+ 0x01, 0xAE, 0xF2, 0xB7}}
+ },
+ .end =
+ {
+ .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_device_path), 0}
+ }
};
/* mid-2007 MBP ("Santa Rosa" based models) */
-static grub_uint8_t devpath_3[] =
+static struct piwg_full_device_path devpath_3 =
{
- 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 =
+ {
+ .header = {
+ .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+ },
+ .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+ .start_address = 0xffe00000,
+ .end_address = 0xfff8ffff
+ },
+ .comp2 =
+ {
+ .header = {
+ .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+ },
+ .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+ 0x01, 0xAE, 0xF2, 0xB7}}
+ },
+ .end =
+ {
+ .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_device_path), 0}
+ }
};
/* early-2008 MBA */
-static grub_uint8_t devpath_4[] =
+static struct piwg_full_device_path devpath_4 =
{
- 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 =
+ {
+ .header = {
+ .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+ },
+ .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+ .start_address = 0xffc00000,
+ .end_address = 0xfff8ffff
+ },
+ .comp2 =
+ {
+ .header = {
+ .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+ },
+ .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+ 0x01, 0xAE, 0xF2, 0xB7}}
+ },
+ .end =
+ {
+ .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_device_path), 0}
+ }
};
/* late-2008 MB/MBP (NVidia chipset) */
-static grub_uint8_t devpath_5[] = {
- 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 =
+{
+ .comp1 =
+ {
+ .header = {
+ .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+ },
+ .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+ .start_address = 0xffcb4000,
+ .end_address = 0xffffbfff
+ },
+ .comp2 =
+ {
+ .header = {
+ .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+ },
+ .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+ 0x01, 0xAE, 0xF2, 0xB7}}
+ },
+ .end =
+ {
+ .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+ .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ .length = {sizeof (struct grub_efi_device_path), 0}
+ }
};
struct devdata
@@ -121,11 +234,11 @@
struct devdata devs[] =
{
- {"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},
};
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: loader/efi/appleloader.c
2010-01-04 13:10 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-01-07 19:35 ` Robert Millan
0 siblings, 0 replies; 4+ messages in thread
From: Robert Millan @ 2010-01-07 19:35 UTC (permalink / raw)
To: The development of GNU GRUB
On Mon, Jan 04, 2010 at 02:10:44PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > They are device identifiers in EFI format. E.g. This
> > static grub_uint8_t devpath_5[] = {
> > 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
> >
> >
> Deblobing patch attached. Binary is the same (checked)
Nice!
--
Robert Millan
"Be the change you want to see in the world" -- Gandhi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-07 19:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 22:21 loader/efi/appleloader.c Robert Millan
2010-01-04 12:23 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-04 13:10 ` loader/efi/appleloader.c Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-07 19:35 ` loader/efi/appleloader.c Robert Millan
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.