WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix x86/64 bootstrap.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix x86/64 bootstrap.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 18 May 2005 15:11:20 +0000
Delivery-date: Wed, 18 May 2005 16:04:30 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1449, 2005/05/18 16:11:20+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix x86/64 bootstrap.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 x86_64.S |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)


diff -Nru a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S        2005-05-18 12:05:07 -04:00
+++ b/xen/arch/x86/boot/x86_64.S        2005-05-18 12:05:07 -04:00
@@ -46,13 +46,13 @@
         mov     $7,%al
         stosb                  # Write an attribute to the VGA framebuffer
         jmp     1b
-        
+
 __start:
         cld
         cli
 
         /* Set up a few descriptors: on entry only CS is guaranteed good. */
-        lgdt    %cs:0x100400
+        lgdt    %cs:0x100306        # nopaging_gdt_descr
         mov     $(__HYPERVISOR_DS32),%ecx
         mov     %ecx,%ds
         mov     %ecx,%es
@@ -65,7 +65,7 @@
         jne     not_multiboot
         
         /* Save the Multiboot info structure for later use. */
-        mov     %ebx,0x100300
+        mov     %ebx,0x100300       # multiboot_ptr
 
         /* We begin by interrogating the CPU for the presence of long mode. */
         mov     $0x80000000,%eax
@@ -87,7 +87,7 @@
         mov     %ecx,%cr4
 
         /* Load pagetable base register. */
-        mov     $0x101000,%eax   /* idle_pg_table */
+        mov     $0x102000,%eax   /* idle_pg_table */
         mov     %eax,%cr3
 
         /* Set up EFER (Extended Feature Enable Register). */
@@ -168,9 +168,8 @@
         loop    1b
 
         /* Pass off the Multiboot info structure to C land. */
-        mov     0x100300,%edi
-        lea     start(%rip),%rax
-        sub     $0x100000,%rax
+        mov     multiboot_ptr(%rip),%edi
+        lea     start-0x100000(%rip),%rax
         add     %rax,%rdi
         call    __start_xen
         ud2     /* Force a panic (invalid opcode). */
@@ -184,26 +183,30 @@
         call    printf
 1:      jmp     1b
 
-        .code32
 
-        .org    0x300
-                        
 /*** DESCRIPTOR TABLES ***/
 
 .globl idt
-.globl gdt
+.globl gdt        
+
+        .org    0x300
+        .code32
+
+multiboot_ptr:        /* 0x300 */
+        .long   0
 
-        .org    0x400
-        .word   LAST_RESERVED_GDT_BYTE
-        .long   0x101000 - FIRST_RESERVED_GDT_BYTE
-        
         .word   0
+nopaging_gdt_descr:   /* 0x306 */
+        .word   LAST_RESERVED_GDT_BYTE
+        .quad   gdt_table - FIRST_RESERVED_GDT_BYTE - __PAGE_OFFSET
+
+        .word   0,0,0
 gdt_descr:
         .word   LAST_RESERVED_GDT_BYTE
-gdt:       
+gdt:
         .quad   gdt_table - FIRST_RESERVED_GDT_BYTE
 
-        .word   0    
+        .word   0,0,0
 idt_descr:
         .word   256*16-1
 idt:
@@ -214,7 +217,7 @@
 
 high_start:
         .quad   __high_start
-                
+
         .org    0x1000
 ENTRY(gdt_table)
         .quad 0x0000000000000000     /* unused */
@@ -231,14 +234,14 @@
         .org 0x2000
 ENTRY(idle_pg_table)
 ENTRY(idle_pg_table_4)
-        .quad 0x0000000000102007 # PML4[0]
+        .quad idle_pg_table_l3 - __PAGE_OFFSET + 7 # PML4[0]
         .fill 261,8,0
-        .quad 0x0000000000102007 # PML4[262]
+        .quad idle_pg_table_l3 - __PAGE_OFFSET + 7 # PML4[262]
 
 /* Initial PDP -- level-3 page table */
         .org 0x3000
 ENTRY(idle_pg_table_l3)
-        .quad 0x0000000000103007
+        .quad idle_pg_table_l2 - __PAGE_OFFSET + 7
 
 /* Initial PDE -- level-2 page table. */
         .org 0x4000

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix x86/64 bootstrap., BitKeeper Bot <=