LoadFlags resb 1 ; Loadflags from kernel
A20Tries resb 1 ; Times until giving up on A20
FuncFlag resb 1 ; == 1 if <Ctrl-F> pressed
+DisplayMask resb 1 ; Display modes mask
ISOFlags resb 1 ; Flags for ISO directory search
DiskError resb 1 ; Error code for disk I/O
DriveNo resb 1 ; CD-ROM BIOS drive number
mov ax,xfer_buf_seg ; Use for temporary storage
mov es,ax
+ mov byte [TextAttribute],07h ; Default grey on white
+ mov byte [DisplayMask],07h ; Display text in all modes
call msg_initvars
get_msg_chunk: push edx ; EDX = length of file
cmp al,1Ah ; DOS EOF?
je msg_done_pop
push si
+ mov cl,[UsingVGA]
+ inc cl ; 01h = text mode, 02h = graphics
call [NextCharJump] ; Do what shall be done
pop si
pop edx
je msg_formfeed
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
-
-msg_normal: call write_serial ; Write to serial port
+ jnb .not_modectl
+ cmp al,10h ; 10h to 17h are mode controls
+ jae near msg_modectl
+.not_modectl:
+
+msg_normal: call write_serial_displaymask ; Write to serial port
+ test [DisplayMask],cl
+ jz msg_ignore ; Not screen
mov bx,[TextAttrBX]
mov ah,09h ; Write character/attribute
mov cx,1 ; One character only
ret
msg_newline: ; Newline char or end of line
mov si,crlf_msg
- call write_serial_str
+ call write_serial_str_displaymask
msg_line_wrap: ; Screen wraparound
+ test [DisplayMask],cl
+ jz msg_ignore
mov byte [CursorCol],0
mov al,[CursorRow]
inc ax
jmp short msg_gotoxy
msg_formfeed: ; Form feed character
mov si,crff_msg
- call write_serial_str
+ call write_serial_str_displaymask
+ test [DisplayMask],cl
+ jz msg_ignore
xor cx,cx
mov [CursorDX],cx ; Upper lefthand corner
mov dx,[ScreenSize]
call unhexchar
jc msg_color_bad
shl al,4
+ test [DisplayMask],cl
+ jz .dontset
mov [TextAttribute],al
+.dontset:
mov word [NextCharJump],msg_setfg
ret
msg_setfg: ; Color foreground character
call unhexchar
jc msg_color_bad
+ test [DisplayMask],cl
+ jz .dontset
or [TextAttribute],al ; setbg set foreground to 0
+.dontset:
jmp short msg_putcharnext
msg_vga:
mov word [NextCharJump],msg_filename
; Subroutine to initialize variables, also needed
; after loading a graphics file
msg_initvars:
- mov byte [TextAttribute],07h ; Default grey on white
pusha
mov bh,[TextPage]
mov ah,03h ; Read cursor position
popa
jmp short msg_putcharnext ; Initialize state machine
+msg_modectl:
+ and al,07h
+ mov [DisplayMask],al
+ jmp short msg_putcharnext
+
;
; write_serial: If serial output is enabled, write character on serial port
+; write_serial_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial.end
write_serial:
pushfd
pushad
call slow_out ; Send data
.noserial: popad
popfd
- ret
+.end: ret
;
; write_serial_str: write_serial for strings
+; write_serial_str_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_str_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial_str.end
+
write_serial_str:
.loop lodsb
and al,al
LoadFlags resb 1 ; Loadflags from kernel
A20Tries resb 1 ; Times until giving up on A20
FuncFlag resb 1 ; Escape sequences received from keyboard
+DisplayMask resb 1 ; Display modes mask
MNameBuf resb 11 ; Generic mangled file name buffer
InitRD resb 11 ; initrd= mangled name
KernelCName resb 13 ; Unmangled kernel name
mov ax,xfer_buf_seg ; Use for temporary storage
mov es,ax
+ mov byte [TextAttribute],07h ; Default grey on white
+ mov byte [DisplayMask],07h ; Display text in all modes
call msg_initvars
get_msg_chunk: push edx ; EDX = length of file
cmp al,1Ah ; DOS EOF?
je msg_done_pop
push si
+ mov cl,[UsingVGA]
+ inc cl ; 01h = text mode, 02h = graphics
call [NextCharJump] ; Do what shall be done
pop si
pop edx
je msg_formfeed
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
-
-msg_normal: call write_serial ; Write to serial port
+ jnb .not_modectl
+ cmp al,10h ; 10h to 17h are mode controls
+ jae near msg_modectl
+.not_modectl:
+
+msg_normal: call write_serial_displaymask ; Write to serial port
+ test [DisplayMask],cl
+ jz msg_ignore ; Not screen
mov bx,[TextAttrBX]
mov ah,09h ; Write character/attribute
mov cx,1 ; One character only
ret
msg_newline: ; Newline char or end of line
mov si,crlf_msg
- call write_serial_str
+ call write_serial_str_displaymask
msg_line_wrap: ; Screen wraparound
+ test [DisplayMask],cl
+ jz msg_ignore
mov byte [CursorCol],0
mov al,[CursorRow]
inc ax
jmp short msg_gotoxy
msg_formfeed: ; Form feed character
mov si,crff_msg
- call write_serial_str
+ call write_serial_str_displaymask
+ test [DisplayMask],cl
+ jz msg_ignore
xor cx,cx
mov [CursorDX],cx ; Upper lefthand corner
mov dx,[ScreenSize]
call unhexchar
jc msg_color_bad
shl al,4
+ test [DisplayMask],cl
+ jz .dontset
mov [TextAttribute],al
+.dontset:
mov word [NextCharJump],msg_setfg
ret
msg_setfg: ; Color foreground character
call unhexchar
jc msg_color_bad
+ test [DisplayMask],cl
+ jz .dontset
or [TextAttribute],al ; setbg set foreground to 0
+.dontset:
jmp short msg_putcharnext
msg_vga:
mov word [NextCharJump],msg_filename
; Subroutine to initialize variables, also needed
; after loading a graphics file
msg_initvars:
- mov byte [TextAttribute],07h ; Default grey on white
pusha
mov bh,[TextPage]
mov ah,03h ; Read cursor position
popa
jmp short msg_putcharnext ; Initialize state machine
+msg_modectl:
+ and al,07h
+ mov [DisplayMask],al
+ jmp short msg_putcharnext
+
;
; write_serial: If serial output is enabled, write character on serial port
+; write_serial_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial.end
write_serial:
pushfd
pushad
call slow_out ; Send data
.noserial: popad
popfd
- ret
+.end: ret
;
; write_serial_str: write_serial for strings
+; write_serial_str_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_str_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial_str.end
+
write_serial_str:
.loop lodsb
and al,al
LoadFlags resb 1 ; Loadflags from kernel
A20Tries resb 1 ; Times until giving up on A20
FuncFlag resb 1 ; == 1 if <Ctrl-F> pressed
+DisplayMask resb 1 ; Display modes mask
OverLoad resb 1 ; Set if DHCP packet uses "overloading"
TextColorReg resb 17 ; VGA color registers for text mode
VGAFileBuf resb FILENAME_MAX ; Unmangled VGA image name
mov ax,xfer_buf_seg ; Use for temporary storage
mov es,ax
+ mov byte [TextAttribute],07h ; Default grey on white
+ mov byte [DisplayMask],07h ; Display text in all modes
call msg_initvars
get_msg_chunk: push edx ; EDX = length of file
cmp al,1Ah ; DOS EOF?
je msg_done_pop
push si
+ mov cl,[UsingVGA]
+ inc cl ; 01h = text mode, 02h = graphics
call [NextCharJump] ; Do what shall be done
pop si
pop edx
je msg_formfeed
cmp al,18h ; <CAN> = VGA filename follows
je near msg_vga
-
-msg_normal: call write_serial ; Write to serial port
+ jnb .not_modectl
+ cmp al,10h ; 10h to 17h are mode controls
+ jae near msg_modectl
+.not_modectl:
+
+msg_normal: call write_serial_displaymask ; Write to serial port
+ test [DisplayMask],cl
+ jz msg_ignore ; Not screen
mov bx,[TextAttrBX]
mov ah,09h ; Write character/attribute
mov cx,1 ; One character only
ret
msg_newline: ; Newline char or end of line
mov si,crlf_msg
- call write_serial_str
+ call write_serial_str_displaymask
msg_line_wrap: ; Screen wraparound
+ test [DisplayMask],cl
+ jz msg_ignore
mov byte [CursorCol],0
mov al,[CursorRow]
inc ax
jmp short msg_gotoxy
msg_formfeed: ; Form feed character
mov si,crff_msg
- call write_serial_str
+ call write_serial_str_displaymask
+ test [DisplayMask],cl
+ jz msg_ignore
xor cx,cx
mov [CursorDX],cx ; Upper lefthand corner
mov dx,[ScreenSize]
call unhexchar
jc msg_color_bad
shl al,4
+ test [DisplayMask],cl
+ jz .dontset
mov [TextAttribute],al
+.dontset:
mov word [NextCharJump],msg_setfg
ret
msg_setfg: ; Color foreground character
call unhexchar
jc msg_color_bad
+ test [DisplayMask],cl
+ jz .dontset
or [TextAttribute],al ; setbg set foreground to 0
+.dontset:
jmp short msg_putcharnext
msg_vga:
mov word [NextCharJump],msg_filename
; Subroutine to initialize variables, also needed
; after loading a graphics file
msg_initvars:
- mov byte [TextAttribute],07h ; Default grey on white
pusha
mov bh,[TextPage]
mov ah,03h ; Read cursor position
popa
jmp short msg_putcharnext ; Initialize state machine
+msg_modectl:
+ and al,07h
+ mov [DisplayMask],al
+ jmp short msg_putcharnext
+
;
; write_serial: If serial output is enabled, write character on serial port
+; write_serial_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial.end
write_serial:
pushfd
pushad
call slow_out ; Send data
.noserial: popad
popfd
- ret
+.end: ret
;
; write_serial_str: write_serial for strings
+; write_serial_str_displaymask: d:o, but ignore if DisplayMask & 04h == 0
;
+write_serial_str_displaymask:
+ test byte [DisplayMask], 04h
+ jz write_serial_str.end
+
write_serial_str:
.loop lodsb
and al,al
care: 0 is the background color, and 7 is the color used for
the text printed by SYSLINUX itself.
+<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
+ characters select a specific set of modes (text screen,
+ graphics screen, serial port) for which the output is actually
+ displayed:
+
+ Character Text Graph Serial
+ ------------------------------------------------------
+ <DLE> = <Ctrl-P> = ASCII 16 No No No
+ <DC1> = <Ctrl-Q> = ASCII 17 Yes No No
+ <DC2> = <Ctrl-R> = ASCII 18 No Yes No
+ <DC3> = <Ctrl-S> = ASCII 19 Yes Yes No
+ <DC4> = <Ctrl-T> = ASCII 20 No No Yes
+ <NAK> = <Ctrl-U> = ASCII 21 Yes No Yes
+ <SYN> = <Ctrl-V> = ASCII 22 No Yes Yes
+ <ETB> = <Ctrl-W> = ASCII 23 Yes Yes Yes
+
+ For example:
+
+ <DC1>Text mode<DC2>Graphics mode<DC4>Serial port<ETB>
+
+ ... will actually print out which mode the console is in!
+
<SUB> <SUB> = <Ctrl-Z> = ASCII 26
End of file (DOS convention).