2009-05-17 Vladimir Serbinenko <phcoder@gmail.com>

trampoline for linux on 64-bit platform

	* conf/x86_64-efi.rmk (linux_mod_SOURCES): added 
	loader/i386/efi/linux_trampoline.S 
	* include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed 
	declration
	* kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here
	* loader/i386/linux_trampoline.S: moved here
	* loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline
	(jumpvector): removed
	(grub_linux_trampoline_start): new declaration
	(grub_linux_trampoline_end): likewise
	(grub_linux_boot): use trampoline when on 64-bit platform
	* loader/i386/linux.c: likewise
This commit is contained in:
phcoder 2009-05-17 11:27:08 +00:00
parent cb5a0f40a3
commit 22f53a96fd
7 changed files with 157 additions and 60 deletions

View file

@ -61,26 +61,3 @@ codestart:
call EXT_C(grub_main)
ret
.code32
FUNCTION(grub_linux_real_boot)
/* Turn off PG bit in CR0 and set CR3 to zero. */
movl %cr0, %eax
andl $0x7FFFFFFF, %eax
movl %eax, %cr0
/* Setup EFER (Extended Feature Enable Register). */
movl $0xc0000080, %ecx
rdmsr
/* Disable Long Mode. */
andl $0xFFFFFEFF, %eax
/* Make changes effective. */
wrmsr
/* Disable PAE. */
xorl %eax, %eax
movl %eax, %cr4
jmp *%ebx