Fix restoring text mode with a font set (uninitialized use of ES)
authorhpa <hpa>
Tue, 20 Nov 2001 03:56:40 +0000 (03:56 +0000)
committerhpa <hpa>
Tue, 20 Nov 2001 03:56:40 +0000 (03:56 +0000)
NEWS
isolinux.asm
ldlinux.asm
pxelinux.asm

diff --git a/NEWS b/NEWS
index a38a157..7fcded0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Changes in 1.64:
        * Support specifying the serial port I/O address explicitly.
        * Make DOS installer hopefully behave more nicely when used on
          recent Windows versions.
+       * Fix returning to text mode when a font has been specified.
 
 Changes in 1.63:
        * Make the ppmtolss16 program handle color conversion more
index 3dc5e7e..ab2d18d 100644 (file)
@@ -3039,6 +3039,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?
@@ -4134,7 +4135,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
@@ -4163,13 +4164,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
@@ -4183,6 +4187,7 @@ vgaclearmode:
                mov byte [ScrollAttribute], 07h
 .done:
                popad
+               pop es
                pop ds
                ret
 
index eae1102..9fe7c9d 100644 (file)
@@ -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
 
index f2ae34a..7ad4ffc 100644 (file)
@@ -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