Index: boot/freeldr/bootsect/dosmbr.S =================================================================== --- boot/freeldr/bootsect/dosmbr.S (revision 66268) +++ boot/freeldr/bootsect/dosmbr.S (working copy) @@ -51,7 +51,7 @@ lea di, [bp + HEX(1be)] // start of partition table test_next_for_active: test byte ptr ds:[di], HEX(80) - jne active_partition_found + jnz active_partition_found add di, 16 // next table cmp di, HEX(07c00) + HEX(1fe) // scanned beyond end of table ?? jb test_next_for_active @@ -100,6 +100,25 @@ * OUT:CARRY *****************************/ read_boot_sector: + + /* Save registers */ + pusha + + /* int 13h, function 8 = Get drive parameters + To check, whether the drive presented in dl is valid */ + mov ah, 8 + xor di, di + int HEX(13) + + /* Restore registers */ + popa + + /* If there was an error, force drive to 0x80 (first HDD) */ + jnc drive_ok + mov dl, HEX(80) + +drive_ok: + /* check for LBA support */ mov bx, HEX(55aa) mov ah, HEX(41)