From 99e727b73d51c7c036780eb575a5e5e44c10e736 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 23 May 2004 22:04:42 +0000 Subject: [PATCH] Use int29 for kernel console output. Enables ansi escape sequences in config.sys once you load nansi.sys. It also saves a couple of bytes. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@953 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/console.asm | 3 +-- kernel/main.c | 6 ++++-- kernel/prf.c | 20 +++++--------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/kernel/console.asm b/kernel/console.asm index 32c3645..e4a9944 100644 --- a/kernel/console.asm +++ b/kernel/console.asm @@ -244,8 +244,7 @@ _int29_handler: push bp push bx mov ah,0Eh - mov bh,0 - mov bl,7 + mov bx,7 int 10h ; write char al, teletype mode pop bx pop bp diff --git a/kernel/main.c b/kernel/main.c index fa0dddd..0e13d42 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -259,6 +259,10 @@ STATIC void setup_int_vectors(void) setvec(pvec->intno, (intvec)MK_FP(FP_SEG(empty_handler), pvec->handleroff)); pokeb(0, 0x30 * 4, 0xea); pokel(0, 0x30 * 4 + 1, (ULONG)cpm_entry); + + /* these two are in the device driver area LOWTEXT (0x70) */ + setvec(0x1b, got_cbreak); + setvec(0x29, int29_handler); /* required for printf! */ } STATIC void init_kernel(void) @@ -607,8 +611,6 @@ STATIC void InitIO(void) struct dhdr far *device = &LoL->nul_dev; /* Initialize driver chain */ - setvec(0x1b, got_cbreak); - setvec(0x29, int29_handler); /* Requires Fast Con Driver */ do { init_device(device, NULL, 0, &lpTop); device = device->dh_next; diff --git a/kernel/prf.c b/kernel/prf.c index d882ca4..b2fc643 100644 --- a/kernel/prf.c +++ b/kernel/prf.c @@ -91,14 +91,8 @@ void put_console(int c) } #else #ifdef __WATCOMC__ -void int10_e(char c); -#pragma aux int10_e = \ - "push bp" \ - "mov ah, 0xe" \ - "mov bx, 0x0070" \ - "int 0x10" \ - "pop bp" \ - parm [al] modify [ah bx]; +void int29(char c); +#pragma aux int29 = "int 0x29" parm [al] modify exact [bx]; #endif void put_console(int c) @@ -111,18 +105,14 @@ void put_console(int c) #else #if defined(__TURBOC__) _AL = c; - _AH = 0x0e; - _BX = 0x0070; - __int__(0x10); + __int__(0x29); #elif defined(__WATCOMC__) - int10_e(c); + int29(c); #elif defined(I86) __asm { mov al, byte ptr c; - mov ah, 0x0e; - mov bx, 0x0070; - int 0x10; + int 0x29; } #endif /* __TURBO__ */ #endif /* FORSYS */