hw_x86_64: Zero-fill BSS segment in x86_64 crt0.s

Make sure all content of the BSS segment is initialized to zero.
This commit is contained in:
Adrian-Ken Rueegsegger 2015-03-12 17:36:56 +01:00 committed by Christian Helmuth
parent 69a58c4bd5
commit ace61c54d6
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,16 @@
.global _start
_start:
/**
* zero-fill BSS segment
*/
leal _bss_start, %edi
leal _bss_end, %ecx
sub %edi, %ecx
shr $2, %ecx
xor %eax, %eax
rep stosl
/* Enable PAE (prerequisite for IA-32e mode) and OSFXSR */
movl %cr4, %eax
btsl $5, %eax