grub4dos PBR boot-sector code may fail in one of these cases:
1. One of the GRLDR occupied sectors is unaccesssible because of BIOS limit. The error message will be "Disk error".
2. Wrong BPB in the partition's boot sector, especially the "hidden sectors" field. And, both the "number of heads" and the "number of sectors per track" must match your current BIOS. And the sector size must be 512 bytes with your current BIOS. In such cases (wrong or mismatching), it even cannot get the root directory, thus cannot find the GRLDR entry. The message will say "NO GRLDR".
3. The code (that calls/invokes the grub4dos PBR) did not setup the correct drive number. If the BIOS drive number is 0 (for floppy), the DL register must set to 0 before the PBR code gains control. If it was incorrectly set to 0x80, then the PBR code will try to load the GRLDR sectors from the hard drive. Generally the hard drive is large enough. So you would not get "disk error". But it will say "NO GRLDR", because the PBR code is designed to look for GRLDR in the partition that owns the same PBR sector.
4. An old buggy version of grub4dos PBR was used. In such a case, it might say "Disk error" or "NO GRLDR", or even hang up without any message.
For details of BPB fields, refer to grub4dos readme.
EDIT: OK, for FAT32, here it is:
I should/must add a note for "hidden sectors" field (offset 1Ch):
if , and only if, this boot sector (PBR or say VBR) is LBA 0, then hidden sectors = 0. Generally, if this boot sector (PBR/VBR) is LBA XXXXXXXX, then hidden sectors should/must be exactly the same value as XXXXXXXX.
3. FAT32 Boot Sector/Boot Record Layout (for loading grldr)
A FAT32 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
the root dir of the FAT32 volume, The first sector in accordance with grldr.dbr,
Create a boot sector. And then the FAT32 volume is GRUB-bootable.
Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
record onto the boot sector of an FAT32 volume.
Offset Length Description
====== ====== ==============================================================
00h 2 Machine code for short jump over the data.
02h 1 0x90
Update(2006-07-31): Though GRLDR won't use this LBA-indicator
byte, Windows 98 uses it. Usually this byte should be 0x90 for
CHS mode(especially for floppies). If this byte is not set
properly, Windows 98 will not recognize the floppy or
partition. This problem was reported by neiljoy. Many thanks!
03h 8 OEM name string (of OS which formatted the disk).
0Bh 2 Bytes per sector. Must be 512.
0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
and 128. But a cluster size larger than 32K should not occur.
0Eh 2 Reserved sectors(number of sectors before the first FAT,
including the boot sector), usually 1.
10h 1 Number of FATs(nearly always 2).
11h 2 (Maximum number of root directory entries)Must be 0.
13h 2 (Total number of sectors for small disks only)Must be 0.
15h 1 Media descriptor byte, pretty meaningless now (see below).
16h 2 (Sectors per FAT)Must be 0.
18h 2 Sectors per track.
1Ah 2 Total number of heads/sides.
1Ch 4 Number of hidden sectors (those preceding the boot sector).
Also referred to as the starting sector of the partition.
For floppies, it should be 0.
20h 4 Total number of sectors for large disks.
24h 4 FAT32 sectors per FAT.
28h 2 If bit 7 is clear then all FATs are updated, otherwise bits
0-3 give the current active FAT, all other bits are reserved.
2Ah 2 High byte is major revision number, low byte is minor revision
number, currently both are 0.
2Ch 4 Root directory starting cluster.
30h 2 File system information sector.
32h 2 If non-zero this gives the sector which holds a copy of the
boot record, usually 6.
34h 12 Reserved, set to 0.
40h 1 BIOS drive number of the boot device.
80h is first HDD, 00h is first FDD.
Actually this byte is ignored for read. The boot code will
write DL onto this byte. The BIOS or the caller should set
drive number in DL.
We assume all BIOSes pass correct drive number in DL.
Buggy BIOSes are not supported!!
41h 1 Partition number of this filesystem in the boot drive.
This byte is ignored for read. The boot code will write
partition number onto this byte. See offset 5Dh below.
Update: This field is ignored
42h 1 Signature (must be 28h or 29h to be recognised by NT).
43h 4 Volume serial number.
47h 11 Volume label.
52h 8 File system ID. "FAT32 ".
5Ah 418 The rest of the machine code.
1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)