summaryrefslogtreecommitdiff
path: root/pxelinux.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 /pxelinux.asm
parent14b59ec64cf40c3bc2818a09536014e4e46be557 (diff)
downloadsyslinux-31dd79a3d527fe05f9452be4169e5d43d3b87b20.tar.gz
Fix restoring text mode with a font set (uninitialized use of ES)
Diffstat (limited to 'pxelinux.asm')
-rw-r--r--pxelinux.asm18
1 files changed, 11 insertions, 7 deletions
diff --git a/pxelinux.asm b/pxelinux.asm
index f2ae34a9..7ad4ffca 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -3045,6 +3045,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?
@@ -4591,7 +4592,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
@@ -4622,15 +4623,18 @@ 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
- pushad
mov ax,0003h ; Return to normal video mode
int 10h
; mov dx,TextColorReg ; Restore color registers
@@ -4640,9 +4644,9 @@ vgaclearmode:
call use_font ; Restore text font/data
mov byte [ScrollAttribute], 07h
- popad
.done:
-
+ popad
+ pop es
pop ds
ret