From d8f1d5b4731228689b6badd0b34720c3dc9eeeed Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 15 Jun 2008 10:43:14 -0700 Subject: [PATCH] writestr_early: save/restore registers We have made it this far without it, but it seems like a disaster waiting to happen. We can afford the extra four bytes in sector 1. --- core/extlinux.asm | 4 +++- core/ldlinux.asm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/extlinux.asm b/core/extlinux.asm index 087fc3c..c416541 100644 --- a/core/extlinux.asm +++ b/core/extlinux.asm @@ -692,6 +692,7 @@ verify_checksum: ; messages, so it should be OK. ; writestr_early: + pushad .loop: lodsb and al,al jz .return @@ -699,7 +700,8 @@ writestr_early: mov bx,0007h ; Attribute int 10h jmp short .loop -.return: ret +.return: popad + ret ; getlinsecsr: save registers, call getlinsec, restore registers diff --git a/core/ldlinux.asm b/core/ldlinux.asm index 193bb06..5a205c0 100644 --- a/core/ldlinux.asm +++ b/core/ldlinux.asm @@ -712,6 +712,7 @@ verify_checksum: ; messages, so it should be OK. ; writestr_early: + pushad .loop: lodsb and al,al jz .return @@ -719,7 +720,8 @@ writestr_early: mov bx,0007h ; Attribute int 10h jmp short .loop -.return: ret +.return: popad + ret ; getlinsecsr: save registers, call getlinsec, restore registers -- 2.7.4