【发布时间】:2019-11-04 16:24:54
【问题描述】:
我正在为自定义操作系统编写终端驱动程序。我想让终端了解控制光标位置、形状、颜色等的常见 vt-100 转义序列。因此,在实现“下划线/下划线”功能时,我想写入下划线位置寄存器VGA/SVGA Video Programming - CRT Controller Registers,但它不管用。没有下划线出现(实际上我不知道在哪里看)。下面是DOS框的代码和截图。
; Read the Underline Location Register
mov dx, 0x3D4
mov al, 0x14
out dx, al ; 0x14 is the index of the Underline Location Register
mov dx, 0x3D5
in al, dx
; I want an underscore at 6th scan line, so I and 0b00101 with the value I got before
and ax, 0xE5 ; 0b1110 0101
push ax
; I write back the value to Underline regiser
mov dx, 0x3D4
mov al, 0x14
out dx, al
pop ax
mov dx, 0x3D5
out dx, al
【问题讨论】:
-
DOSBox 并不是测试操作系统的最佳环境,因为如果没有游戏实际使用它们,它通常不会费心去实现。
-
@RossRidge 我也在计算机硬件上运行了同样的程序。
标签: assembly x86 dosbox real-mode vga