From bcd83930da11aa59feeea0a403052b2511f469a4 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 13 Apr 2009 20:06:00 -0700 Subject: [PATCH] com32: use xfer_buf_seg as the bounce buffer We cannot realistically realign comboot_seg without breaking com16 modules (which have the DOS-derived assumption that they own the rest of low memory.) However, we can use xfer_buf_seg as the com32 bounce buffer, which allows us to retain the benefit of a 64K-aligned buffer. Signed-off-by: H. Peter Anvin --- core/com32.inc | 2 +- core/comboot.inc | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/core/com32.inc b/core/com32.inc index 9881ae0..3a762a6 100644 --- a/core/com32.inc +++ b/core/com32.inc @@ -176,7 +176,7 @@ com32_call_start: push dword com32_cfarcall ; Cfarcall entry point push dword com32_farcall ; Farcall entry point push dword (1 << 16) ; 64K bounce buffer - push dword (comboot_seg << 4) ; Bounce buffer address + push dword (xfer_buf_seg << 4) ; Bounce buffer address push dword com32_intcall ; Intcall entry point push dword command_line ; Command line pointer push dword 7 ; Argument count diff --git a/core/comboot.inc b/core/comboot.inc index 724af5f..c169414 100644 --- a/core/comboot.inc +++ b/core/comboot.inc @@ -777,17 +777,14 @@ comapi_runkernel: mov [Kernel_EAX],eax ; It's not just possible, but quite likely, that ES:BX - ; points into real_mode_seg, so we need to exercise some - ; special care here... use xfer_buf_seg as an intermediary + ; points into real_mode_seg or xfer_buf_seg, so we + ; need to exercise some special care here... use + ; trackbuf as an intermediary push ds - push es - mov ax,xfer_buf_seg mov ds,P_ES mov si,P_BX - mov es,ax - xor di,di + mov di,trackbuf call strcpy - pop es pop ds %if IS_PXELINUX @@ -799,18 +796,14 @@ comapi_runkernel: .finish: ; Copy the command line into its proper place - push ds push es - mov ax,xfer_buf_seg mov dx,real_mode_seg - mov ds,ax mov es,dx - xor si,si + mov si,trackbuf mov di,cmd_line_here call strcpy mov byte [es:di-1],' ' ; Simulate APPEND pop es - pop ds mov [CmdLinePtr],di mov word [CmdOptPtr],zero_string jmp kernel_good_saved -- 2.7.4