public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat•com>
To: Nikunj A Dadhania <nikunj@linux•vnet.ibm.com>
Cc: linuxppc-dev@ozlabs•org, segher@kernel•crashing.org,
	aik@ozlabs•ru, dvaleev@suse•com
Subject: Re: [PATCH SLOF v2 4/5] disk-label: introduce helper to check fat filesystem
Date: Mon, 29 Jun 2015 10:47:16 +0200	[thread overview]
Message-ID: <20150629104716.61aced97@thh440s> (raw)
In-Reply-To: <1435214729-15952-5-git-send-email-nikunj@linux.vnet.ibm.com>

On Thu, 25 Jun 2015 12:15:28 +0530
Nikunj A Dadhania <nikunj@linux•vnet.ibm.com> wrote:

> Signed-off-by: Nikunj A Dadhania <nikunj@linux•vnet.ibm.com>
> ---
>  slof/fs/packages/disk-label.fs | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/slof/fs/packages/disk-label.fs b/slof/fs/packages/disk-label.fs
> index 0995808..7ed5526 100644
> --- a/slof/fs/packages/disk-label.fs
> +++ b/slof/fs/packages/disk-label.fs
> @@ -321,6 +321,14 @@ CONSTANT /gpt-part-entry
>  
>  \ Load from first active DOS boot partition.
>  
> +: fat-bootblock? ( addr -- flag )
> +   \ byte 0-2 of the bootblock is a jump instruction in
> +   \ all FAT filesystems.
> +   \ e9 and eb are jump instructions in x86 assembler.
> +   dup c@ e9 = IF drop true EXIT THEN
> +   dup c@ eb = swap 2+ c@ 90 = and
> +;
> +
>  \ NOTE: block-size is always 512 bytes for DOS partition tables.
>  
>  : load-from-dos-boot-partition ( addr -- size )
> @@ -549,14 +557,7 @@ AA268B49521E5A8B    CONSTANT GPT-PREP-PARTITION-4
>  : try-dos-files ( -- found? )
>     no-mbr? IF false EXIT THEN
>  
> -   \ disk-buf 0 byte 0-2 is a jump instruction in all FAT
> -   \ filesystems.
> -   \ e9 and eb are jump instructions in x86 assembler.
> -   disk-buf c@ e9 <> IF
> -      disk-buf c@ eb <>
> -      disk-buf 2+ c@ 90 <> or
> -      IF false EXIT THEN
> -   THEN
> +   disk-buf fat-bootblock? 0= IF false EXIT THEN
>     s" fat-files" (interpose-filesystem)
>     true
>  ;

Reviewed-by: Thomas Huth <thuth@redhat•com>

  reply	other threads:[~2015-06-29  8:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25  6:45 [PATCH SLOF v2 0/5] GPT fixes/cleanup and LVM support with FAT Nikunj A Dadhania
2015-06-25  6:45 ` [PATCH SLOF v2 1/5] disk-label: simplify gpt-prep-partition? routine Nikunj A Dadhania
2015-06-25  6:45 ` [PATCH SLOF v2 2/5] introduce 8-byte LE helpers Nikunj A Dadhania
2015-06-25  6:45 ` [PATCH SLOF v2 3/5] disk-label: rename confusing "block" word Nikunj A Dadhania
2015-06-29  8:44   ` Thomas Huth
2015-06-25  6:45 ` [PATCH SLOF v2 4/5] disk-label: introduce helper to check fat filesystem Nikunj A Dadhania
2015-06-29  8:47   ` Thomas Huth [this message]
2015-06-25  6:45 ` [PATCH SLOF v2 5/5] disk-label: add support for booting from GPT FAT partition Nikunj A Dadhania
2015-06-29  9:17   ` Thomas Huth
2015-06-29 11:13     ` Nikunj A Dadhania

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=20150629104716.61aced97@thh440s \
    --to=thuth@redhat$(echo .)com \
    --cc=aik@ozlabs$(echo .)ru \
    --cc=dvaleev@suse$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=nikunj@linux$(echo .)vnet.ibm.com \
    --cc=segher@kernel$(echo .)crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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