a little more debug to help diagnose boot failure
[AROS.git] / test / dos / rawtest.c
blob04d0014f76357a16fd2790b18443cd7579e243db
1 /*
2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <proto/dos.h>
8 #include <string.h>
9 #include <stdlib.h>
11 #define MODE_CON 0
12 #define MODE_RAW 1
14 static void SetConsoleMode( LONG mode );
15 static TEXT GetChar( void );
16 static void PutChar( TEXT buffer );
17 static void PutString( STRPTR buffer );
19 int main( void )
21 TEXT ch;
23 SetConsoleMode( MODE_RAW );
25 while( TRUE )
27 ch = GetChar();
28 PutString( " >" );
29 PutChar( ch );
30 PutString( "< " );
32 if( ch == 'x' || ch == 3 )
33 break;
36 SetConsoleMode( MODE_CON );
37 PutChar( '\n' );
39 return 0;
42 static void SetConsoleMode( LONG mode )
44 SetMode( Input() , mode );
47 static TEXT GetChar( void )
49 TEXT buffer;
51 Read( Output() , &buffer , 1 );
53 return buffer;
56 static void PutChar( TEXT buffer )
58 Write( Output() , &buffer , 1 );
61 static void PutString( STRPTR buffer )
63 Write( Output() , buffer , strlen( buffer ) );