2010-01-14 Robert Millan <rmh.grub@aybabtu.com>

* include/grub/i386/loader.h (grub_linux16_boot): Renamed to ...
	(grub_linux16_real_boot): ... this.
	* kern/i386/loader.S: Likewise.
	* loader/i386/pc/linux.c: Include `<grub/video.h>' and `<grub/mm.h>'.
	(grub_linux16_boot): New function.  Switches to text mode and calls
	grub_linux16_real_boot().
	
	* loader/i386/bsd.c: Include `<grub/video.h>'.
	(grub_freebsd_boot, grub_openbsd_boot, grub_netbsd_boot): Switch to
	text mode before calling grub_unix_real_boot().
	
	* loader/i386/multiboot.c: Include `<grub/video.h>'.
	(grub_multiboot_boot): Switch to text mode before calling
	grub_relocator32_boot().
	
	* loader/i386/pc/chainloader.c: Include `<grub/video.h>'.
	(grub_chainloader_boot): Switch to text mode before calling
	grub_chainloader_real_boot().
This commit is contained in:
Robert Millan 2010-01-14 21:08:31 +00:00
parent d6f93a661c
commit 0a46429a55
7 changed files with 52 additions and 8 deletions

View File

@ -1,3 +1,24 @@
2010-01-14 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/i386/loader.h (grub_linux16_boot): Renamed to ...
(grub_linux16_real_boot): ... this.
* kern/i386/loader.S: Likewise.
* loader/i386/pc/linux.c: Include `<grub/video.h>' and `<grub/mm.h>'.
(grub_linux16_boot): New function. Switches to text mode and calls
grub_linux16_real_boot().
* loader/i386/bsd.c: Include `<grub/video.h>'.
(grub_freebsd_boot, grub_openbsd_boot, grub_netbsd_boot): Switch to
text mode before calling grub_unix_real_boot().
* loader/i386/multiboot.c: Include `<grub/video.h>'.
(grub_multiboot_boot): Switch to text mode before calling
grub_relocator32_boot().
* loader/i386/pc/chainloader.c: Include `<grub/video.h>'.
(grub_chainloader_boot): Switch to text mode before calling
grub_chainloader_real_boot().
2010-01-05 Jordan Uggla <jordan.uggla@gmail.com>
2010-01-05 Colin Watson <cjwatson@ubuntu.com>

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,2004,2007,2008,2009,2010 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
@ -31,7 +31,7 @@ extern grub_uint32_t EXPORT_VAR(grub_linux_prot_size);
extern char *EXPORT_VAR(grub_linux_tmp_addr);
extern char *EXPORT_VAR(grub_linux_real_addr);
extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage);
grub_err_t EXPORT_FUNC(grub_linux16_boot) (void);
grub_err_t EXPORT_FUNC(grub_linux16_real_boot) (void);
#endif
#endif /* ! GRUB_LOADER_CPU_HEADER */

View File

@ -59,7 +59,7 @@ VARIABLE(grub_linux_real_addr)
VARIABLE(grub_linux_is_bzimage)
.long 0
FUNCTION(grub_linux16_boot)
FUNCTION(grub_linux16_real_boot)
/* Must be done before zImage copy. */
call EXT_C(grub_dl_unload_all)

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
* Copyright (C) 2008,2009,2010 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
@ -35,7 +35,7 @@
#include <grub/command.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/video.h>
#ifdef GRUB_MACHINE_PCBIOS
#include <grub/machine/biosnum.h>
#endif
@ -509,6 +509,8 @@ grub_freebsd_boot (void)
bi.bi_kernend = kern_end;
grub_video_set_mode ("text", NULL);
if (is_64bit)
{
grub_uint32_t *gdt;
@ -617,6 +619,8 @@ grub_openbsd_boot (void)
pa->ba_type = OPENBSD_BOOTARG_END;
pa++;
grub_video_set_mode ("text", NULL);
grub_unix_real_boot (entry, bootflags, openbsd_root, OPENBSD_BOOTARG_APIVER,
0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
(grub_uint32_t) (grub_mmap_get_lower () >> 10),
@ -713,6 +717,8 @@ grub_netbsd_boot (void)
bootinfo->bi_data[0] = mmap;
}
grub_video_set_mode ("text", NULL);
grub_unix_real_boot (entry, bootflags, 0, bootinfo,
0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
(grub_uint32_t) (grub_mmap_get_lower () >> 10));

View File

@ -1,7 +1,7 @@
/* multiboot.c - boot a multiboot OS image. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 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
@ -46,6 +46,7 @@
#include <grub/gzio.h>
#include <grub/env.h>
#include <grub/i386/relocator.h>
#include <grub/video.h>
extern grub_dl_t my_mod;
static grub_size_t code_size, alloc_mbi;
@ -89,6 +90,8 @@ grub_multiboot_boot (void)
if (err)
return err;
grub_video_set_mode ("text", NULL);
grub_relocator32_boot (grub_multiboot_payload_orig,
grub_multiboot_payload_dest,
state);

View File

@ -1,7 +1,7 @@
/* chainloader.c - boot another boot loader */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2004,2007,2009 Free Software Foundation, Inc.
* Copyright (C) 2002,2004,2007,2009,2010 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
@ -33,6 +33,7 @@
#include <grub/command.h>
#include <grub/machine/biosnum.h>
#include <grub/i18n.h>
#include <grub/video.h>
static grub_dl_t my_mod;
static int boot_drive;
@ -41,6 +42,7 @@ static void *boot_part_addr;
static grub_err_t
grub_chainloader_boot (void)
{
grub_video_set_mode ("text", NULL);
grub_chainloader_real_boot (boot_drive, boot_part_addr);
/* Never reach here. */

View File

@ -1,7 +1,7 @@
/* linux.c - boot Linux zImage or bzImage */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 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
@ -31,6 +31,8 @@
#include <grub/cpu/linux.h>
#include <grub/command.h>
#include <grub/i18n.h>
#include <grub/mm.h>
#include <grub/video.h>
#define GRUB_LINUX_CL_OFFSET 0x9000
#define GRUB_LINUX_CL_END_OFFSET 0x90FF
@ -48,6 +50,16 @@ grub_linux_unload (void)
return GRUB_ERR_NONE;
}
static grub_err_t
grub_linux16_boot (void)
{
grub_video_set_mode ("text", NULL);
grub_linux16_real_boot ();
/* Not reached. */
return GRUB_ERR_NONE;
}
static grub_err_t
grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])