/[grub]/grub/stage2/fsys_fat.c
ViewVC logotype

Diff of /grub/stage2/fsys_fat.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by robertmh, Fri Sep 5 01:36:58 2003 UTC revision 1.21 by okuji, Tue Mar 15 16:54:24 2005 UTC
# Line 1  Line 1 
1  /*  /*
2   *  GRUB  --  GRand Unified Bootloader   *  GRUB  --  GRand Unified Bootloader
3   *  Copyright (C) 2000, 2001   Free Software Foundation, Inc.   *  Copyright (C) 2000,2001,2005   Free Software Foundation, Inc.
4   *   *
5   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
6   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 149  fat_mount (void) Line 149  fat_mount (void)
149            FAT_SUPER->clust_eof_marker = 0xff8;            FAT_SUPER->clust_eof_marker = 0xff8;
150          }          }
151      }      }
152      
     
153    /* Now do some sanity checks */    /* Now do some sanity checks */
154        
155    if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits)    if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits)
# Line 184  fat_mount (void) Line 183  fat_mount (void)
183        magic = 0x0f00;        magic = 0x0f00;
184      }      }
185    
186    if (first_fat != (magic | bpb.media))    /* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media
187         descriptor, even if it is a so-called superfloppy (e.g. an USB key).
188         The check may be too strict for this kind of stupid BIOSes, as
189         they overwrite the media descriptor.  */
190      if ((first_fat | 0x8) != (magic | bpb.media | 0x8))
191      return 0;      return 0;
192    
193    FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;    FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26