Make qemu-mips compile again. Still no grub-mkimage support
This commit is contained in:
parent
4fbf185232
commit
f440c33fd2
15 changed files with 110 additions and 23 deletions
|
@ -145,6 +145,11 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
|||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
|
||||
endif
|
||||
|
||||
if COND_mips_qemu_mips
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
||||
endif
|
||||
|
||||
if COND_powerpc_ieee1275
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
||||
|
|
|
@ -48,7 +48,7 @@ kernel = {
|
|||
i386_ieee1275_startup = kern/i386/ieee1275/startup.S;
|
||||
i386_coreboot_startup = kern/i386/coreboot/startup.S;
|
||||
i386_multiboot_startup = kern/i386/coreboot/startup.S;
|
||||
mips_yeeloong_startup = kern/mips/startup.S;
|
||||
mips_startup = kern/mips/startup.S;
|
||||
sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
|
||||
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
|
||||
|
||||
|
@ -82,6 +82,7 @@ kernel = {
|
|||
i386_coreboot = kern/generic/rtc_get_time_ms.c;
|
||||
i386_multiboot = kern/generic/rtc_get_time_ms.c;
|
||||
mips_yeeloong = kern/generic/rtc_get_time_ms.c;
|
||||
mips_qemu_mips = kern/generic/rtc_get_time_ms.c;
|
||||
|
||||
ieee1275 = disk/ieee1275/ofdisk.c;
|
||||
ieee1275 = kern/ieee1275/cmain.c;
|
||||
|
@ -140,10 +141,11 @@ kernel = {
|
|||
mips_yeeloong = bus/bonito.c;
|
||||
mips_yeeloong = bus/cs5536.c;
|
||||
mips_yeeloong = bus/pci.c;
|
||||
mips_yeeloong = kern/mips/cache.S;
|
||||
mips_yeeloong = kern/mips/dl.c;
|
||||
mips_yeeloong = kern/mips/init.c;
|
||||
mips = kern/mips/cache.S;
|
||||
mips = kern/mips/dl.c;
|
||||
mips = kern/mips/init.c;
|
||||
mips_yeeloong = kern/mips/yeeloong/init.c;
|
||||
mips_qemu_mips = kern/mips/qemu-mips/init.c;
|
||||
mips_yeeloong = term/at_keyboard.c;
|
||||
mips_yeeloong = term/serial.c;
|
||||
mips_yeeloong = video/sm712.c;
|
||||
|
@ -1229,7 +1231,7 @@ module = {
|
|||
mips_yeeloong = mmap/mips/yeeloong/uppermem.c;
|
||||
|
||||
enable = x86;
|
||||
enable = mips_yeeloong;
|
||||
enable = mips;
|
||||
};
|
||||
|
||||
module = {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
|
||||
/* Qemu doesn't emulate caches. Oh boy. */
|
||||
#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS
|
||||
move $t2, $a0
|
||||
addu $t3, $a0, $a1
|
||||
srl $t2, $t2, 5
|
||||
|
@ -21,3 +24,4 @@
|
|||
bne $t1, $zero, 2b
|
||||
addiu $t0, $t0, 0x1
|
||||
sync
|
||||
#endif
|
|
@ -6,9 +6,8 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
#include <grub/memory.h>
|
||||
|
||||
#define RAMSIZE (*(grub_uint32_t *) ((16 << 20) - 264))
|
||||
|
||||
|
|
|
@ -29,8 +29,10 @@
|
|||
#include <grub/i18n.h>
|
||||
|
||||
/* For frequencies. */
|
||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
||||
#include <grub/pci.h>
|
||||
#include <grub/machine/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
||||
/* This can be detected on runtime from PMON, but:
|
||||
|
@ -314,6 +316,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
linux_envp = extra;
|
||||
envp_off = (grub_uint8_t *) linux_envp - (grub_uint8_t *) playground;
|
||||
linux_envs = (char *) (linux_envp + 5);
|
||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
||||
grub_snprintf (linux_envs, sizeof ("memsize=XXXXXXXXXXXXXXXXXXXX"),
|
||||
"memsize=%lld",
|
||||
(unsigned long long) grub_mmap_get_lower () >> 20);
|
||||
|
@ -338,8 +341,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
+ target_addr;
|
||||
linux_envs += ALIGN_UP (grub_strlen (linux_envs) + 1, 4);
|
||||
|
||||
|
||||
linux_envp[4] = 0;
|
||||
#else
|
||||
linux_envp[0] = 0;
|
||||
#endif
|
||||
|
||||
grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
|
||||
initrd_loaded = 0;
|
||||
|
|
|
@ -671,6 +671,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
|||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN);
|
||||
}
|
||||
|
||||
#if defined (__i386) || defined (__x86_64__) || defined (GRUB_MACHINE_MIPS_YEELOONG)
|
||||
{
|
||||
struct multiboot_tag_basic_meminfo *tag
|
||||
= (struct multiboot_tag_basic_meminfo *) ptrorig;
|
||||
|
@ -682,6 +683,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
|||
tag->mem_upper = grub_mmap_get_upper () / 1024;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bootdev_set)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue