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: Kevin O'Connor <kevin@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [SeaBIOS] [PATCH 2/2] Basic support for booting directly as Xen HVM firmware.
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Mon, 16 May 2011 09:45:02 +0100
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "seabios@xxxxxxxxxxx" <seabios@xxxxxxxxxxx>
Delivery-date: Mon, 16 May 2011 01:46:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110514140256.GC7008@xxxxxxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <1305302343.31488.162.camel@xxxxxxxxxxxxxxxxxxxxxx> <1305302364-18932-2-git-send-email-ian.campbell@xxxxxxxxxx> <20110514140256.GC7008@xxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sat, 2011-05-14 at 15:02 +0100, Kevin O'Connor wrote:
> 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.

I wasn't sure if these CMOS addresses were well defined enough that DOS
applications etc might look at them. Sounds like you are saying they are
not so I'll remove this bit.

>                                                           With
> SeaBIOS, just set the global variables RamSize and RamSizeOver4G and
> make sure the appropriate add_e820 calls are made.

So would it be best to add a new case to ram_probe()?

> [...]
> > --- /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.

OK. I'll do that.

> [...]
> > --- /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.

This file was taken verbatim (except s/uint([0-9]*_t/u\1/g) from the
public headers provided by Xen, which have this permissive license to
allow them to be incorporated into other projects as necessary.

I think (although I should check first) that as long as we only ever
expect changes to flow from the Xen headers into SeaBIOS it would be
permissible under the terms of this license to subsume this file under
SeaBIOS's GPLv3 license, if you would prefer to do it that way.

There's likely to be a smallish number of other interface headers
required in this way (e.g. xenstore and pv block interfaces for pv
driver support, a small number of hypercall interfaces etc). Is the
general approach of importing these headers as required ok or shall I
look into a mechanism for supplying SeaBIOS with an out-of-tree set of
headers to use?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>