[gPXE-devel] [PATCH v3][lkrn] add ramdisk support
Wu Fengguang
fengguang.wu at intel.com
Thu Jun 3 03:14:20 EDT 2010
On Thu, Jun 03, 2010 at 03:01:02PM +0800, Stefan Hajnoczi wrote:
> On Thu, Jun 3, 2010 at 4:06 AM, Wu Fengguang <fengguang.wu at intel.com> wrote:
> > --- gpxe.orig/src/arch/i386/prefix/libprefix.S 2010-06-03 10:38:34.000000000 +0800
> > +++ gpxe/src/arch/i386/prefix/libprefix.S 2010-06-03 10:40:58.000000000 +0800
> > @@ -704,6 +704,11 @@ install_prealloc:
> > /* Set up %ds for access to .data16 */
> > movw %bx, %ds
> >
> > + movl %es:ramdisk_image, %ecx
> > + movl %ecx, lkrn_ramdisk
> > + movl %es:ramdisk_size, %ecx
> > + movl %ecx, lkrn_ramdisk_size
> > +
> > #ifdef KEEP_IT_REAL
> > /* Initialise libkir */
> > movw %ax, (init_libkir_vector+2)
> >
>
> I would put this in lkrnprefix.S instead. If you look at pxeprefix.S
Yes the V2 patch has the code in lkrnprefix.S, however..
> there is code to copy an undi device structure for .prefix.data to the
> .data16 section:
>
> /* Copy our undi_device structure to the preloaded_undi variable */
> movw %bx, %es
> movw $preloaded_undi, %di
> movw $undi_device, %si
> movw $undi_device_size, %cx
> rep movsb
>
> This is done after install has returned to pxeprefix.S.
..when install has returned, the gpxe relocation has done.
So we missed the chance to relocate to some place _outside of_ the
ramdisk region.
Normally it's very unlikely that the small ramdisk script get
overwritten in gPXE relocation. So I can do this as long as you are OK
with it.
Thanks,
Fengguang
More information about the gPXE-devel
mailing list