A question about decompressing kernel on boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

In the source code arch/x86/boot/compressed/head_64.S, it described
how compressed kernel is copied from the origin place to another pointed by rbx register.

But I'm confused about the copying code, why it needs to minus 8 from _bss when calculating
_bss original and new addresses.

This is the source code.
/*
 * Copy the compressed kernel to the end of our buffer
 * where decompression in place becomes safe.
 */
pushq %rsi
leaq (_bss-8)(%rip), %rsi
leaq (_bss-8)(%rbx), %rdi
movq $_bss /* - $startup_32 */, %rcx
shrq $3, %rcx
std
rep movsq
cld
popq %rsi

Thanks,
Larry
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux