Commit 71669c3b authored by Vladimir Serbinenko's avatar Vladimir Serbinenko

Implement XEN VFB support.

parent 60d1dd3d
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
Implement XEN VFB support.
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
Remove grub_bios_interrupt on coreboot.
......@@ -1291,8 +1291,8 @@ if test x"$grub_build_mkfont_excuse" = x ; then
else
enable_build_grub_mkfont=no
fi
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont])
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xxen || test "x$platform" = xcoreboot ); then
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot, xen and loongson ports needs build-time grub-mkfont])
fi
AC_SUBST([build_freetype_cflags])
......@@ -1360,8 +1360,8 @@ if test x"$enable_build_grub_mkfont" = xno ; then
FONT_SOURCE=
fi
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xxen || test "x$platform" = xcoreboot ); then
AC_MSG_ERROR([qemu, powerpc-ieee1275, xen, coreboot and loongson ports need unifont])
fi
AC_SUBST([FONT_SOURCE])
......
......@@ -64,7 +64,7 @@ GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"]
GROUPS["usb"] = GROUPS["pci"]
# If gfxterm is main output console integrate it into kernel
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ]
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ] + GROUPS["xen"]
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
......
......@@ -135,6 +135,12 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
endif
if COND_x86_64_xen
......@@ -144,6 +150,12 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
endif
if COND_x86_64_efi
......
......@@ -192,6 +192,9 @@ kernel = {
xen = term/xen/console.c;
xen = disk/xen/xendisk.c;
xen = commands/boot.c;
xen = commands/keylayouts.c;
xen = video/xen/xenfb.c;
xen = term/xen/xen_kbd.c;
ia64_efi = kern/ia64/efi/startup.S;
ia64_efi = kern/ia64/efi/init.c;
......
......@@ -27,6 +27,8 @@
#include <grub/i386/tsc.h>
#include <grub/term.h>
#include <grub/loader.h>
#include <grub/keyboard_layouts.h>
#include <grub/video.h>
grub_addr_t grub_modbase;
struct start_info *grub_xen_start_page_addr;
......@@ -67,6 +69,7 @@ grub_xen_alloc_shared_page (domid_t dom, grub_xen_grant_t * grnum)
ret = grub_memalign (GRUB_XEN_PAGE_SIZE, GRUB_XEN_PAGE_SIZE);
if (!ret)
return NULL;
grub_memset (ret, 0, GRUB_XEN_PAGE_SIZE);
mfn = grub_xen_ptr2mfn (ret);
entry->full_page.pad0 = 0;
entry->full_page.frame = mfn;
......@@ -254,6 +257,8 @@ grub_xenstore_write_file (const char *dir, const void *buf, grub_size_t len)
grub_size_t dirlen = grub_strlen (dir) + 1;
char *resp;
grub_dprintf ("xen", "writing `%s'\n", dir);
grub_memset (&msg, 0, sizeof (msg));
msg.type = XS_WRITE;
msg.len = dirlen + len;
......@@ -540,6 +545,13 @@ grub_machine_init (void)
map_all_pages ();
grub_video_xen_init ();
grub_font_init ();
grub_gfxterm_init ();
grub_keylayouts_init ();
grub_xen_keyboard_init ();
grub_console_init ();
grub_tsc_init ();
......@@ -563,6 +575,8 @@ void
grub_machine_fini (int flags __attribute__ ((unused)))
{
grub_xendisk_fini ();
grub_video_xen_fini ();
grub_xen_keyboard_fini ();
grub_boot_fini ();
}
......
......@@ -344,6 +344,7 @@ grub_linux_setup_video (struct linux_kernel_params *params)
case GRUB_VIDEO_DRIVER_IEEE1275:
case GRUB_VIDEO_DRIVER_COREBOOT:
/* Make gcc happy. */
case GRUB_VIDEO_DRIVER_XEN:
case GRUB_VIDEO_DRIVER_SDL:
case GRUB_VIDEO_DRIVER_NONE:
case GRUB_VIDEO_ADAPTER_CAPTURE:
......
......@@ -222,6 +222,8 @@ grub_xen_boot (void)
grub_xen_mfn_t *new_mfn_list;
grub_size_t i;
grub_video_restore ();
if (grub_xen_n_allocated_shared_pages)
return grub_error (GRUB_ERR_BUG, "active grants");
......
......@@ -114,8 +114,8 @@ static struct grub_term_output grub_console_term_output = {
void
grub_console_init (void)
{
grub_term_register_input ("console", &grub_console_term_input);
grub_term_register_output ("console", &grub_console_term_output);
grub_term_register_input_active ("console", &grub_console_term_input);
grub_term_register_output_active ("console", &grub_console_term_output);
grub_terminfo_init ();
grub_terminfo_output_register (&grub_console_term_output, "vt100-color");
......
This diff is collapsed.
This diff is collapsed.
......@@ -290,7 +290,8 @@ typedef enum grub_video_driver_id
GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
GRUB_VIDEO_DRIVER_COREBOOT,
GRUB_VIDEO_DRIVER_IEEE1275,
GRUB_VIDEO_ADAPTER_CAPTURE
GRUB_VIDEO_ADAPTER_CAPTURE,
GRUB_VIDEO_DRIVER_XEN
} grub_video_driver_id_t;
typedef enum grub_video_adapter_prio
......
......@@ -21,7 +21,7 @@
int EXPORT_FUNC (grub_xen_sched_op) (int cmd, void *arg) __attribute__ ((sysv_abi));
int grub_xen_update_va_mapping (void *addr, uint64_t pte, uint64_t flags) __attribute__ ((sysv_abi));
int grub_xen_event_channel_op (int op, void *arg) __attribute__ ((sysv_abi));
int EXPORT_FUNC (grub_xen_event_channel_op) (int op, void *arg) __attribute__ ((sysv_abi));
int grub_xen_mmuext_op (mmuext_op_t * ops,
unsigned int count,
......
......@@ -82,6 +82,15 @@ void grub_console_init (void);
void grub_xendisk_fini (void);
void grub_xendisk_init (void);
void
grub_xen_keyboard_init (void);
void
grub_xen_keyboard_fini (void);
void
grub_video_xen_init (void);
void
grub_video_xen_fini (void);
#ifdef __x86_64__
typedef grub_uint64_t grub_xen_mfn_t;
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment