/[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.19 by okuji, Sat Jan 4 23:26:16 2003 UTC revision 1.20 by robertmh, Fri Sep 5 01:36:58 2003 UTC
# Line 67  int Line 67  int
67  fat_mount (void)  fat_mount (void)
68  {  {
69    struct fat_bpb bpb;    struct fat_bpb bpb;
70      __u32 magic, first_fat;
71        
72    /* Check partition type for harddisk */    /* Check partition type for harddisk */
73    if (((current_drive & 0x80) || (current_slice != 0))    if (((current_drive & 0x80) || (current_slice != 0))
# Line 161  fat_mount (void) Line 162  fat_mount (void)
162            > FAT_SUPER->fat_length))            > FAT_SUPER->fat_length))
163      return 0;      return 0;
164        
165      /* kbs: Media check on first FAT entry [ported from PUPA] */
166    
167      if (!devread(FAT_SUPER->fat_offset, 0,
168                   sizeof(first_fat), (char *)&first_fat))
169        return 0;
170    
171      if (FAT_SUPER->fat_size == 8)
172        {
173          first_fat &= 0x0fffffff;
174          magic = 0x0fffff00;
175        }
176      else if (FAT_SUPER->fat_size == 4)
177        {
178          first_fat &= 0x0000ffff;
179          magic = 0xff00;
180        }
181      else
182        {
183          first_fat &= 0x00000fff;
184          magic = 0x0f00;
185        }
186    
187      if (first_fat != (magic | bpb.media))
188        return 0;
189    
190    FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;    FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;
191    return 1;    return 1;
192  }  }

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

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