[syslinux:master] diskstart: move writestr_early out of boot sector
syslinux-bot for H. Peter Anvin
hpa at linux.intel.com
Tue Jan 25 14:15:35 PST 2011
Commit-ID: ac1a3f7dc145eafd199f2d14d26b34c77af7d586
Gitweb: http://syslinux.zytor.com/commit/ac1a3f7dc145eafd199f2d14d26b34c77af7d586
Author: H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Tue, 25 Jan 2011 14:11:11 -0800
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Tue, 25 Jan 2011 14:11:11 -0800
diskstart: move writestr_early out of boot sector
We can save 8 bytes in the boot sector by moving writestr_early out
and putting the real routine in sector 1.
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
core/diskboot.inc | 27 ++++++++-------------------
core/diskstart.inc | 18 ++++++++++++++++++
2 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/core/diskboot.inc b/core/diskboot.inc
index 8f04f37..4a730b0 100644
--- a/core/diskboot.inc
+++ b/core/diskboot.inc
@@ -390,8 +390,15 @@ kaboom:
pop dword [fdctab] ; Restore FDC table
.patch: ; When we have full code, intercept here
mov si,bailmsg
- call writestr_early
+.loop: lodsb
+ and al,al
+ jz .done
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ jmp short .loop
+.done:
xor ax,ax
.again: int 16h ; Wait for keypress
; NB: replaced by int 18h if
@@ -401,24 +408,6 @@ kaboom:
jmp short .norge
;
-;
-; writestr_early: write a null-terminated string to the console
-; This assumes we're on page 0. This is only used for early
-; messages, so it should be OK.
-;
-writestr_early:
- pushad
-.loop: lodsb
- and al,al
- jz .return
- mov ah,0Eh ; Write to screen as TTY
- mov bx,0007h ; Attribute
- int 10h
- jmp short .loop
-.return: popad
- ret
-
-;
; INT 13h wrapper function
;
xint13:
diff --git a/core/diskstart.inc b/core/diskstart.inc
index 9280f7d..4e2d1fc 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -370,6 +370,24 @@ maxtrans:
.ok: ret
;
+;
+; writestr_early: write a null-terminated string to the console
+; This assumes we're on page 0. This is only used for early
+; messages, so it should be OK.
+;
+writestr_early:
+ pushad
+.loop: lodsb
+ and al,al
+ jz .return
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ jmp short .loop
+.return: popad
+ ret
+
+;
; Checksum error message
;
checksumerr_msg db ' Load error - ', 0 ; Boot failed appended
More information about the Syslinux-commits
mailing list