From ad10c6bb4ed8830cd0071fda0ee037cf600a7f49 Mon Sep 17 00:00:00 2001 From: hpa Date: Sun, 19 Dec 2004 07:23:45 +0000 Subject: Fix some additional common code issues; fix dangling ES in pxelinux --- extlinux.asm | 13 ------------- isolinux.asm | 13 ------------- ldlinux.asm | 13 ------------- parsecmd.inc | 3 ++- parseconfig.inc | 2 +- pxelinux.asm | 15 ++------------- 6 files changed, 5 insertions(+), 54 deletions(-) diff --git a/extlinux.asm b/extlinux.asm index 757609a2..e12edb7a 100644 --- a/extlinux.asm +++ b/extlinux.asm @@ -58,13 +58,6 @@ SECTOR_SIZE equ (1 << SECTOR_SHIFT) ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; -; Note: this structure can be added to, but it must -; -%define vk_power 6 ; log2(max number of vkernels) -%define max_vk (1 << vk_power) ; Maximum number of vkernels -%define vk_shift (16-vk_power) ; Number of bits to shift -%define vk_size (1 << vk_shift) ; Size of a vkernel buffer - struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name @@ -75,12 +68,6 @@ vk_append: resb max_cmd_len+1 ; Command line vk_end: equ $ ; Should be <= vk_size endstruc -%ifndef DEPEND -%if (vk_end > vk_size) || (vk_size*max_vk > 65536) -%error "Too many vkernels defined, reduce vk_power" -%endif -%endif - ; ; Segment assignments in the bottom 640K ; Stick to the low 512K in case we're using something like M-systems flash diff --git a/isolinux.asm b/isolinux.asm index faab78cd..548811e8 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -56,13 +56,6 @@ SECTOR_SIZE equ (1 << SECTOR_SHIFT) ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; -; Note: this structure can be added to, but it must -; -%define vk_power 6 ; log2(max number of vkernels) -%define max_vk (1 << vk_power) ; Maximum number of vkernels -%define vk_shift (16-vk_power) ; Number of bits to shift -%define vk_size (1 << vk_shift) ; Size of a vkernel buffer - struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name @@ -73,12 +66,6 @@ vk_append: resb max_cmd_len+1 ; Command line vk_end: equ $ ; Should be <= vk_size endstruc -%ifndef DEPEND -%if (vk_end > vk_size) || (vk_size*max_vk > 65536) -%error "Too many vkernels defined, reduce vk_power" -%endif -%endif - ; ; Segment assignments in the bottom 640K ; 0000h - main code/data segment (and BIOS segment) diff --git a/ldlinux.asm b/ldlinux.asm index b8f23031..1a1020a7 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -64,13 +64,6 @@ SECTOR_SIZE equ (1 << SECTOR_SHIFT) ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; -; Note: this structure can be added to, but it must -; -%define vk_power 7 ; log2(max number of vkernels) -%define max_vk (1 << vk_power) ; Maximum number of vkernels -%define vk_shift (16-vk_power) ; Number of bits to shift -%define vk_size (1 << vk_shift) ; Size of a vkernel buffer - struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name @@ -81,12 +74,6 @@ vk_append: resb max_cmd_len+1 ; Command line vk_end: equ $ ; Should be <= vk_size endstruc -%ifndef DEPEND -%if (vk_end > vk_size) || (vk_size*max_vk > 65536) -%error "Too many vkernels defined, reduce vk_power" -%endif -%endif - ; ; Segment assignments in the bottom 640K ; Stick to the low 512K in case we're using something like M-systems flash diff --git a/parsecmd.inc b/parsecmd.inc index 5d1830e5..2aa4144c 100644 --- a/parsecmd.inc +++ b/parsecmd.inc @@ -91,7 +91,8 @@ getcommand: jmp short .skipline section .bss - alignb 32 + alignb 4 +vk_size equ (vk_end + 3) & ~3 VKernelBuf: resb vk_size ; "Current" vkernel AppendBuf resb max_cmd_len+1 ; append= Ontimeout resb max_cmd_len+1 ; ontimeout diff --git a/parseconfig.inc b/parseconfig.inc index 0a427696..064dc7f4 100644 --- a/parseconfig.inc +++ b/parseconfig.inc @@ -240,7 +240,7 @@ pc_fkey: push ax ; pc_label: call commit_vk ; Commit any current vkernel mov di,VKernelBuf ; Erase the vkernelbuf for better compression - mov cx,vk_size >> 1 + mov cx,(vk_size >> 1) xor ax,ax rep stosw call pc_getline diff --git a/pxelinux.asm b/pxelinux.asm index be550a19..c8108d26 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -94,13 +94,6 @@ TFTP_EOPTNEG equ htons(8) ; Option negotiation failure ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; -; Note: this structure can be added to, but it must -; -%define vk_power 6 ; log2(max number of vkernels) -%define max_vk (1 << vk_power) ; Maximum number of vkernels -%define vk_shift (16-vk_power) ; Number of bits to shift -%define vk_size (1 << vk_shift) ; Size of a vkernel buffer - struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name @@ -113,12 +106,6 @@ vk_append: resb max_cmd_len+1 ; Command line vk_end: equ $ ; Should be <= vk_size endstruc -%ifndef DEPEND -%if (vk_end > vk_size) || (vk_size*max_vk > 65536) -%error "Too many vkernels defined, reduce vk_power" -%endif -%endif - ; ; Segment assignments in the bottom 640K ; 0000h - main code/data segment (and BIOS segment) @@ -503,6 +490,8 @@ have_pxe: call crlf have_entrypoint: + push cs + pop es ; Restore CS == DS == ES ; ; Now attempt to get the BOOTP/DHCP packet that brought us life (and an IP -- cgit v1.2.1