Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patches to Etherboot/16 for ANSI escape handling



Please apply these patches in the src/ directory, then define -DANSIESC
in src-16/ then make clean, make. Let me know if they work or not.

The footprint goes over 8kB in most cases BTW.

Have a happy Easter.

	Cheers, Ken

*** ansiesc.c.orig	Mon Mar  9 23:22:29 1998
--- ansiesc.c	Thu Apr  9 10:56:05 1998
***************
*** 76,81 ****
--- 76,82 ----
  #define MAXSTRARGS	1
  #define MAXSTRARGLEN	40
  
+ #ifdef	ETHERBOOT32
  extern union {
    struct {
      unsigned char al,ah,bl,bh,cl,ch,dl,dh;
***************
*** 84,93 ****
      unsigned short ax,bx,cx,dx;
    } __attribute__ ((packed)) x;
  } __attribute__ ((packed)) int10ret;
- 
  #define int10(a,b,c,d) _int10((unsigned long)(a)+((unsigned long)(b)<<16), \
  			      (unsigned long)(c)+((unsigned long)(d)<<16))
!   extern void _int10(unsigned long axbx,unsigned long cxdx);
  
  static enum { esc_init, esc_std, esc_esc, esc_bracket, esc_digit,
  	      esc_semicolon, esc_str, esc_quote
--- 85,105 ----
      unsigned short ax,bx,cx,dx;
    } __attribute__ ((packed)) x;
  } __attribute__ ((packed)) int10ret;
  #define int10(a,b,c,d) _int10((unsigned long)(a)+((unsigned long)(b)<<16), \
  			      (unsigned long)(c)+((unsigned long)(d)<<16))
! extern void _int10(unsigned long axbx,unsigned long cxdx);
! #endif
! 
! #ifdef	ETHERBOOT16
! extern union {
! 	struct {
! 		unsigned char	al, ah, bl, bh, cl, ch, dl, dh;
! 	} lh;
! 	struct {
! 		unsigned short	ax, bx, cx, dx;
! 	} x;
! } int10ret;
! #endif
  
  static enum { esc_init, esc_std, esc_esc, esc_bracket, esc_digit,
  	      esc_semicolon, esc_str, esc_quote
***************
*** 100,106 ****
  static int argi[MAXARGS];
  static char args[MAXSTRARGS][MAXSTRARGLEN];
  static int in_tftp = 0;
! static const char coltable[8] = "\000\004\002\006\001\005\003\007";
  #ifdef GFX
  static unsigned short gfx_rows,gfx_columns,char_width,char_height,gfx_x,gfx_y;
  static int in_gfx = 0, gfx_packed,gfx_data,gfx_nbits;
--- 112,118 ----
  static int argi[MAXARGS];
  static char args[MAXSTRARGS][MAXSTRARGLEN];
  static int in_tftp = 0;
! static const char coltable[9] = "\000\004\002\006\001\005\003\007";
  #ifdef GFX
  static unsigned short gfx_rows,gfx_columns,char_width,char_height,gfx_x,gfx_y;
  static int in_gfx = 0, gfx_packed,gfx_data,gfx_nbits;
*** start16.S.orig	Tue Jun 17 00:56:20 1997
--- start16.S	Thu Apr  9 11:00:50 1998
***************
*** 46,59 ****
--- 46,97 ----
  	push	cx
  	push	bx
  	movb	cl,4[bp]
+ #ifdef	ANSIESC
+ 	push	cx
+ 	call	_handleansi
+ 	pop	cx	; not to recover cx but to adjust stack
+ #else
  	mov	bx,*1
  	movb	ah,*0x0e
  	movb	al,cl
  	int	*0x10
+ #endif
  	pop	bx
  	pop	cx
  	pop	bp
  	ret
+ 
+ #ifdef	ANSIESC
+ /**************************************************************************
+ INT10 - Call Interrupt 0x10
+ **************************************************************************/
+ 	.globl	_int10
+ 	.globl	_int10ret
+ _int10:
+ 	push	bp
+ 	mov	bp,sp
+ 	push	bx
+ 	push	cx
+ 	push	dx
+ 	mov	ax,4[bp]
+ 	mov	bx,6[bp]
+ 	mov	cx,8[bp]
+ 	mov	dx,10[bp]
+ 	int	*0x10
+ 	mov	_int10ret,ax
+ 	mov	_int10ret+2,bx
+ 	mov	_int10ret+4,cx
+ 	mov	_int10ret+6,dx
+ 	pop	dx
+ 	pop	cx
+ 	pop	bx
+ 	pop	bp
+ 	ret
+ 	.data
+ _int10ret:
+ 	.word	0,0,0,0
+ 	.text
+ #endif
  
  /**************************************************************************
  GETCHAR - Get a character


For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.