them.
Changes in 2.09:
- * SYSLINUX: Remove residual setuid crap from syslinux-nomtools.
+ * SYSLINUX: Remove residual setuid crap from
+ syslinux-nomtools.
+ * Handle video pages correctly when using the API functions.
+ * Handle compiling on an x86-64 platform correctly.
Changes in 2.08:
* Add new configuration command "ontimeout" to allow timeout
;; $Id$
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2004 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
serial_base resw 4 ; Base addresses for 4 serial ports
absolute 0413h
BIOS_fbm resw 1 ; Free Base Memory (kilobytes)
+ absolute 0462h
+BIOS_page resb 1 ; Current video page
absolute 046Ch
BIOS_timer resw 1 ; Timer ticks
absolute 0472h
;; $Id$
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2004 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
msg_normal: call write_serial_displaymask ; Write to serial port
test [DisplayMask],cl
jz msg_ignore ; Not screen
- mov bx,[TextAttrBX]
+ mov bl,[TextAttribute]
+ mov bh,[BIOS_page]
mov ah,09h ; Write character/attribute
mov cx,1 ; One character only
int 10h ; Write to screen
ja msg_line_wrap ; Screen wraparound
mov [CursorCol],al
-msg_gotoxy: mov bh,[TextPage]
+msg_gotoxy: mov bh,[BIOS_page]
mov dx,[CursorDX]
mov ah,02h ; Set cursor position
int 10h
; after loading a graphics file
msg_initvars:
pusha
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
mov ah,03h ; Read cursor position
int 10h
mov [CursorDX],dx
;; $Id$
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2004 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
mov ax,1121h ; Set user character table
int 10h
mov [VidCols], byte 79 ; Always 80 bytes/line
- mov [TextPage], byte 0 ; Always page 0
.lf_ret: ret ; No need to call adjust_screen
.text:
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
; available. It is based on the SYSLINUX boot loader for MS-DOS
; floppies.
;
-; Copyright (C) 1994-2002 H. Peter Anvin
+; Copyright (C) 1994-2004 H. Peter Anvin
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
LocalBootType resw 1 ; Local boot return code
ImageSectors resw 1 ; isolinux.bin size, sectors
DiskSys resw 1 ; Last INT 13h call
-TextAttrBX equ $
-TextAttribute resb 1 ; Text attribute for message file
-TextPage resb 1 ; Active display page
CursorDX equ $
CursorCol resb 1 ; Cursor column for message file
CursorRow resb 1 ; Cursor row for message file
FlowOutput resb 1 ; Outputs to assert for serial flow
FlowInput resb 1 ; Input bits for serial flow
FlowIgnore resb 1 ; Ignore input unless these bits set
+TextAttribute resb 1 ; Text attribute for message file
RetryCount resb 1 ; Used for disk access retries
KbdFlags resb 1 ; Check for keyboard escapes
LoadFlags resb 1 ; Loadflags from kernel
call write_serial ; write to serial port if needed
pushfd
pushad
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
push ax
mov ah,03h ; Read cursor position
int 10h
cmp al,10
je .lf
push dx
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
mov bl,07h ; White on black
mov cx,1 ; One only
mov ah,09h ; Write char and attribute
.lf: inc dh
cmp dh,[VidRows]
ja .scroll
-.curxyok: mov bh,[TextPage]
+.curxyok: mov bh,[BIOS_page]
mov ah,02h ; Set cursor position
int 10h
.ret: popad
pop ds
ret
.scroll: dec dh
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
mov ah,02h
int 10h
mov ax,0601h ; Scroll up one line
; then the first sector (cluster, really, but we can only assume 1 sector)
; of LDLINUX.SYS at 7E00h and finally the remainder of LDLINUX.SYS at 8000h.
;
-; Copyright (C) 1994-2002 H. Peter Anvin
+; Copyright (C) 1994-2004 H. Peter Anvin
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
VGACluster resw 1 ; Cluster pointer for VGA image file
VGAFilePtr resw 1 ; Pointer into VGAFileBuf
Com32SysSP resw 1 ; SP saved during COM32 syscall
-TextAttrBX equ $
-TextAttribute resb 1 ; Text attribute for message file
-TextPage resb 1 ; Active display page
CursorDX equ $
CursorCol resb 1 ; Cursor column for message file
CursorRow resb 1 ; Cursor row for message file
FlowOutput resb 1 ; Outputs to assert for serial flow
FlowInput resb 1 ; Input bits for serial flow
FlowIgnore resb 1 ; Ignore input unless these bits set
+TextAttribute resb 1 ; Text attribute for message file
RetryCount resb 1 ; Used for disk access retries
KbdFlags resb 1 ; Check for keyboard escapes
LoadFlags resb 1 ; Loadflags from kernel
;
;
; writestr: write a null-terminated string to the console
+; This assumes we're on page 0. This is only used for early
+; messages, so it should be OK.
;
writestr:
.loop: lodsb
and al,al
jz .return
mov ah,0Eh ; Write to screen as TTY
- mov bx,0007h ; White on black, current page
+ mov bx,0007h ; Attribute
int 10h
jmp short .loop
.return: ret
;
; writechr: Write a single character in AL to the console without
-; mangling any registers
+; mangling any registers; handle video pages correctly.
;
writechr:
call write_serial ; write to serial port if needed
pushfd
pushad
mov ah,0Eh
- mov bx,0007h ; white text on this page
+ mov bl,07h ; attribute
+ mov bh,[cs:BIOS_page] ; current page
int 10h
popad
popfd
; network booting API. It is based on the SYSLINUX boot loader for
; MS-DOS floppies.
;
-; Copyright (C) 1994-2003 H. Peter Anvin
+; Copyright (C) 1994-2004 H. Peter Anvin
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
RealBaseMem resw 1 ; Amount of DOS memory after freeing
APIVer resw 1 ; PXE API version found
IdleTimer resw 1 ; Time to check for ARP?
-TextAttrBX equ $
-TextAttribute resb 1 ; Text attribute for message file
-TextPage resb 1 ; Active display page
CursorDX equ $
CursorCol resb 1 ; Cursor column for message file
CursorRow resb 1 ; Cursor row for message file
FlowOutput resb 1 ; Outputs to assert for serial flow
FlowInput resb 1 ; Input bits for serial flow
FlowIgnore resb 1 ; Ignore input unless these bits set
+TextAttribute resb 1 ; Text attribute for message file
RetryCount resb 1 ; Used for disk access retries
KbdFlags resb 1 ; Check for keyboard escapes
LoadFlags resb 1 ; Loadflags from kernel
call write_serial ; write to serial port if needed
pushfd
pushad
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
push ax
mov ah,03h ; Read cursor position
int 10h
cmp al,10
je .lf
push dx
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
mov bl,07h ; White on black
mov cx,1 ; One only
mov ah,09h ; Write char and attribute
.lf: inc dh
cmp dh,[VidRows]
ja .scroll
-.curxyok: mov bh,[TextPage]
+.curxyok: mov bh,[BIOS_page]
mov ah,02h ; Set cursor position
int 10h
.ret: popad
pop ds
ret
.scroll: dec dh
- mov bh,[TextPage]
+ mov bh,[BIOS_page]
mov ah,02h
int 10h
mov ax,0601h ; Scroll up one line