summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vlasov <vsu@altlinux.ru>2008-07-22 13:46:08 +0400
committerH. Peter Anvin <hpa@zytor.com>2008-07-22 12:58:02 -0400
commit2870b77cd5d04addc8e956ba21e91bde08e4db66 (patch)
tree28d93d209691950a361cfb98ba5812e3201ca970
parenteec9fe478cfcf9ba45455f68715cba4b57be7ea6 (diff)
downloadsyslinux-2870b77cd5d04addc8e956ba21e91bde08e4db66.tar.gz
Fix initrd overwriting the kernel for some kernel sizes
The address in EDI returned by the load_high call used to load the kernel needs to be passed to parse_load_initrd, but the code which clears memory after setup sectors for 1.2.x kernels was corrupting low 16 bits of EDI. In most cases this corruption was not noticed, because with usual setup sizes DI was set to 0xf800, therefore the chance of getting the kernel size such that initrd would actually overwrite the kernel was about 3%. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/runkernel.inc2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/runkernel.inc b/core/runkernel.inc
index c7af6cc7..5748b0b7 100644
--- a/core/runkernel.inc
+++ b/core/runkernel.inc
@@ -270,6 +270,7 @@ high_load_done:
; if they see protected-mode kernel data after the setup sectors, so
; clear that memory.
;
+ push di
mov di,[SetupSecs]
shl di,9
xor eax,eax
@@ -277,6 +278,7 @@ high_load_done:
sub cx,di
shr cx,2
rep stosd
+ pop di
;
; Now see if we have an initial RAMdisk; if so, do requisite computation