//------------------------------------------------------------------- // announce.c // // This module directs its messages to the current console. // // programmer: ALLAN CRUSE // written on: 15 MAY 2002 //------------------------------------------------------------------- #define __KERNEL__ #define MODULE #include // for init_module() #include // for 'current' #define SUCCESS 0 #define CLEAR_SCREEN "\033[1;1H\033[2J" static char modname[] = "announce"; static struct tty_struct *tty; static int (*cprint)( struct tty_struct *, int, const unsigned char *, int ); static unsigned char announce[ 80 ] = CLEAR_SCREEN; static int len; void cleanup_module( void ) { len = sprintf( announce, "\n\rModule \'%s\' is now being removed.\r\n\n", modname ); cprint( tty, 0, announce, len ); } int init_module( void ) { len = strlen( announce ); len += sprintf( announce+len, "\nModule \'%s\' was successfully installed.\r\n\n", modname ); tty = current->tty; cprint = tty->driver.write; cprint( tty, 0, announce, len ); return SUCCESS; } MODULE_LICENSE("GPL");