From 114236da17868d0ebd866da16556ae82a0da2ad6 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Sat, 10 Feb 2024 17:36:33 -0500 Subject: [PATCH] allow selection of COM port for debug prints easily overridden during compile, e.g. build.bat /D DEBUG_PRINT_COMPORT /V 2 --- kernel/console.asm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/console.asm b/kernel/console.asm index 4287fc3..ce469ec 100644 --- a/kernel/console.asm +++ b/kernel/console.asm @@ -265,9 +265,14 @@ _int29_handler: pop ax iret %IFDEF DEBUG_PRINT_COMPORT +%ifnum DEBUG_PRINT_COMPORT +%define DEBUG_USE_COMPORT DEBUG_PRINT_COMPORT +%else +%define DEBUG_USE_COMPORT 1 ; default to COM2 if not specified +%endif .comprint: push dx - mov dx, 1 ; 0=COM1,1=COM2,2=COM3,3=COM4 + mov dx, DEBUG_USE_COMPORT ; 0=COM1,1=COM2,2=COM3,3=COM4 mov ah, [cs:ASYNC_NEED_INIT] or ah,ah