Subject: Re: help with x86 assembly
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Christian Limpach <chris@pin.lu>
List: port-xen
Date: 12/23/2004 21:06:25
> > You don't want to use xen12load for xen2 since xen2 loads an elf image
to
> > run as kernel in dom0.
>
> You mean, we don't need a xen12load equivalent, or a xen12load equivalent
> can't work with xen 2.0 ?

You don't need an equivalent since you can load kernels directly.

> > The loader is missing the part to load a NetBSD symbol table but that
can be
> > easily added.
>
> Would be nice to have a ddb usable in dom0 :)

You could embed the symbol table into the kernel (dbsym and SYMTAB_SPACE) or
add support to Xen (it's a copy/paste job adding the code from the userland
domain builder to the in-xen dom0 domain builder).

> > > but at compile time I get:
> > > xenload.c: In function `HYPERVISOR_console_write_pic':
> > > xenload.c:86: error: can't find a register in class `BREG' while
reloading
> > `asm'
> >
> > gcc already uses %ebx to generate pic code (since xen12load is compiled
> > with -fpic or -fPIC), you'd need to explicitly load %ebx like in the
> > original HYPERVISOR_console_write_pic function....
>
> Hum, I tried to add "movl    %2,%%ebx;" before TRAP_INSTR, but this didn't
> help. I guess there's something else to be done to translate the code
> in hyperviror.h to PIC code.

You will also need to change the requested register allocation (don't
request a "b" output register, put what is supposed to end up in %ebx in
another register, using "r", declare "ebx" as clobbered).

> Anyway, if a xenload isn't needed any more, I'll give up on this and try
> to load a kernel directly.

good move ;-)

    christian