grub_emu_LDFLAGS = $(LIBCURSES)
-kernel_img_SOURCES = kern/mipsel/qemu-r4k/startup.S \
+kernel_img_SOURCES = kern/mips/qemu-r4k/startup.S \
kern/main.c kern/device.c kern/$(target_cpu)/$(target_machine)/init.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
powerpc-ieee1275) ;;
sparc64-ieee1275) ;;
mipsel-qemu-r4k) ;;
+ mips-qemu-r4k) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
case "$target_cpu" in
i386 | powerpc) target_m32=1 ;;
x86_64 | sparc64) target_m64=1 ;;
+ mipsel) TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1"; target_cpu=mips ;;
+ mips) TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1" ;;
esac
case "$host_os" in
--- /dev/null
+/* cache.h - Flush the processor's cache. */
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 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_CPU_CACHE_H
+#define GRUB_CPU_CACHE_H 1
+
+#include <grub/symbol.h>
+#include <grub/types.h>
+
+void EXPORT_FUNC(grub_cpu_flush_cache) (void *start, grub_size_t size, int type);
+#endif
--- /dev/null
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 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/>.
+ */
+
+void *EXPORT_FUNC (memset) (void *s, int c, int n) __attribute__ ((weak));
+void EXPORT_FUNC (__ashldi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__ashrdi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__lshrdi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__trampoline_setup) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__ucmpdi2) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__bswapsi2) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__bswapdi2) (void) __attribute__ ((weak));
/* The size of long. */
#define GRUB_TARGET_SIZEOF_LONG 4
+#ifdef GRUB_CPU_MIPSEL
/* mipsEL is little-endian. */
#undef GRUB_TARGET_WORDS_BIGENDIAN
+#elif defined (GRUB_CPU_MIPS)
+/* mips is big-endian. */
+#define GRUB_TARGET_WORDS_BIGENDIAN
+#else
+#error Neither GRUB_CPU_MIPS nor GRUB_CPU_MIPSEL is defined
+#endif
#endif /* ! GRUB_TYPES_CPU_HEADER */
switch (ELF_R_TYPE (rel->r_info))
{
+#if 0
case R_386_32:
*addr += sym->st_value;
break;
*addr += (sym->st_value - (Elf_Word) seg->addr
- rel->r_offset);
break;
+#endif
+ default:
+ grub_printf ("Unknown relocation type %d\n",
+ ELF_R_TYPE (rel->r_info));
+ break
}
}
}
int
grub_getkey (void)
{
- return (grub_cur_term_input->getkey) ();
+ while (!(*((grub_uint8_t *)0x140003f8+5) & 0x01));
+ return *((grub_uint8_t *)0x140003f8);
+ // return (grub_cur_term_input->getkey) ();
}
int
grub_checkkey (void)
{
- return (grub_cur_term_input->checkkey) ();
+ return !!(*((grub_uint8_t *)0x140003f8+5) & 0x01);
+ //return (grub_cur_term_input->checkkey) ();
}
int
grub_getkeystatus (void)
{
- if (grub_cur_term_input->getkeystatus)
+ /* if (grub_cur_term_input->getkeystatus)
return (grub_cur_term_input->getkeystatus) ();
- else
+ else*/
return 0;
}