Merge mainline into newreloc
This commit is contained in:
commit
f0847685dd
26 changed files with 4939 additions and 29 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <grub/command.h>
|
||||
#include <grub/machine/loader.h>
|
||||
#include <grub/multiboot.h>
|
||||
#include <grub/cpu/multiboot.h>
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/elf.h>
|
||||
#include <grub/aout.h>
|
||||
|
@ -41,7 +42,7 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/i386/relocator.h>
|
||||
#include <grub/cpu/relocator.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/memory.h>
|
||||
#include <grub/i18n.h>
|
||||
|
@ -116,18 +117,12 @@ static grub_err_t
|
|||
grub_multiboot_boot (void)
|
||||
{
|
||||
grub_err_t err;
|
||||
struct grub_relocator32_state state =
|
||||
{
|
||||
.eax = MULTIBOOT_BOOTLOADER_MAGIC,
|
||||
.ecx = 0,
|
||||
.edx = 0,
|
||||
.eip = grub_multiboot_payload_eip,
|
||||
/* Set esp to some random location in low memory to avoid breaking
|
||||
non-compliant kernels. */
|
||||
.esp = 0x7ff00
|
||||
};
|
||||
struct grub_relocator32_state state = MULTIBOOT_INITIAL_STATE;
|
||||
|
||||
state.MULTIBOOT_ENTRY_REGISTER = grub_multiboot_payload_eip;
|
||||
|
||||
err = grub_multiboot_make_mbi (&state.MULTIBOOT_MBI_REGISTER);
|
||||
|
||||
err = grub_multiboot_make_mbi (&state.ebx);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
|
||||
#if defined(MULTIBOOT_LOAD_ELF32)
|
||||
# define XX 32
|
||||
# define E_MACHINE EM_386
|
||||
# define E_MACHINE MULTIBOOT_ELF32_MACHINE
|
||||
# define ELFCLASSXX ELFCLASS32
|
||||
# define Elf_Ehdr Elf32_Ehdr
|
||||
# define Elf_Phdr Elf32_Phdr
|
||||
#elif defined(MULTIBOOT_LOAD_ELF64)
|
||||
# define XX 64
|
||||
# define E_MACHINE EM_X86_64
|
||||
# define E_MACHINE MULTIBOOT_ELF64_MACHINE
|
||||
# define ELFCLASSXX ELFCLASS64
|
||||
# define Elf_Ehdr Elf64_Ehdr
|
||||
# define Elf_Phdr Elf64_Phdr
|
|
@ -22,6 +22,7 @@
|
|||
#include <grub/machine/biosnum.h>
|
||||
#endif
|
||||
#include <grub/multiboot.h>
|
||||
#include <grub/cpu/multiboot.h>
|
||||
#include <grub/cpu/relocator.h>
|
||||
#include <grub/disk.h>
|
||||
#include <grub/device.h>
|
||||
|
@ -89,7 +90,8 @@ grub_multiboot_load (grub_file_t file)
|
|||
{
|
||||
if (header->magic == MULTIBOOT_HEADER_MAGIC
|
||||
&& !(header->magic + header->architecture
|
||||
+ header->header_length + header->checksum))
|
||||
+ header->header_length + header->checksum)
|
||||
&& header->architecture == MULTIBOOT_ARCHITECTURE_CURRENT)
|
||||
break;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue