aboutsummaryrefslogtreecommitdiffstats
path: root/rawcon.inc
diff options
context:
space:
mode:
authorhpa <hpa>2004-07-26 23:52:33 +0000
committerhpa <hpa>2004-07-26 23:52:33 +0000
commit21a0ded2844b4b2a48ac9eda8be86e6287da59d7 (patch)
tree06c71f76b7fa27553bf78a84d6494eab21e5387c /rawcon.inc
parent9d4d7707c11162a2f827bf72efed2c8824b8317b (diff)
downloadsyslinux.git-21a0ded2844b4b2a48ac9eda8be86e6287da59d7.tar.gz
syslinux.git-21a0ded2844b4b2a48ac9eda8be86e6287da59d7.tar.xz
syslinux.git-21a0ded2844b4b2a48ac9eda8be86e6287da59d7.zip
Move raw console access and strcpy() into their own include files
Diffstat (limited to 'rawcon.inc')
-rw-r--r--rawcon.inc68
1 files changed, 68 insertions, 0 deletions
diff --git a/rawcon.inc b/rawcon.inc
new file mode 100644
index 00000000..87e69fa8
--- /dev/null
+++ b/rawcon.inc
@@ -0,0 +1,68 @@
+;
+; writechr: Write a single character in AL to the console without
+; mangling any registers. This does raw console writes,
+; since some PXE BIOSes seem to interfere regular console I/O.
+;
+%if IS_ISOLINUX
+writechr_full:
+%else
+writechr:
+%endif
+ push ds
+ push cs
+ pop ds
+ call write_serial ; write to serial port if needed
+ pushfd
+ pushad
+ mov bh,[BIOS_page]
+ push ax
+ mov ah,03h ; Read cursor position
+ int 10h
+ pop ax
+ cmp al,8
+ je .bs
+ cmp al,13
+ je .cr
+ cmp al,10
+ je .lf
+ push dx
+ mov bh,[BIOS_page]
+ mov bl,07h ; White on black
+ mov cx,1 ; One only
+ mov ah,09h ; Write char and attribute
+ int 10h
+ pop dx
+ inc dl
+ cmp dl,[VidCols]
+ jna .curxyok
+ xor dl,dl
+.lf: inc dh
+ cmp dh,[VidRows]
+ ja .scroll
+.curxyok: mov bh,[BIOS_page]
+ mov ah,02h ; Set cursor position
+ int 10h
+.ret: popad
+ popfd
+ pop ds
+ ret
+.scroll: dec dh
+ mov bh,[BIOS_page]
+ mov ah,02h
+ int 10h
+ mov ax,0601h ; Scroll up one line
+ mov bh,[ScrollAttribute]
+ xor cx,cx
+ mov dx,[ScreenSize] ; The whole screen
+ int 10h
+ jmp short .ret
+.cr: xor dl,dl
+ jmp short .curxyok
+.bs: sub dl,1
+ jnc .curxyok
+ mov dl,[VidCols]
+ sub dh,1
+ jnc .curxyok
+ xor dh,dh
+ jmp short .curxyok
+