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-users

RE: [Xen-users] From 'xm create' to HVM guest

To: "Guillaume Thouvenin" <guillaume.thouvenin@xxxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-users] From 'xm create' to HVM guest
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Wed, 31 Jan 2007 15:55:07 +0100
Delivery-date: Wed, 31 Jan 2007 06:55:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070130205643.1wf1y21w084sgkoc@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdEqS7T/5FPu1KpTue3u6368nCP7AAnFgVA
Thread-topic: [Xen-users] From 'xm create' to HVM guest
 

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Guillaume Thouvenin
> Sent: 30 January 2007 19:57
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] From 'xm create' to HVM guest
> 
> Hello,
> 
> I'd like to know if I understand correctly how different parts of Xen
> communicates and how a HVM domain is started. I will try to describe
> steps starting from the 'xm create domU.hvm' to the HVM guest is
> up. There certainly are mistakes so if you want to add comments or/and
> fix mistakes you're welcome. Thus, before going deeper in the code
> I'd like to know if the following quick overview of Xen is correct.
> Thanks in advance for all comments.
> 
> # xm create domU.hvm
> 
> 1) 'xm' is a python script (tools/python/xen/xm). It checks 
> arguments and
> it passes them through the Xen daemon called 'xend'. It acts 
> as a client
> and xend acts as server. Xend provides two kinds of 
> connection: HTTP and
> UNIX socket.
> 
> 2) 'xend' is a mix between python and C 
> (tools/python/xen/xend/server).
> When it starts, '/usr/sbin/xend' launches xenstored, 
> xenconsoled, blktapctrl
> and starts itself as a daemon. When it gets information that a domain
> must be create it sends information to xenstore daemon called 
> 'xenstored'
> through /var/run/xend/socket.
> 
> 3) 'xenstored' is a C program (tools/xenstore). It's used to 
> communicate
> between domains and to store a database that contains 
> information about
> created domains. It offers two sockets, /var/run/xend/socket and
> /var/run/xend/ro_socket, and a device /dev/xen/evtchn. When 
> it receives
> the information of created domains, it refreshes the tdb 
> (trivial database)
> by using transaction. After that, it sends a message to Xen 
> to tell that
> a domain must be created by puting an event to the xenbus.

Fine so far (at least I don't see anything that I think is wrong - but
I've mostly spent my time on the step after 5 below). 
> 
> 4) Xen gets informations from xenbus that uses HYPERCALL. The 
> hypervisor
> creates the structure needed to keep information about the 
> new domain. At
> this point I don't know yet how HVMLoader is called.

This is done as part of the "domain building", which sets up the memory
configuration and loads the "kernel", which in the case of a HVM domain
is "hvmloader". 

This is in the tools/libxc/xc_hvm_build.c

> 
> ... to be completed :) ...
> 
> 5) The goal of the HVMLoader (tools/firmware) is to emulate 
> the BIOS. It
> sets environment needed by a kernel to start. It loaded the 
> ROMBIOS, the
> VGABIOS and the VMXASSIST. Now we have the basis to start an 
> unmodified
> kernel.

Actually it contains a (fairly) complete BIOS image which is used to
boot the machine. 

The BIOS is loaded by hvmloader into VM's physical address
0xE0000-0xFFFFF, and the VM will be launched by jumping to 0xffff0 -
that's the reset vector for an 8086 processor. Likewise, the VGABIOS is
a corresponding "complet" VGA BIOS, just like you'd find on a real
graphics card - the only difference is that it's open-source, which is
not the case for your average ATI/nVidia VGA BIOS... And of course, it's
not quite as complex as the latest versions of VGA BIOS - but it has all
the common functions needed to get the graphics card going. 

The rest of the machine boot process then follows standard PC boot
practice. The BIOS does exactly the same things as it would do on real
hardware, writing things to hardware registers, such as setting up timer
values, configuring hard-disk interface and detecting the hard-drive,
etc, etc. The only difference is that there is a QEMU process running
somewhere, and the hypervisor intercepts thos hardware register writes
(and reads too), forwards them to QEMU and waits for QEMU to perform
that particular operation. 

QEMU translates for example disk and network traffic to the internal
protocol used by Dom0, where the actual disk/file or network operation
is performed. 

--
Mats
> 
> 
> Best regards,
> Guillaume
> 
> 
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
> 
> 
> 



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

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