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
This commit is contained in:
Bart Oldeman 2004-05-23 22:04:42 +00:00
parent f8be820925
commit 99e727b73d
3 changed files with 10 additions and 19 deletions

View File

@ -244,8 +244,7 @@ _int29_handler:
push bp push bp
push bx push bx
mov ah,0Eh mov ah,0Eh
mov bh,0 mov bx,7
mov bl,7
int 10h ; write char al, teletype mode int 10h ; write char al, teletype mode
pop bx pop bx
pop bp pop bp

View File

@ -259,6 +259,10 @@ STATIC void setup_int_vectors(void)
setvec(pvec->intno, (intvec)MK_FP(FP_SEG(empty_handler), pvec->handleroff)); setvec(pvec->intno, (intvec)MK_FP(FP_SEG(empty_handler), pvec->handleroff));
pokeb(0, 0x30 * 4, 0xea); pokeb(0, 0x30 * 4, 0xea);
pokel(0, 0x30 * 4 + 1, (ULONG)cpm_entry); 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) STATIC void init_kernel(void)
@ -607,8 +611,6 @@ STATIC void InitIO(void)
struct dhdr far *device = &LoL->nul_dev; struct dhdr far *device = &LoL->nul_dev;
/* Initialize driver chain */ /* Initialize driver chain */
setvec(0x1b, got_cbreak);
setvec(0x29, int29_handler); /* Requires Fast Con Driver */
do { do {
init_device(device, NULL, 0, &lpTop); init_device(device, NULL, 0, &lpTop);
device = device->dh_next; device = device->dh_next;

View File

@ -91,14 +91,8 @@ void put_console(int c)
} }
#else #else
#ifdef __WATCOMC__ #ifdef __WATCOMC__
void int10_e(char c); void int29(char c);
#pragma aux int10_e = \ #pragma aux int29 = "int 0x29" parm [al] modify exact [bx];
"push bp" \
"mov ah, 0xe" \
"mov bx, 0x0070" \
"int 0x10" \
"pop bp" \
parm [al] modify [ah bx];
#endif #endif
void put_console(int c) void put_console(int c)
@ -111,18 +105,14 @@ void put_console(int c)
#else #else
#if defined(__TURBOC__) #if defined(__TURBOC__)
_AL = c; _AL = c;
_AH = 0x0e; __int__(0x29);
_BX = 0x0070;
__int__(0x10);
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
int10_e(c); int29(c);
#elif defined(I86) #elif defined(I86)
__asm __asm
{ {
mov al, byte ptr c; mov al, byte ptr c;
mov ah, 0x0e; int 0x29;
mov bx, 0x0070;
int 0x10;
} }
#endif /* __TURBO__ */ #endif /* __TURBO__ */
#endif /* FORSYS */ #endif /* FORSYS */