From 7b6c8fb7feade5c2f3a404a8072c08e37fc65efc Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 15 Jan 2022 16:39:58 +0000 Subject: [PATCH] Build: Fixup compile with GCC and -DDEBUG --- hdr/portab.h | 3 ++- kernel/prf.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hdr/portab.h b/hdr/portab.h index b1764c8..188bf09 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -145,7 +145,8 @@ unsigned short getSS(void); #ifdef __FAR #define I86 -#define __int__(intno) asm volatile("int " ## #intno) +#define STRINGIFY(x) #x +#define __int__(intno) asm volatile(STRINGIFY(int $##intno)) static inline void disable(void) { asm volatile("cli"); diff --git a/kernel/prf.c b/kernel/prf.c index edff14c..3bfddb9 100644 --- a/kernel/prf.c +++ b/kernel/prf.c @@ -73,6 +73,12 @@ void put_console(int c) _DX = FP_OFF(buff); _AX = 0x13; __int__(0xe6); +#elif defined(__GNUC__) + asm volatile( + "int $0xe6\n" + : /* outputs */ + : /* inputs */ "a"(0x13), "e"(FP_SEG(buff)), "d"(FP_OFF(buff)) + ); #elif defined(I86) asm { @@ -158,7 +164,8 @@ STATIC VOID handle_char(COUNT c) STATIC void ltob(LONG n, BYTE SSFAR * s, COUNT base) { ULONG u; - BYTE SSFAR *p, SSFAR *q; + BYTE SSFAR *p; + BYTE SSFAR *q; int c; u = n;