From bfa8e501a3c37b4b0cb8a9cda9390ba12e6c86fe Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 25 Nov 2016 20:28:41 +0100 Subject: [PATCH] Make pc86 echo console output to the serial port, so qemu can pipe it to stdout. --- plat/pc86/README | 3 +++ plat/pc86/libsys/_sys_rawwrite.s | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/plat/pc86/README b/plat/pc86/README index 689c70844..dcbe0ba27 100644 --- a/plat/pc86/README +++ b/plat/pc86/README @@ -23,6 +23,9 @@ are stubs required to make the demo apps link. File descriptors 0, 1 and 2 represent the console. All reads block. There's enough TTY emulation to allow \n conversion and local echo (but it can't be turned off). +Console output is echoed to the serial port (without any setup). This is used +by qemu for running tests. + Example command line ==================== diff --git a/plat/pc86/libsys/_sys_rawwrite.s b/plat/pc86/libsys/_sys_rawwrite.s index 75f75aae1..ae477c6d2 100644 --- a/plat/pc86/libsys/_sys_rawwrite.s +++ b/plat/pc86/libsys/_sys_rawwrite.s @@ -21,9 +21,18 @@ __sys_rawwrite: push bp mov bp, sp + ! Write to the BIOS console. + movb al, 4(bp) movb ah, 0x0E mov bx, 0x0007 int 0x10 + + ! Also write to the serial port (used by the test suite). + + movb ah, 0x01 + xor dx, dx + int 0x14 + jmp .cret \ No newline at end of file -- 2.34.1