merge boottest into newreloc

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-27 13:34:07 +02:00
commit 6c3d9c2845
95 changed files with 4206 additions and 3007 deletions

View file

@ -24,7 +24,7 @@
#include <grub/misc.h>
#include <grub/env.h>
#include <grub/mm.h>
#include <grub/machine/kernel.h>
#include <grub/kernel.h>
void
grub_efi_init (void)
@ -42,39 +42,58 @@ grub_efi_init (void)
void
grub_efi_set_prefix (void)
{
grub_efi_loaded_image_t *image;
grub_efi_loaded_image_t *image = NULL;
char *device = NULL;
char *path = NULL;
image = grub_efi_get_loaded_image (grub_efi_image_handle);
if (image)
{
char *pptr = NULL;
if (grub_prefix[0] == '(')
{
pptr = grub_strrchr (grub_prefix, ')');
if (pptr)
{
device = grub_strndup (grub_prefix + 1, pptr - grub_prefix - 1);
pptr++;
}
}
if (!pptr)
pptr = grub_prefix;
if (pptr[0])
path = grub_strdup (pptr);
}
if (!device || !path)
image = grub_efi_get_loaded_image (grub_efi_image_handle);
if (image && !device)
device = grub_efidisk_get_device_name (image->device_handle);
if (image && !path)
{
char *device;
char *file;
char *p;
device = grub_efidisk_get_device_name (image->device_handle);
file = grub_efi_get_filename (image->file_path);
path = grub_efi_get_filename (image->file_path);
if (device && file)
{
char *p;
char *prefix;
/* Get the directory. */
p = grub_strrchr (file, '/');
if (p)
*p = '\0';
prefix = grub_xasprintf ("(%s)%s", device, file);
if (prefix)
{
grub_env_set ("prefix", prefix);
grub_free (prefix);
}
}
grub_free (device);
grub_free (file);
/* Get the directory. */
p = grub_strrchr (path, '/');
if (p)
*p = '\0';
}
if (device && path)
{
char *prefix;
prefix = grub_xasprintf ("(%s)%s", device, path);
if (prefix)
{
grub_env_set ("prefix", prefix);
grub_free (prefix);
}
}
grub_free (device);
grub_free (path);
}
void

View file

@ -22,7 +22,6 @@
#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/machine/console.h>
#include <grub/machine/kernel.h>
#include <grub/types.h>
#include <grub/err.h>
#include <grub/dl.h>
@ -33,8 +32,10 @@
#include <grub/time.h>
#include <grub/symbol.h>
#include <grub/cpu/io.h>
#include <grub/cpu/kernel.h>
#include <grub/cpu/tsc.h>
#ifdef GRUB_MACHINE_QEMU
#include <grub/machine/kernel.h>
#endif
#define GRUB_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2
@ -128,6 +129,6 @@ grub_arch_modules_addr (void)
#ifdef GRUB_MACHINE_QEMU
return grub_core_entry_addr + grub_kernel_image_size;
#else
return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN);
return ALIGN_UP((grub_addr_t) _end, GRUB_KERNEL_MACHINE_MOD_ALIGN);
#endif
}

View file

@ -19,7 +19,7 @@
#include <grub/symbol.h>
#include <grub/machine/memory.h>
#include <grub/cpu/linux.h>
#include <grub/cpu/kernel.h>
#include <grub/offsets.h>
#include <multiboot.h>
#include <multiboot2.h>
@ -42,7 +42,7 @@ _start:
* This is a special data area at a fixed offset from the beginning.
*/
. = _start + GRUB_KERNEL_CPU_PREFIX
. = _start + GRUB_KERNEL_MACHINE_PREFIX
VARIABLE(grub_prefix)
/* to be filled by grub-mkimage */
@ -51,7 +51,7 @@ VARIABLE(grub_prefix)
* Leave some breathing room for the prefix.
*/
. = _start + GRUB_KERNEL_CPU_DATA_END
. = _start + GRUB_KERNEL_MACHINE_DATA_END
/*
* Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself).

View file

@ -19,7 +19,6 @@
#include <grub/symbol.h>
#include <grub/machine/memory.h>
#include <grub/cpu/linux.h>
#include <grub/cpu/kernel.h>
#include <multiboot.h>
#include <multiboot2.h>
@ -43,7 +42,7 @@ _start:
* This is a special data area at a fixed offset from the beginning.
*/
. = _start + GRUB_KERNEL_CPU_PREFIX
. = _start + GRUB_KERNEL_MACHINE_PREFIX
VARIABLE(grub_prefix)
/* to be filled by grub-mkimage */
@ -52,7 +51,7 @@ VARIABLE(grub_prefix)
* Leave some breathing room for the prefix.
*/
. = _start + GRUB_KERNEL_CPU_DATA_END
. = _start + GRUB_KERNEL_MACHINE_DATA_END
codestart:
movl %eax, EXT_C(grub_ieee1275_entry_fn)

View file

@ -27,7 +27,7 @@
_start:
jmp codestart
. = _start + GRUB_KERNEL_MACHINE_CORE_ENTRY_ADDR
. = _start + GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR
VARIABLE(grub_core_entry_addr)
.long 0
VARIABLE(grub_kernel_image_size)

View file

@ -20,7 +20,6 @@
#include <grub/kernel.h>
#include <grub/misc.h>
#include <grub/types.h>
#include <grub/machine/kernel.h>
#include <grub/ieee1275/ieee1275.h>
int (*grub_ieee1275_entry_fn) (void *);

View file

@ -29,10 +29,9 @@
#include <grub/misc.h>
#include <grub/time.h>
#include <grub/machine/console.h>
#include <grub/machine/kernel.h>
#include <grub/cpu/kernel.h>
#include <grub/ieee1275/ofdisk.h>
#include <grub/ieee1275/ieee1275.h>
#include <grub/offsets.h>
/* The minimal heap size we can live with. */
#define HEAP_MIN_SIZE (unsigned long) (2 * 1024 * 1024)
@ -284,5 +283,5 @@ grub_get_rtc (void)
grub_addr_t
grub_arch_modules_addr (void)
{
return ALIGN_UP((grub_addr_t) _end + GRUB_MOD_GAP, GRUB_MOD_ALIGN);
return ALIGN_UP((grub_addr_t) _end + GRUB_KERNEL_MACHINE_MOD_GAP, GRUB_KERNEL_MACHINE_MOD_ALIGN);
}

View file

@ -21,7 +21,6 @@
#include <grub/err.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/machine/kernel.h>
#include <grub/ieee1275/ieee1275.h>
enum grub_ieee1275_parse_type

View file

@ -18,7 +18,6 @@
#include <grub/kernel.h>
#include <grub/env.h>
#include <grub/mips/kernel.h>
void
grub_machine_set_prefix (void)

View file

@ -18,8 +18,9 @@
*/
#include <grub/symbol.h>
#include <grub/cpu/kernel.h>
#include <grub/offsets.h>
#include <grub/machine/memory.h>
#include <grub/offsets.h>
#define BASE_ADDR 8
@ -32,13 +33,13 @@ _start:
start:
bal codestart
base:
. = _start + GRUB_KERNEL_CPU_COMPRESSED_SIZE
. = _start + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE
compressed_size:
.long 0
. = _start + GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE
. = _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
total_module_size:
.long 0
. = _start + GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE
. = _start + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE
kernel_image_size:
.long 0
codestart:
@ -105,10 +106,10 @@ argdone:
#endif
/* Decompress the payload. */
addiu $a0, $s0, GRUB_KERNEL_CPU_RAW_SIZE - BASE_ADDR
addiu $a0, $s0, GRUB_KERNEL_MACHINE_RAW_SIZE - BASE_ADDR
lui $a1, %hi(compressed)
addiu $a1, %lo(compressed)
lw $a2, (GRUB_KERNEL_CPU_COMPRESSED_SIZE - BASE_ADDR)($s0)
lw $a2, (GRUB_KERNEL_MACHINE_COMPRESSED_SIZE - BASE_ADDR)($s0)
move $s1, $a1
/* $a0 contains source compressed address, $a1 is destination,
@ -134,9 +135,9 @@ reloccont:
addiu $t1, %lo(cont)
jr $t1
. = _start + GRUB_KERNEL_CPU_RAW_SIZE
. = _start + GRUB_KERNEL_MACHINE_RAW_SIZE
compressed:
. = _start + GRUB_KERNEL_CPU_PREFIX
. = _start + GRUB_KERNEL_MACHINE_PREFIX
VARIABLE(grub_prefix)
@ -146,7 +147,7 @@ VARIABLE(grub_prefix)
* Leave some breathing room for the prefix.
*/
. = _start + GRUB_KERNEL_CPU_DATA_END
. = _start + GRUB_KERNEL_MACHINE_DATA_END
#ifdef GRUB_MACHINE_MIPS_YEELOONG
VARIABLE (grub_arch_busclock)
.long 0
@ -171,17 +172,17 @@ cont:
/* Move the modules out of BSS. */
lui $t1, %hi(_start)
addiu $t1, %lo(_start)
lw $t2, (GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE - BASE_ADDR)($s0)
lw $t2, (GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE - BASE_ADDR)($s0)
addu $t2, $t1, $t2
lui $t1, %hi(_end)
addiu $t1, %lo(_end)
addiu $t1, (GRUB_MOD_ALIGN-1)
li $t3, (GRUB_MOD_ALIGN-1)
addiu $t1, (GRUB_KERNEL_MACHINE_MOD_ALIGN-1)
li $t3, (GRUB_KERNEL_MACHINE_MOD_ALIGN-1)
nor $t3, $t3, $0
and $t1, $t1, $t3
lw $t3, (GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE - BASE_ADDR)($s0)
lw $t3, (GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE - BASE_ADDR)($s0)
/* Backward copy. */
add $t1, $t1, $t3

View file

@ -26,7 +26,6 @@
#include <grub/time.h>
#include <grub/machine/kernel.h>
#include <grub/machine/memory.h>
#include <grub/cpu/kernel.h>
extern void grub_video_sm712_init (void);
extern void grub_video_init (void);

View file

@ -18,7 +18,7 @@
*/
#include <grub/symbol.h>
#include <grub/cpu/kernel.h>
#include <grub/offsets.h>
.extern __bss_start
.extern _end
@ -30,7 +30,7 @@ start:
_start:
b codestart
. = _start + GRUB_KERNEL_CPU_PREFIX
. = _start + GRUB_KERNEL_MACHINE_PREFIX
VARIABLE(grub_prefix)
/* to be filled by grub-mkelfimage */
@ -39,7 +39,7 @@ VARIABLE(grub_prefix)
* Leave some breathing room for the prefix.
*/
. = _start + GRUB_KERNEL_CPU_DATA_END
. = _start + GRUB_KERNEL_MACHINE_DATA_END
codestart:
li 2, 0

View file

@ -18,6 +18,7 @@
*/
#include <grub/symbol.h>
#include <grub/machine/kernel.h>
#include <grub/offsets.h>
.text
.align 4