From bcc8731efe65f9184cc46edcbbf79771759b8d84 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 23 Oct 2013 19:00:40 +0100 Subject: patches to support booting from my grub --- xen/arch/x86/boot/head.S | 19 +++++++++++++++++++ xen/arch/x86/boot/trampoline.S | 6 ++++++ xen/arch/x86/boot/x86_64.S | 3 +-- xen/drivers/char/console.c | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index b12eefb8be..8c0a80e41d 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -32,6 +32,15 @@ ENTRY(start) /* Checksum: must be the negated sum of the first two fields. */ .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) + .align 8 + /*Magic number */ + .quad 0xdeadbeefef104ead + .quad sym_phys(efi_loader_signature) + .quad sym_phys(efi_system_table_addr) + .quad sym_phys(realmode_available) + .quad sym_phys(boot_vid_mode) + .quad sym_phys(boot_vid_info) + .section .init.text, "ax" .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!" @@ -195,6 +204,16 @@ __start: reloc: #include "reloc.S" + .align 8 + + .globl efi_loader_signature +efi_loader_signature: + .quad 0x1 /* Non zero - must not be in bss, as xen resets the bss on init */ + + .globl efi_system_table_addr +efi_system_table_addr: + .quad 0x1 /* Non zero - must not be in bss, as xen resets the bss on init */ + ENTRY(trampoline_start) #include "trampoline.S" GLOBAL(trampoline_end) diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index 827f41219d..19d476e6b5 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -117,6 +117,9 @@ high_start: .code32 trampoline_boot_cpu_entry: + jmp .Lskip_realmode + cmpb $0xff,bootsym_rel(realmode_available,5) + jnz .Lskip_realmode cmpb $0,bootsym_rel(skip_realmode,5) jnz .Lskip_realmode @@ -202,6 +205,9 @@ trampoline_boot_cpu_entry: skip_realmode: .byte 0 +realmode_available: + .byte 0xff /* non-zero as xen resets bss on init */ + GLOBAL(kbd_shift_flags) .byte 0 diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 8f92402982..c78bd9fd58 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -132,11 +132,10 @@ GLOBAL(__page_tables_start) GLOBAL(l2_identmap) .quad sym_phys(l1_identmap) + __PAGE_HYPERVISOR pfn = 0 - .rept 7 + .rept 4 * L2_PAGETABLE_ENTRIES - 1 pfn = pfn + (1 << PAGETABLE_ORDER) .quad (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE .endr - .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0 .size l2_identmap, . - l2_identmap GLOBAL(l2_xenmap) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 508f84592e..d295ffa815 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -1062,7 +1062,7 @@ void panic(const char *fmt, ...) if ( opt_noreboot ) printk("Manual reset required ('noreboot' specified)\n"); else - printk("Reboot in five seconds...\n"); + printk("Reboot in thirty seconds...\n"); spin_unlock_irqrestore(&lock, flags); @@ -1079,7 +1079,7 @@ void panic(const char *fmt, ...) else { watchdog_disable(); - machine_restart(5000); + machine_restart(30000); } } -- cgit v1.2.3