diskstart: if no partition table, we need Hidden == 0 syslinux-4.00-pre56
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 22 Jun 2010 17:30:28 +0000 (10:30 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 22 Jun 2010 17:30:28 +0000 (10:30 -0700)
If we don't have a partition table, we need to make sure Hidden gets
set to zero.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
core/diskstart.inc

index 4f15ad2..7bb47dc 100644 (file)
@@ -176,20 +176,26 @@ floppy:
 ;
 harddisk:
                test byte [di-76],7Fh   ; Sanity check: "active flag" should
-               jnz no_partition        ; be 00 or 80
+               jnz .no_partition       ; be 00 or 80
                cmp eax,'!GPT'          ; !GPT signature?
-               jne .not_gpt
+               jne .mbr
                cmp byte [di-76+4],0EDh ; Synthetic GPT partition entry?
-               jne .not_gpt
+               jne .mbr
+.gpt:                                  ; GPT-style partition info
                push dword [di-76+20+36]
                push dword [di-76+20+32]
                jmp .gotoffs
-.not_gpt:
+.mbr:                                  ; MBR-style partition info
                push cx                 ; Upper half partition offset == 0
                push cx
                push dword [di-76+8]    ; Partition offset (dword)
+               jmp .gotoffs
+.no_partition:
+               push cx
+               push cx
+               push cx
+               push cx
 .gotoffs:
-no_partition:
 ;
 ; Get disk drive parameters (don't trust the superblock.)  Don't do this for
 ; floppy drives -- INT 13:08 on floppy drives will (may?) return info about