Clean up major bugs in the extension-detection code.
authorhpa <hpa>
Thu, 6 Jun 2002 01:15:03 +0000 (01:15 +0000)
committerhpa <hpa>
Thu, 6 Jun 2002 01:15:03 +0000 (01:15 +0000)
isolinux.asm
ldlinux.asm
pxelinux.asm

index f13d6fa..bfa6b91 100644 (file)
@@ -1199,18 +1199,21 @@ kernel_good:
                or ecx,20202000h                ; Force lower case
 
                cmp ecx,'.com'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'.cbt'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'.img'
-               je near is_disk_image
+               je is_disk_image
                cmp ecx,'.bss'
-               je near is_bss_image
-               and ecx, 00ffffffh
+               je is_bss_image
+               cmp ecx,'.bin'
+               je is_bootsector
+               shr ecx,8
                cmp ecx,'.bs'
-               je near is_bootsector
+               je is_bootsector
+               shr ecx,8
                cmp cx,'.0'
-               je near is_bootsector
+               je is_bootsector
                ; Otherwise Linux kernel
 
 ;
index 9107334..008a82f 100644 (file)
@@ -1329,16 +1329,17 @@ kernel_good:
                popa
 
                mov ecx,[KernelName+8]          ; Get (mangled) extension
+               and ecx,00ffffffh               ; 3 bytes only
                cmp ecx,'COM'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'CBT'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'BS '
-               je near is_bootsector
+               je is_bootsector
                cmp ecx,'BIN'
-               je near is_bootsector
+               je is_bootsector
                cmp ecx,'BSS'
-               je near is_bss_sector
+               je is_bss_sector
                ; Otherwise Linux kernel
 
 ;
index 2c87925..a549432 100644 (file)
@@ -1069,21 +1069,26 @@ kernel_good:
                pop ax
                pop di
 
+;
+; At this point, DX:AX contains the size of the kernel, and SI contains
+; the file handle/cluster pointer.
+;
                or ecx,20202000h                ; Force lower case
 
                cmp ecx,'.com'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'.cbt'
-               je near is_comboot_image
+               je is_comboot_image
                cmp ecx,'.bss'
-               je near is_bss_image
+               je is_bss_image
                cmp ecx,'.bin'
-               je near is_bootsector
-               and ecx, 00ffffffh
+               je is_bootsector
+               shr ecx,8
                cmp ecx,'.bs'
-               je near is_bootsector
+               je is_bootsector
+               shr ecx,8
                cmp cx,'.0'
-               je near is_bootsector
+               je is_bootsector
                ; Otherwise Linux kernel
 ;
 ; Linux kernel loading code is common.  However, we need to define