Help Needed.

Ivan Pulleyn ivan at sixfold.com
Thu Jan 2 13:34:01 CET 2003


Hi, This may have nothing to do with your questions, but shouldn't
there be a 'cld' statement before the 'rep movsb'?

Ivan...





On 2 Jan 2003, sivakumar wrote:

> Hi,
> 
> I want to understand the flow of the following piece fo the code. It is
> for copying the Linuxbios image from Flash ROM to RAM.
> 
> Here I want to what is the value of the _liseg, _iseg, _eliseg  segment
> address. Can any one explain the following code.
> 
> My system hangs in this part of code (i.e. at rep and movsb instruction.
> As per the Ron's SUGGESTION I also used spd to get the value for RAM
> intialization.
> 
> But still it loop at this point
> 
> 	jz      .Lnocopy
>         movl    $EXT(_eliseg), %ecx
>         CONSOLE_DEBUG_TX_HEX32(%ecx)
>         subl    %esi, %ecx
>         jz      .Lnocopy                /* should not happen */
>         rep
>         movsb
>         CONSOLE_DEBUG_TX_STRING($siva_debug5)
> .Lnocopy:
> 	
> 
> Thanks,
> Siva.S
> 
> 
>  /*
>          *      Copy data into RAM and clear the BSS. Since these
> segments
>          *      isn\'t really that big we just copy/clear using bytes,
> not
>          *      double words.
>          */
>         CONSOLE_DEBUG_TX_STRING($siva_debug1)
>         intel_chip_post_macro(0x11)             /* post 11 */
> 
>         cld                             /* clear direction flag */
> 
>         /* copy linuxBIOS from it's initial load location to
>          * the location it is compiled to run at.
>          * Normally this is copying from FLASH ROM to RAM.
>          */
>         leal    EXT(_liseg), %esi
>         leal    EXT(_iseg), %edi
>         cmpl    %esi, %edi
>         jz      .Lnocopy
>         movl    $EXT(_eliseg), %ecx
>         CONSOLE_DEBUG_TX_HEX32(%ecx)
>         subl    %esi, %ecx
>         jz      .Lnocopy                /* should not happen */
>         rep
>         movsb
>         CONSOLE_DEBUG_TX_STRING($siva_debug5)
> .Lnocopy:
>         CONSOLE_DEBUG_TX_STRING($siva_debug6)
>         intel_chip_post_macro(0x12)             /* post 12 */
> 
>         /** clear stack */
>         leal    EXT(_stack), %edi
>         movl    $EXT(_estack), %ecx
>         subl    %edi, %ecx
>         xorl    %eax, %eax
>         rep
>         stosb
> 
>         /** clear bss */
>         leal    EXT(_bss), %edi
>         movl    $EXT(_ebss), %ecx
>         subl    %edi, %ecx
>         jz      .Lnobss
>         xorl    %eax, %eax
>         rep
>         stosb
> 
> 
> 
> 

-- 

----------------------------------------------------------------------
Ivan Pulleyn
Sixfold Technologies, LLC
Chicago Technology Park
2201 West Campbell Drive
Chicago, IL 60612

email:    ivan at sixfold.com
voice:    (866) 324-5460 x601
fax:      (312) 421-0388
----------------------------------------------------------------------




More information about the coreboot mailing list