WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [SeaBIOS] [PATCH 2/2] Basic support for booting directly

To: Ian Campbell <ian.campbell@xxxxxxxxxx>
Subject: [Xen-devel] Re: [SeaBIOS] [PATCH 2/2] Basic support for booting directly as Xen HVM firmware.
From: Kevin O'Connor <kevin@xxxxxxxxxxxx>
Date: Sat, 14 May 2011 10:02:56 -0400
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, seabios@xxxxxxxxxxx
Delivery-date: Tue, 17 May 2011 16:33:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1305302364-18932-2-git-send-email-ian.campbell@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1305302343.31488.162.camel@xxxxxxxxxxxxxxxxxxxxxx> <1305302364-18932-2-git-send-email-ian.campbell@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
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