From: Thomas Huth <thuth@redhat.com>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, benh@kernel.crashing.org, aik@ozlabs.ru,
dvaleev@suse.com
Subject: Re: [PATCH SLOF] disk-label: add support for booting from GPT FAT partition
Date: Fri, 19 Jun 2015 18:27:13 +0200 [thread overview]
Message-ID: <20150619182713.5981cabf@thh440s> (raw)
In-Reply-To: <87d20uee2q.fsf@linux.vnet.ibm.com>
On Wed, 17 Jun 2015 17:34:13 +0530
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> wrote:
> Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> writes:
>=20
> > Thomas Huth <thuth@redhat.com> writes:
> >>> +\ Check for GPT MSFT BASIC DATA GUID - vfat based
> >>> +EBD0A0A2 CONSTANT GPT-BASIC-DATA-PARTITION-1
> >>> +B9E5 CONSTANT GPT-BASIC-DATA-PARTITION-2
> >>> +4433 CONSTANT GPT-BASIC-DATA-PARTITION-3
> >>> +87C0 CONSTANT GPT-BASIC-DATA-PARTITION-4
> >>> +68B6B72699C7 CONSTANT GPT-BASIC-DATA-PARTITION-5
> >>> +
> >>> +: gpt-basic-data-partition? ( -- true|false )
> >>> + block gpt-part-entry>part-type-guid l@-le GPT-BASIC-DATA-PARTITIO=
N-1 =3D IF
> >>> + block gpt-part-entry>part-type-guid 4 + w@-le
> >>> + GPT-BASIC-DATA-PARTITION-2 =3D IF
> >>> + block gpt-part-entry>part-type-guid 6 + w@-le
> >>> + GPT-BASIC-DATA-PARTITION-3 =3D IF
> >>> + block gpt-part-entry>part-type-guid 8 + w@
> >>
> >> Don't you have to byte-swap (w@-le) here, too? Looks somehow strange
> >> that the other UID parts are read byte-swapped but this one is not?
> >
> > Interesting observation, I had used code from gpt-prep-partition? and
> > did not doubt the validity of it. But that is how I see it in the memory
> > though.
> >
> > 4 > 7e50d000 10 dump=20
> > 7e50d000: a2 a0 d0 eb e5 b9 33 44 87 c0 68 b6 b7 26 99 c7 ......3D..h.=
.&.. ok
> > 4 >
>=20
> And here the answer for that:
>=20
> https://en.wikipedia.org/wiki/GUID_Partition_Table#cite_note-26
> =20
> The GUIDs in this table are written assuming a little-endian byte
> order. For example, the GUID for an EFI System partition is written
> as C12A7328-F81F-11D2-BA4B-00A0C93EC93B here, which corresponds to
> the 16 byte sequence 28h 73h 2Ah C1h 1Fh F8h D2h 11h BAh 4Bh 00h A0h
> C9h 3Eh C9h 3Bh =E2=80=93 only the first three blocks are byte-swappe=
d.
>=20
> "only the first three blocks are byte-swapped"
Ok, this seems to be a GUID specialty (as opposed to UUIDs), also see:
https://en.wikipedia.org/wiki/Globally_unique_identifier#Binary_encoding
... but that means that the last 8 bytes are always "big endian", so I
think you could simplify your code here and check the last 8 bytes at
once instead of checking 2 + 6 bytes separately, can't you?
Thomas
next prev parent reply other threads:[~2015-06-19 16:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-11 10:18 [PATCH SLOF] disk-label: add support for booting from GPT FAT partition Nikunj A Dadhania
2015-06-17 10:22 ` Thomas Huth
2015-06-17 11:59 ` Nikunj A Dadhania
2015-06-17 12:04 ` Nikunj A Dadhania
2015-06-19 16:27 ` Thomas Huth [this message]
2015-06-19 17:47 ` Nikunj A Dadhania
2015-06-18 6:24 ` Nikunj A Dadhania
2015-06-19 16:35 ` Thomas Huth
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=20150619182713.5981cabf@thh440s \
--to=thuth@redhat.com \
--cc=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=dvaleev@suse.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=nikunj@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox