summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-01-25 14:11:11 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2011-01-25 14:11:11 -0800
commitac1a3f7dc145eafd199f2d14d26b34c77af7d586 (patch)
treec5709bb3ae8eb0e55ee5709fffe0ef454cc9b668
parent808d43ea43c9df30a0a6922ef4cb4678634d41ab (diff)
downloadsyslinux-ac1a3f7dc145eafd199f2d14d26b34c77af7d586.tar.gz
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@linux.intel.com>
-rw-r--r--core/diskboot.inc27
-rw-r--r--core/diskstart.inc18
2 files changed, 26 insertions, 19 deletions
diff --git a/core/diskboot.inc b/core/diskboot.inc
index 8f04f376..4a730b0b 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 9280f7da..4e2d1fcf 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