From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDHJc-00052S-F3 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDHJX-0004zX-99 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:47 -0500 Received: from [199.232.76.173] (port=54918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHJX-0004zO-1e for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28962) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDHJW-00008s-5g for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:42 -0500 From: Paolo Bonzini Date: Wed, 25 Nov 2009 13:49:38 +0100 Message-Id: <1259153378-27567-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <515008F0-22BE-4F07-AD39-F7FDB578E362@suse.de> References: <515008F0-22BE-4F07-AD39-F7FDB578E362@suse.de> Subject: [Qemu-devel] [PATCH] Fix thinko in linuxboot.S List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: agraf@suse.de The %gs segment that was used was not matching the comments. I just moved the GDT descriptor on the stack instead. Signed-off-by: Paolo Bonzini --- pc-bios/optionrom/linuxboot.S | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S index b3c90e3..14e1ae8 100644 --- a/pc-bios/optionrom/linuxboot.S +++ b/pc-bios/optionrom/linuxboot.S @@ -79,24 +79,20 @@ copy_kernel: mode, so let's get into 32 bit mode, write the kernel and jump back again. */ - /* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */ - mov %ss, %eax - shl $4, %eax - add %esp, %eax - sub $0x10, %eax - shr $4, %eax + /* Reserve space on the stack for our GDT descriptor. */ + mov %esp, %ebp + sub $16, %esp /* Now create the GDT descriptor */ + movw $((3 * 8) - 1), -16(%bp) mov %cs, %eax shl $4, %eax - movw $((3 * 8) - 1), %bx - movw %bx, %gs:0 - movl $gdt, %ebx - add %eax, %ebx - movl %ebx, %gs:2 + addl $gdt, %ebx + movl %ebx, -14(%bp) /* And load the GDT */ - data32 lgdt %gs:0 + data32 lgdt -16(%bp) + mov %ebp, %esp /* Get us to protected mode now */ mov $1, %eax -- 1.6.5.2