aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2001-04-19 00:50:29 +0000
committerhpa <hpa>2001-04-19 00:50:29 +0000
commite41d512f3e23b32c461115b03ecd376bc410a3ed (patch)
tree240731b3eff8abb181f61e6264bd9c0603be8ce8
parentfccffd5baf99fd53c4d8880eecb89b0617fb0658 (diff)
downloadsyslinux-e41d512f3e23b32c461115b03ecd376bc410a3ed.tar.gz
syslinux-e41d512f3e23b32c461115b03ecd376bc410a3ed.tar.xz
syslinux-e41d512f3e23b32c461115b03ecd376bc410a3ed.zip
Introduce a way to return to text mode. Clean up the handling of
mode transitions.
-rw-r--r--NEWS4
-rw-r--r--isolinux.asm117
-rw-r--r--ldlinux.asm117
-rw-r--r--pxelinux.asm117
-rw-r--r--syslinux.doc3
5 files changed, 202 insertions, 156 deletions
diff --git a/NEWS b/NEWS
index 4e989674..45c838dc 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ Changes in 1.62:
* PXELINUX: Documentation fixes.
* PXELINUX: Fix the "ipappend" option; the last two values
were reversed vs. what the kernel expected.
+ * Introduce a way to return to text mode once we are already
+ in graphics mode. This may be useful for F-key help
+ screens.
+ * Fix several bugs in the way return to text mode was handled.
Changes in 1.61:
* ISOLINUX: Support full pathname searches. Max length for a
diff --git a/isolinux.asm b/isolinux.asm
index d3b510af..56d740ba 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -2994,25 +2994,7 @@ strcpy: push ax
and al,al
jnz .loop
pop ax
- ret
-
-;
-; adjust_screen: Set the internal variables associated with the screen size.
-; This is a subroutine in case we're loading a custom font.
-;
-adjust_screen:
- mov al,[BIOS_vidrows]
- and al,al
- jnz vidrows_is_ok
- mov al,24 ; No vidrows in BIOS, assume 25
- ; (Remember: vidrows == rows-1)
-vidrows_is_ok: mov [VidRows],al
- mov ah,0fh
- int 10h ; Read video state
- mov [TextPage],bh
- dec ah ; Store count-1 (same as rows)
- mov [VidCols],ah
-bf_ret: ret
+lf_ret: ret
;
; loadfont: Load a .psf font file and install it onto the VGA console
@@ -3026,43 +3008,42 @@ loadfont:
mov ax,[trackbuf] ; Magic number
cmp ax,0436h
- jne bf_ret
+ jne lf_ret
mov al,[trackbuf+2] ; File mode
cmp al,5 ; Font modes 0-5 supported
- ja bf_ret
+ ja lf_ret
mov bh,byte [trackbuf+3] ; Height of font
cmp bh,2 ; VGA minimum
- jb bf_ret
+ jb lf_ret
cmp bh,32 ; VGA maximum
- ja bf_ret
+ ja lf_ret
; Copy to font buffer
mov si,trackbuf+4 ; Start of font data
mov [VGAFontSize],bh
mov di,vgafontbuf
- mov bp,di ; Address of font data for INT 10h
mov cx,(32*256) >> 2 ; Maximum size
rep movsd
- xor bl,bl ; Needed by both INT 10h calls
- cmp [UsingVGA], byte 1 ; Are we in graphics mode?
- je .graphics
-
- mov cx,256
- xor dx,dx
- mov ax,1110h
- int 10h ; Load into VGA RAM
+ ; Fall through to use_font
- xor bl,bl
- mov ax,1103h ; Select page 0
- int 10h
+;
+; use_font:
+; This routine activates whatever font happens to be in the
+; vgafontbuf, and updates the adjust_screen data.
+;
+use_font:
+ mov bp,vgafontbuf
+ mov bh,[VGAFontSize]
- jmp short adjust_screen
+ xor bl,bl ; Needed by both INT 10h calls
+ cmp [UsingVGA], byte 1 ; Are we in graphics mode?
+ jne .text
.graphics:
- ; CX = 0 on entry
+ xor cx,bx
mov cl,bh ; CX = bytes/character
mov ax,480
div cl ; Compute char rows per screen
@@ -3071,9 +3052,40 @@ loadfont:
mov [VidRows],al
mov ax,1121h ; Set user character table
int 10h
- ; VidCols = 80, TextPage = 0 set by graphics mode select
+ mov [VidRows], byte 79 ; Always 80 bytes/line
+ mov [TextPage], byte 0 ; Always page 0
ret ; No need to call adjust_screen
+.text:
+ mov cx,256
+ xor dx,dx
+ mov ax,1110h
+ int 10h ; Load into VGA RAM
+
+ xor bl,bl
+ mov ax,1103h ; Select page 0
+ int 10h
+
+ ; Fall through to adjust_screen
+
+;
+; adjust_screen: Set the internal variables associated with the screen size.
+; This is a subroutine in case we're loading a custom font.
+;
+adjust_screen:
+ mov al,[BIOS_vidrows]
+ and al,al
+ jnz vidrows_is_ok
+ mov al,24 ; No vidrows in BIOS, assume 25
+ ; (Remember: vidrows == rows-1)
+vidrows_is_ok: mov [VidRows],al
+ mov ah,0fh
+ int 10h ; Read video state
+ mov [TextPage],bh
+ dec ah ; Store count-1 (same as rows)
+ mov [VidCols],ah
+ ret
+
;
; loadkeys: Load a LILO-style keymap; SI and DX:AX set by searchdir
;
@@ -3151,6 +3163,8 @@ msg_putchar: ; Normal character
je msg_newline
cmp al,0Ch ; <FF> = clear screen
je msg_formfeed
+ cmp al,19h ; <EM> = return to text mode
+ je near msg_novga
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
jnb .not_modectl
@@ -3254,6 +3268,10 @@ msg_setvgafileptr:
mov [VGAFilePtr],di
msg_ret: ret
+msg_novga:
+ call vgaclearmode
+ jmp short msg_initvars
+
msg_viewimage:
push es
push ds
@@ -4115,19 +4133,7 @@ vgasetmode:
int 10h
mov [UsingVGA], byte 1
- mov [VidCols], byte 79 ; Always 80 chars/screen
- mov [TextPage], byte 0 ; Always page 0
-
- mov cx,[VGAFontSize]
- mov ax,480
- div cl
- mov dl,al
- dec al ; VidRows is stored -1
- mov [VidRows],al
- mov bp,vgafontbuf
- xor bx,bx
- mov ax,1121h ; Set graphics font
- int 10h
+ call use_font ; Set graphics font/data
mov byte [ScrollAttribute], 00h
xor ax,ax ; Set ZF
@@ -4139,17 +4145,24 @@ vgasetmode:
; Disable VGA graphics. It is not safe to assume any value for DS.
;
vgaclearmode:
+ push ds
+ push cs
+ pop ds ; DS <- CS
pushad
- cmp [cs:UsingVGA], byte 1
+ cmp [UsingVGA], byte 1
jne .done
mov ax,0003h ; Return to normal video mode
int 10h
; mov dx,TextColorReg ; Restore color registers
; mov ax,1002h
; int 10h
+
+
+ call use_font ; Restore text font/data
mov byte [ScrollAttribute], 07h
.done:
popad
+ pop ds
ret
;
diff --git a/ldlinux.asm b/ldlinux.asm
index d8c717c9..78329f8b 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -2940,25 +2940,7 @@ dir_success:
mov bx,ax
or bx,dx ; Sets ZF iff DX:AX is zero
dir_return:
- ret
-
-;
-; adjust_screen: Set the internal variables associated with the screen size.
-; This is a subroutine in case we're loading a custom font.
-;
-adjust_screen:
- mov al,[BIOS_vidrows]
- and al,al
- jnz vidrows_is_ok
- mov al,24 ; No vidrows in BIOS, assume 25
- ; (Remember: vidrows == rows-1)
-vidrows_is_ok: mov [VidRows],al
- mov ah,0fh
- int 10h ; Read video state
- mov [TextPage],bh
- dec ah ; Store count-1 (same as rows)
- mov [VidCols],ah
-bf_ret: ret
+lf_ret: ret
;
; loadfont: Load a .psf font file and install it onto the VGA console
@@ -2972,43 +2954,42 @@ loadfont:
mov ax,[trackbuf] ; Magic number
cmp ax,0436h
- jne bf_ret
+ jne lf_ret
mov al,[trackbuf+2] ; File mode
cmp al,5 ; Font modes 0-5 supported
- ja bf_ret
+ ja lf_ret
mov bh,byte [trackbuf+3] ; Height of font
cmp bh,2 ; VGA minimum
- jb bf_ret
+ jb lf_ret
cmp bh,32 ; VGA maximum
- ja bf_ret
+ ja lf_ret
; Copy to font buffer
mov si,trackbuf+4 ; Start of font data
mov [VGAFontSize],bh
mov di,vgafontbuf
- mov bp,di ; Address of font data for INT 10h
mov cx,(32*256) >> 2 ; Maximum size
rep movsd
- xor bl,bl ; Needed by both INT 10h calls
- cmp [UsingVGA], byte 1 ; Are we in graphics mode?
- je .graphics
-
- mov cx,256
- xor dx,dx
- mov ax,1110h
- int 10h ; Load into VGA RAM
+ ; Fall through to use_font
- xor bl,bl
- mov ax,1103h ; Select page 0
- int 10h
+;
+; use_font:
+; This routine activates whatever font happens to be in the
+; vgafontbuf, and updates the adjust_screen data.
+;
+use_font:
+ mov bp,vgafontbuf
+ mov bh,[VGAFontSize]
- jmp short adjust_screen
+ xor bl,bl ; Needed by both INT 10h calls
+ cmp [UsingVGA], byte 1 ; Are we in graphics mode?
+ jne .text
.graphics:
- ; CX = 0 on entry
+ xor cx,bx
mov cl,bh ; CX = bytes/character
mov ax,480
div cl ; Compute char rows per screen
@@ -3017,9 +2998,40 @@ loadfont:
mov [VidRows],al
mov ax,1121h ; Set user character table
int 10h
- ; VidCols = 80, TextPage = 0 set by graphics mode select
+ mov [VidRows], byte 79 ; Always 80 bytes/line
+ mov [TextPage], byte 0 ; Always page 0
ret ; No need to call adjust_screen
+.text:
+ mov cx,256
+ xor dx,dx
+ mov ax,1110h
+ int 10h ; Load into VGA RAM
+
+ xor bl,bl
+ mov ax,1103h ; Select page 0
+ int 10h
+
+ ; Fall through to adjust_screen
+
+;
+; adjust_screen: Set the internal variables associated with the screen size.
+; This is a subroutine in case we're loading a custom font.
+;
+adjust_screen:
+ mov al,[BIOS_vidrows]
+ and al,al
+ jnz vidrows_is_ok
+ mov al,24 ; No vidrows in BIOS, assume 25
+ ; (Remember: vidrows == rows-1)
+vidrows_is_ok: mov [VidRows],al
+ mov ah,0fh
+ int 10h ; Read video state
+ mov [TextPage],bh
+ dec ah ; Store count-1 (same as rows)
+ mov [VidCols],ah
+ ret
+
;
; loadkeys: Load a LILO-style keymap; SI and DX:AX set by searchdir
;
@@ -3097,6 +3109,8 @@ msg_putchar: ; Normal character
je msg_newline
cmp al,0Ch ; <FF> = clear screen
je msg_formfeed
+ cmp al,19h ; <EM> = return to text mode
+ je near msg_novga
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
jnb .not_modectl
@@ -3200,6 +3214,10 @@ msg_setvgafileptr:
mov [VGAFilePtr],di
msg_ret: ret
+msg_novga:
+ call vgaclearmode
+ jmp short msg_initvars
+
msg_viewimage:
push es
push ds
@@ -4085,19 +4103,7 @@ vgasetmode:
int 10h
mov [UsingVGA], byte 1
- mov [VidCols], byte 79 ; Always 80 chars/screen
- mov [TextPage], byte 0 ; Always page 0
-
- mov cx,[VGAFontSize]
- mov ax,480
- div cl
- mov dl,al
- dec al ; VidRows is stored -1
- mov [VidRows],al
- mov bp,vgafontbuf
- xor bx,bx
- mov ax,1121h ; Set graphics font
- int 10h
+ call use_font ; Set graphics font/data
mov byte [ScrollAttribute], 00h
xor ax,ax ; Set ZF
@@ -4109,17 +4115,24 @@ vgasetmode:
; Disable VGA graphics. It is not safe to assume any value for DS.
;
vgaclearmode:
+ push ds
+ push cs
+ pop ds ; DS <- CS
pushad
- cmp [cs:UsingVGA], byte 1
+ cmp [UsingVGA], byte 1
jne .done
mov ax,0003h ; Return to normal video mode
int 10h
; mov dx,TextColorReg ; Restore color registers
; mov ax,1002h
; int 10h
+
+
+ call use_font ; Restore text font/data
mov byte [ScrollAttribute], 07h
.done:
popad
+ pop ds
ret
;
diff --git a/pxelinux.asm b/pxelinux.asm
index 99e0793f..48696e37 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -3005,25 +3005,7 @@ strcpy: push ax
and al,al
jnz .loop
pop ax
- ret
-
-;
-; adjust_screen: Set the internal variables associated with the screen size.
-; This is a subroutine in case we're loading a custom font.
-;
-adjust_screen:
- mov al,[BIOS_vidrows]
- and al,al
- jnz vidrows_is_ok
- mov al,24 ; No vidrows in BIOS, assume 25
- ; (Remember: vidrows == rows-1)
-vidrows_is_ok: mov [VidRows],al
- mov ah,0fh
- int 10h ; Read video state
- mov [TextPage],bh
- dec ah ; Store count-1 (same as rows)
- mov [VidCols],ah
-bf_ret: ret
+lf_ret: ret
;
; loadfont: Load a .psf font file and install it onto the VGA console
@@ -3037,43 +3019,42 @@ loadfont:
mov ax,[trackbuf] ; Magic number
cmp ax,0436h
- jne bf_ret
+ jne lf_ret
mov al,[trackbuf+2] ; File mode
cmp al,5 ; Font modes 0-5 supported
- ja bf_ret
+ ja lf_ret
mov bh,byte [trackbuf+3] ; Height of font
cmp bh,2 ; VGA minimum
- jb bf_ret
+ jb lf_ret
cmp bh,32 ; VGA maximum
- ja bf_ret
+ ja lf_ret
; Copy to font buffer
mov si,trackbuf+4 ; Start of font data
mov [VGAFontSize],bh
mov di,vgafontbuf
- mov bp,di ; Address of font data for INT 10h
mov cx,(32*256) >> 2 ; Maximum size
rep movsd
- xor bl,bl ; Needed by both INT 10h calls
- cmp [UsingVGA], byte 1 ; Are we in graphics mode?
- je .graphics
-
- mov cx,256
- xor dx,dx
- mov ax,1110h
- int 10h ; Load into VGA RAM
+ ; Fall through to use_font
- xor bl,bl
- mov ax,1103h ; Select page 0
- int 10h
+;
+; use_font:
+; This routine activates whatever font happens to be in the
+; vgafontbuf, and updates the adjust_screen data.
+;
+use_font:
+ mov bp,vgafontbuf
+ mov bh,[VGAFontSize]
- jmp short adjust_screen
+ xor bl,bl ; Needed by both INT 10h calls
+ cmp [UsingVGA], byte 1 ; Are we in graphics mode?
+ jne .text
.graphics:
- ; CX = 0 on entry
+ xor cx,bx
mov cl,bh ; CX = bytes/character
mov ax,480
div cl ; Compute char rows per screen
@@ -3082,9 +3063,40 @@ loadfont:
mov [VidRows],al
mov ax,1121h ; Set user character table
int 10h
- ; VidCols = 80, TextPage = 0 set by graphics mode select
+ mov [VidRows], byte 79 ; Always 80 bytes/line
+ mov [TextPage], byte 0 ; Always page 0
ret ; No need to call adjust_screen
+.text:
+ mov cx,256
+ xor dx,dx
+ mov ax,1110h
+ int 10h ; Load into VGA RAM
+
+ xor bl,bl
+ mov ax,1103h ; Select page 0
+ int 10h
+
+ ; Fall through to adjust_screen
+
+;
+; adjust_screen: Set the internal variables associated with the screen size.
+; This is a subroutine in case we're loading a custom font.
+;
+adjust_screen:
+ mov al,[BIOS_vidrows]
+ and al,al
+ jnz .vidrows_ok
+ mov al,24 ; No vidrows in BIOS, assume 25
+ ; (Remember: vidrows == rows-1)
+.vidrows_ok: mov [VidRows],al
+ mov ah,0fh
+ int 10h ; Read video state
+ mov [TextPage],bh
+ dec ah ; Store count-1 (same as rows)
+ mov [VidCols],ah
+ ret
+
;
; loadkeys: Load a LILO-style keymap; SI and DX:AX set by searchdir
;
@@ -3162,6 +3174,8 @@ msg_putchar: ; Normal character
je msg_newline
cmp al,0Ch ; <FF> = clear screen
je msg_formfeed
+ cmp al,19h ; <EM> = return to text mode
+ je near msg_novga
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
jnb .not_modectl
@@ -3265,6 +3279,10 @@ msg_setvgafileptr:
mov [VGAFilePtr],di
msg_ret: ret
+msg_novga:
+ call vgaclearmode
+ jmp short msg_initvars
+
msg_viewimage:
push es
push ds
@@ -4578,19 +4596,7 @@ vgasetmode:
int 10h
mov [UsingVGA], byte 1
- mov [VidCols], byte 79 ; Always 80 chars/screen
- mov [TextPage], byte 0 ; Always page 0
-
- mov cx,[VGAFontSize]
- mov ax,480
- div cl
- mov dl,al
- dec al ; VidRows is stored -1
- mov [VidRows],al
- mov bp,vgafontbuf
- xor bx,bx
- mov ax,1121h ; Set graphics font
- int 10h
+ call use_font ; Set graphics font/data
mov byte [ScrollAttribute], 00h
xor ax,ax ; Set ZF
@@ -4602,17 +4608,24 @@ vgasetmode:
; Disable VGA graphics. It is not safe to assume any value for DS.
;
vgaclearmode:
+ push ds
+ push cs
+ pop ds ; DS <- CS
pushad
- cmp [cs:UsingVGA], byte 1
+ cmp [UsingVGA], byte 1
jne .done
mov ax,0003h ; Return to normal video mode
int 10h
; mov dx,TextColorReg ; Restore color registers
; mov ax,1002h
; int 10h
+
+
+ call use_font ; Restore text font/data
mov byte [ScrollAttribute], 07h
.done:
popad
+ pop ds
ret
;
diff --git a/syslinux.doc b/syslinux.doc
index 2c274dca..bdf36d6d 100644
--- a/syslinux.doc
+++ b/syslinux.doc
@@ -352,6 +352,9 @@ are interpreted:
care: 0 is the background color, and 7 is the color used for
the text printed by SYSLINUX itself.
+<EM> <EM> = <Ctrl-Y> = ASCII 25
+ If we are currently in graphics mode, return to text mode.
+
<DLE>..<ETB> <Ctrl-P>..<Ctrl-W> = ASCII 16-23
These codes can be used to select which modes to print a
certain part of the message file in. Each of these control