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] Problems setting up GDT in custom builder

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Problems setting up GDT in custom builder
From: Ivan Kelly <ivan@xxxxxxxxxxxxx>
Date: Thu, 26 Jan 2006 13:38:53 +0000
Delivery-date: Thu, 26 Jan 2006 13:47:57 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Ivan Kelly <ivan@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
In having problems getting a custom built GDT which I set up in my custom
builder to work. Im putting aside 16 frames for the GDT, and initialising it
with the values that I need (one descriptor for CS at 6, one for DS at 3). 
The GDT seems to get getting the correct values. The CS segment is the same as
the default FLAT_GUESTOS_CS. The DS is slightly different, since I need my
data segment to start at 0x6000.
My GDT is at 0x593000 and gdb shows the contents of entry 3 and entry
260(FLAT_GUESTOS_DS) as follows.

(gdb) x/2x 0x593000+(0x3*0x8)
0x593018:       0x6000c3f9      0x00cfb300
(gdb) x/2x 0x593000+(260*0x8)
0x593820:       0x0000c3ff      0x00cfb300

Almost identical exept that base (B0-B15) are 6000. The limit is slightly
different but that should affect anything.

I set the domain to use the new descriptors in the builder.
    
<SNIP>
         *       [ECX,EDX,EDI,EBP are zero]                                     
                     
         *       EFLAGS = IF | 2 (bit 1 is reserved and should always be 1)     
                     
         */
        ctxt->cpu_ctxt.ds = DS_SELECTOR; /*FLAT_GUESTOS_DS;*/
        ctxt->cpu_ctxt.es = FLAT_GUESTOS_DS;
        ctxt->cpu_ctxt.fs = FLAT_GUESTOS_DS;
        ctxt->cpu_ctxt.gs = FLAT_GUESTOS_DS;
        ctxt->cpu_ctxt.ss = FLAT_GUESTOS_DS;
        ctxt->cpu_ctxt.cs = CS_SELECTOR; /*FLAT_GUESTOS_CS;*/
        ctxt->cpu_ctxt.eip = dsi.processes[KERNEL].entry;
<ENDSNIP>

<SNIP2>
#define DS_SELECTOR         0x19  /* 00011 | 001 */
#define CS_SELECTOR         0x31  /* 00110 | 001 */
<ENDSNIP2>

full source:
http://secure.bleurgh.com/svn/xen/trunk/tools/libxc/xc_minix_build.c

To me this looks like it should work perfectly, but when I try to run my
kernel on it, mov instructions seem to be using 0x0 (physical addr) as their
base.

Could anyone point out my mistake. It's driving me nuts :)
Regards
Ivan Kelly


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Problems setting up GDT in custom builder, Ivan Kelly <=