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