diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-13 22:05:41 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-13 22:05:41 -0700 |
commit | 95a461a83adf65aa5689b65f85330ce970121f56 (patch) | |
tree | de8455836beab1ca73014bf57a0e855542577574 /core/init.inc | |
parent | 376a2bfe09b8292140d7a40ce77a1cc7f4316e17 (diff) | |
download | syslinux-95a461a83adf65aa5689b65f85330ce970121f56.tar.gz |
core: zero bss and uibss; fix some section confusions
Set .bss and .uibss as soon as we are fully loaded. This gives us the
more familiar behavior of most normal execution environments. The
.earlybss section is not zeroed; therefore, all variables that are set
before we have the opportunity to zero need to go in this section.
This checkin also fixes some incorrect section directives.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/init.inc')
-rw-r--r-- | core/init.inc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/init.inc b/core/init.inc index 0b213ace..827a5097 100644 --- a/core/init.inc +++ b/core/init.inc @@ -2,6 +2,7 @@ ; ----------------------------------------------------------------------- ; ; Copyright 2004-2008 H. Peter Anvin - All Rights Reserved +; Copyright 2009 Intel Corporation; author: H. Peter Anvin ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -19,6 +20,16 @@ section .text common_init: + ; Zero bss sections (but not .earlybss, since it may + ; contain already-live data.) + xor eax,eax + mov di,__bss_start + mov cx,__bss_dwords + rep stosd + mov di,__uibss_start + mov cx,__uibss_dwords + rep stosd + ; Now set up screen parameters call adjust_screen |