From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0QK1-0002iV-TN for qemu-devel@nongnu.org; Wed, 12 Nov 2008 19:44:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0QK0-0002iI-G6 for qemu-devel@nongnu.org; Wed, 12 Nov 2008 19:44:33 -0500 Received: from [199.232.76.173] (port=36329 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0QK0-0002iF-Aa for qemu-devel@nongnu.org; Wed, 12 Nov 2008 19:44:32 -0500 Received: from mail.gmx.net ([213.165.64.20]:59099) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L0QJz-0005vw-Nq for qemu-devel@nongnu.org; Wed, 12 Nov 2008 19:44:32 -0500 Message-ID: <16C4151DCE3D406091E6AC948C8CA8A3@FSCPC> From: "Sebastian Herbszt" References: <20081110091134.11822.34230.stgit@dhcp-1-237.local> <20081110091159.11822.26753.stgit@dhcp-1-237.local> In-Reply-To: <20081110091159.11822.26753.stgit@dhcp-1-237.local> Date: Thu, 13 Nov 2008 01:43:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH v3 5/6] Don't use unreserved memory inBIOS. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov , bochs-developers@lists.sourceforge.net Cc: qemu-devel@nongnu.org Gleb Natapov wrote: > Use only first page and last page of low memory. OSes assumes that first > page is used by bios and last page is reserved in e820 map. > > Signed-off-by: Gleb Natapov > --- > > bios/rombios.c | 11 +++++++---- > bios/rombios.h | 1 - > bios/rombios32.c | 11 ++++------- > bios/rombios32start.S | 2 +- > 4 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/bios/rombios.c b/bios/rombios.c > index 630cfd2..c6c8b19 100644 > --- a/bios/rombios.c > +++ b/bios/rombios.c > @@ -4547,7 +4547,7 @@ ASM_END > { > case 0: > set_e820_range(ES, regs.u.r16.di, > - 0x0000000L, 0x0009fc00L, 1); > + 0x0000000L, 0x0009f000L, 1); > regs.u.r32.ebx = 1; > regs.u.r32.eax = 0x534D4150; > regs.u.r32.ecx = 0x14; > @@ -4556,7 +4556,7 @@ ASM_END > break; > case 1: > set_e820_range(ES, regs.u.r16.di, > - 0x0009fc00L, 0x000a0000L, 2); > + 0x0009f000L, 0x000a0000L, 2); > regs.u.r32.ebx = 2; > regs.u.r32.eax = 0x534D4150; > regs.u.r32.ecx = 0x14; > @@ -10032,8 +10032,11 @@ rombios32_05: > mov gs, ax > cld > > - ;; init the stack pointer > - mov esp, #0x00080000 > + ;; init the stack pointer to point below EBDA > + mov ax, [0x040e] > + shl eax, #4 > + mov esp, #-0x10 > + add esp, eax This could be a problem if the OS decides to put the wakeup vector just below the EBDA. But as long as the EBDA is located above 0x9f000 it should be ok and this can be changed later. - Sebastian