From ff925de6d538f8f95c375cba28f8616d19aee179 Mon Sep 17 00:00:00 2001 From: hpa Date: Thu, 6 Jun 2002 01:15:03 +0000 Subject: [PATCH] Clean up major bugs in the extension-detection code. --- isolinux.asm | 17 ++++++++++------- ldlinux.asm | 11 ++++++----- pxelinux.asm | 19 ++++++++++++------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/isolinux.asm b/isolinux.asm index f13d6fa..bfa6b91 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -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 ; diff --git a/ldlinux.asm b/ldlinux.asm index 9107334..008a82f 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -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 ; diff --git a/pxelinux.asm b/pxelinux.asm index 2c87925..a549432 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -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 -- 2.7.4