Move grub_chainloader_real_boot out of the kernel.

* grub-core/Makefile.am: Remove machine/loader.h.
	* grub-core/kern/i386/pc/startup.S (grub_chainloader_real_boot):
	Removed.
	* grub-core/lib/i386/relocator.c (grub_relocator16_esi): New extern
	variable.
	(grub_relocator16_keep_a20_enabled): Likewise.
	(grub_relocator16_boot): Fill new variables.
	* grub-core/lib/i386/relocator16.S: Add gate a20 handling.
	* grub-core/loader/i386/pc/chainloader.c (grub_chainloader_boot): Use
	relocator.
	(grub_chainloader_unload): Likewise.
	(grub_chainloader_cmd): Likewise.
	* include/grub/i386/pc/loader.h: Removed.
	* include/grub/i386/relocator.h (grub_relocator16_state): Add a20
	and esi. All initialisers updated.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-11-12 15:46:50 +01:00
commit 678f4b6713
12 changed files with 168 additions and 69 deletions

View file

@ -1,27 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2007 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_LOADER_MACHINE_HEADER
#define GRUB_LOADER_MACHINE_HEADER 1
#include <grub/symbol.h>
/* This is an asm part of the chainloader. */
void EXPORT_FUNC(grub_chainloader_real_boot) (int drive, void *part_addr) __attribute__ ((noreturn));
#endif /* ! GRUB_LOADER_MACHINE_HEADER */

View file

@ -48,6 +48,8 @@ struct grub_relocator16_state
grub_uint16_t ip;
grub_uint32_t ebx;
grub_uint32_t edx;
grub_uint32_t esi;
int a20;
};
struct grub_relocator64_state