On Fri, May 13, 2011 at 04:59:24PM +0100, Ian Campbell wrote:
> This allows a guest to be booted using SeaBIOS directly as its
> firmware rather than being loaded indirectly via hvmloader. This is
> presented as a proof of concept since it's not obvious yet which the
> best approach will be from either Xen or SeaBIOS's point of view.
Thanks. See my comments below.
[...]
> --- /dev/null
> +++ b/src/xen.c
> @@ -0,0 +1,93 @@
[...]
> +/* Replace possibly erroneous memory-size CMOS fields with correct values. */
> +static void cmos_write_memory_size(u32 low_mem_pgend, u32 high_mem_pgend)
> +{
[...]
> + /* All BIOSes: conventional memory (CMOS *always* reports 640kB). */
> + outb_cmos((u8)(base_mem >> 0), 0x15);
> + outb_cmos((u8)(base_mem >> 8), 0x16);
> +
> + /* All BIOSes: extended memory (1kB chunks above 1MB). */
> + outb_cmos((u8)( ext_mem >> 0), CMOS_MEM_EXTMEM_LOW);
> + outb_cmos((u8)( ext_mem >> 8), CMOS_MEM_EXTMEM_HIGH);
[...]
These cmos variables (all of them) are just a communication mechanism
between Bochs and rombios - there's no need to set them. With
SeaBIOS, just set the global variables RamSize and RamSizeOver4G and
make sure the appropriate add_e820 calls are made.
[...]
> --- /dev/null
> +++ b/src/xen.h
> @@ -0,0 +1,26 @@
> +#ifndef __XEN_H
> +#define __XEN_H
> +
> +#ifdef CONFIG_XEN
Just a style note - I'd prefer to avoid #ifdefs in the code. Just
declare the variables/code unconditionally and add an "if
(!CONFIG_XEN) return;" to the top of any externally called functions.
SeaBIOS uses gcc's -fwhole-program and linker scripts to weed out
unneeded code and variables.
[...]
> --- /dev/null
> +++ b/src/xen/hvm/hvm_info_table.h
> @@ -0,0 +1,75 @@
> +/******************************************************************************
> + * hvm/hvm_info_table.h
> + *
> + * HVM parameter and information table, written into guest memory map.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> copy
> + * of this software and associated documentation files (the "Software"), to
[...]
That's a big copyright statement for one little struct.
-Kevin
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|