From: Stefan E. <se...@us...> - 2002-05-08 14:05:49
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv20864 Modified Files: system3.c Log Message: - iotest command: use TAR io driver chained to CF io driver and RAM1 io driver to extract a file from CF card to RAM pool 1. Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- system3.c 2 May 2002 15:57:29 -0000 1.14 +++ system3.c 8 May 2002 14:05:44 -0000 1.15 @@ -501,13 +501,16 @@ int io_cmd( int argc, char *argv[] ) { int ret; - io_driver_t *iotar, *ioram1; + io_driver_t *iotar, *ioram1, *iocf; + char buffer[1024]; io_dbg_set( 100 ); - tar_dbg_set( 1 ); + tar_dbg_set( 100 ); +#if 0 ret = io_test(); if ( ret ) return -EINVAL; +#endif ioram1 = io_get_byname( "RAM1" ); if ( !ioram1 ) return -EINVAL; @@ -517,10 +520,32 @@ if ( !iotar ) return -EINVAL; printf( "found 'TAR': %p\n", iotar ); + iocf = io_get_byname( "CF" ); + if ( !iocf ) return -EINVAL; + printf( "found 'CF': %p\n", iocf ); + + /* CF card is on slot 1 */ + ret = io_configure( iocf, (void *)1 ); + if ( ret ) { + printf( "io_configure() error %d\n", ret ); + return -EINVAL; + } + + ret = io_read( buffer, (unsigned char *)0, 1024, iocf ); + if ( ret ) { + printf( "io_read() error %d\n", ret ); + return -EINVAL; + } + ret = io_copy( ioram1, iocf, 1024 ); + if ( ret ) { + printf( "io_copy() error %d\n", ret ); + return -EINVAL; + } + /* have tar io driver reading from RAM0 io driver */ - ret = io_chain_driver( "TAR", "RAM0" ); + //ret = io_chain_driver( "TAR", "RAM0" ); + ret = io_chain_driver( "TAR", "CF" ); if ( ret ) return -EINVAL; - printf( "chained RAM0->TAR\n" ); /* select a file */ ret = io_configure( iotar, "system3.c" ); @@ -561,6 +586,9 @@ static char io_help[] = "io test function\n"; __commandlist(io_cmd, "iotest", io_help); +extern int cf_test_module( int argc, char *argv[] ); +extern char cf_help[]; +__commandlist(cf_test_module, "cftest", cf_help); /***************************************************************** * manually reference flash and download commands until they * are in libblob. |