summaryrefslogtreecommitdiff
path: root/ldlinux.asm
diff options
context:
space:
mode:
authorhpa <hpa>2001-11-20 03:56:40 +0000
committerhpa <hpa>2001-11-20 03:56:40 +0000
commit31dd79a3d527fe05f9452be4169e5d43d3b87b20 (patch)
tree27907ccf68a356d92c361c4be48a59b55270405f /ldlinux.asm
parent14b59ec64cf40c3bc2818a09536014e4e46be557 (diff)
downloadsyslinux-31dd79a3d527fe05f9452be4169e5d43d3b87b20.tar.gz
Fix restoring text mode with a font set (uninitialized use of ES)
Diffstat (limited to 'ldlinux.asm')
-rw-r--r--ldlinux.asm13
1 files changed, 9 insertions, 4 deletions
diff --git a/ldlinux.asm b/ldlinux.asm
index eae1102d..9fe7c9d7 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -2978,6 +2978,7 @@ loadfont:
; use_font:
; This routine activates whatever font happens to be in the
; vgafontbuf, and updates the adjust_screen data.
+; Must be called with CS = DS = ES
;
use_font:
test [UserFont], byte 1 ; Are we using a user-specified font?
@@ -4097,7 +4098,7 @@ packedpixel2vga:
;
; vgasetmode:
; Enable VGA graphics, if possible; return ZF=1 on success
-; DS must be set to the base segment.
+; DS must be set to the base segment; ES is set to DS.
;
vgasetmode:
push ds
@@ -4126,13 +4127,16 @@ vgasetmode:
;
; vgaclearmode:
-; Disable VGA graphics. It is not safe to assume any value for DS.
+; Disable VGA graphics. It is not safe to assume any value
+; for DS or ES.
;
vgaclearmode:
push ds
- push cs
- pop ds ; DS <- CS
+ push es
pushad
+ mov ax,cs
+ mov ds,ax
+ mov es,ax
cmp [UsingVGA], byte 1
jne .done
mov ax,0003h ; Return to normal video mode
@@ -4146,6 +4150,7 @@ vgaclearmode:
mov byte [ScrollAttribute], 07h
.done:
popad
+ pop es
pop ds
ret