diff options
author | hpa <hpa> | 2004-12-15 12:34:42 +0000 |
---|---|---|
committer | hpa <hpa> | 2004-12-15 12:34:42 +0000 |
commit | e5b229c776a5de62121a18a981119484d367ad90 (patch) | |
tree | 9995adbc26ca4f19be997e82c77dec5859fefe1b /dos/conio.c | |
parent | 883466394bb699dfbae62fcf025586c43a77e481 (diff) | |
download | syslinux-e5b229c776a5de62121a18a981119484d367ad90.tar.gz |
Convert the DOS installer to C like everything else.
Diffstat (limited to 'dos/conio.c')
-rw-r--r-- | dos/conio.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dos/conio.c b/dos/conio.c new file mode 100644 index 00000000..460858fa --- /dev/null +++ b/dos/conio.c @@ -0,0 +1,41 @@ +#ident "$Id$" +/* ----------------------------------------------------------------------- * + * + * Copyright 2001-2003 H. Peter Anvin - All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, Inc., 53 Temple Place Ste 330, + * Boston MA 02111-1307, USA; either version 2 of the License, or + * (at your option) any later version; incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + +/* + * conio.c + * + * Output to the screen + */ + +#include <stdarg.h> +#include "mystuff.h" + +int putchar(int ch) +{ + asm("movb $0x02,%%ah ; int $0x21" : : "b" (ch)); + return ch; +} + +/* Note: doesn't put '\n' like the stdc version does */ +int puts(const char *s) +{ + int count = 0; + + while ( *s ) { + putchar(*s); + count++; + s++; + } + + return count; +} |