You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(27) |
Sep
(64) |
Oct
(202) |
Nov
(31) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(173) |
Mar
(13) |
Apr
(140) |
May
(75) |
Jun
(1) |
Jul
(37) |
Aug
(14) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(2) |
2003 |
Jan
(51) |
Feb
(12) |
Mar
(18) |
Apr
(24) |
May
(1) |
Jun
|
Jul
|
Aug
(72) |
Sep
(12) |
Oct
(18) |
Nov
(60) |
Dec
(26) |
2004 |
Jan
(1) |
Feb
(40) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(5) |
2006 |
Jan
(13) |
Feb
(5) |
Mar
(8) |
Apr
(13) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(35) |
Nov
(20) |
Dec
(10) |
2007 |
Jan
(13) |
Feb
(9) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(54) |
Jun
(78) |
Jul
(35) |
Aug
(21) |
Sep
(21) |
Oct
(29) |
Nov
(10) |
Dec
(5) |
2010 |
Jan
|
Feb
|
Mar
(26) |
Apr
(55) |
May
(73) |
Jun
(63) |
Jul
(38) |
Aug
(39) |
Sep
(19) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Stefan E. <se...@us...> - 2001-10-09 17:50:30
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv13524 Modified Files: Makefile.am Log Message: - added lcd.h to the list of header files Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 2001/10/07 23:32:05 1.6 +++ Makefile.am 2001/10/09 17:50:27 1.7 @@ -19,6 +19,7 @@ flash.h \ icache.h \ init.h \ + lcd.h \ led.h \ linux.h \ main.h \ |
From: Stefan E. <se...@us...> - 2001-10-09 17:49:38
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv12624 Modified Files: acconfig.h configure.in Log Message: - added LCD stuff - can conditionally enabled with --enable-lcd this defines CONFIG_LCD_SUPPORT, and compiles in lcd.c. One has to add LCD settings for his platform for this to work. - added platform specific module for diag. Index: acconfig.h =================================================================== RCS file: /cvsroot/blob/blob/acconfig.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- acconfig.h 2001/09/27 21:38:17 1.4 +++ acconfig.h 2001/10/09 17:49:36 1.5 @@ -89,6 +89,9 @@ /* Define if your system uses serial port 3 */ #undef USE_SERIAL3 +/* Define if LCD support is wanted */ +#undef CONFIG_LCD_SUPPORT + @BOTTOM@ #endif Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- configure.in 2001/10/07 20:14:00 1.15 +++ configure.in 2001/10/09 17:49:36 1.16 @@ -124,6 +124,7 @@ AC_MSG_RESULT(PTSystem3) AC_DEFINE(PT_SYSTEM3) AC_DEFINE(USE_SERIAL1) + DIAG_PLATFORM_OBJ="system3.o" use_cpu="sa1110" ;; *) @@ -191,6 +192,11 @@ [debug_flag=$enable_debug], [debug_flag=no]) +AC_ARG_ENABLE(lcd, +[ --enable-lcd Enable lcd support ], +[lcd_flag=$enable_lcd], +[lcd_flag=no]) + dnl Check if the user wants *all* features AC_ARG_ENABLE(all-features, @@ -202,6 +208,7 @@ clock_scaling_flag=yes chkmem_flag=yes debug_flag=yes + lcd_flag=yes fi @@ -236,9 +243,21 @@ AC_SUBST(DEBUG) +dnl Check wether or not lcd support code is wanted +if test "x$lcd_flag" = "xyes" ; then + LCD="lcd.o" + AC_DEFINE(CONFIG_LCD_SUPPORT) +fi + +AC_SUBST(LCD) + +dnl Check wether or not additional platform source code +dnl for diag is needed +AC_SUBST(DIAG_PLATFORM_OBJ) + dnl Check for extra debug info AC_ARG_ENABLE(blob-debug, [ --enable-blob-debug Enable run-time debug information], @@ -319,5 +338,6 @@ echo "Clock scaling support ${clock_scaling_flag}" echo "Memory test support ${chkmem_flag}" echo "Debugging commands support ${debug_flag}" +echo "LCD support ${lcd_flag}" echo "Run-time debug information ${blob_debug_flag}" echo "" |
From: Stefan E. <se...@us...> - 2001-10-09 16:49:59
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv27059 Added Files: system3.c Log Message: - new file. Test and diagnosis routines for system 3 platform. --- NEW FILE: system3.c --- |
From: Stefan E. <se...@us...> - 2001-10-09 16:48:14
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv26511 Added Files: lcd.c Log Message: - new file. generic lcd functions. --- NEW FILE: lcd.c --- |
From: Stefan E. <se...@us...> - 2001-10-09 16:38:44
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv23425 Added Files: lcd.h Log Message: - new file. will contain defs for generic lcd stuff --- NEW FILE: lcd.h --- |
From: Abraham vd M. <ab...@2d...> - 2001-10-08 07:26:28
|
Hi Erik! > We keep blob simple: no command line editor, no diagnostics tools. > Instead, we add a directory diag, in which we create a separate > diagnostics tools that can be loaded by blob. Blob and diag could share > quite some code (serial ports, command line, etc), but apart from that > they are independent. Diag can get more features needed for > diagnostics, but blob remains simple. Deal? That sounds like an idea. --=20 Regards Abraham I would like to urinate in an OVULAR, porcelain pool -- __________________________________________________________ Abraham vd Merwe - 2d3D, Inc. Device Driver Development, Outsourcing, Embedded Systems Cell: +27 82 565 4451 Snailmail: Tel: +27 21 761 7549 Block C, Antree Park Fax: +27 21 761 7648 Doncaster Road Email: ab...@2d... Kenilworth, 7700 Http: http://www.2d3d.com South Africa |
From: Erik M. <J.A...@IT...> - 2001-10-08 00:00:03
|
Hi, Right, everything is in place, we now have a bootloader "blob" and a diagnostics tool "diag" sharing a library with common code. Both work nicely on a LART. Just download diag in blob with "download kernel" and type "boot" to run it. A few notes: - I think the memory tester can be moved from blob to diag right now, but in that case diag needs to pick up the ATAG_MEM nodes so it knows where to find memory. - PLEB needs some cleanup. We currently switch the LED, but it turns out that the same GPIO line that controls the LED also turns the serial tranceiver on and off (design error, IMHO). My plan is to put some generic GPIO code into the library (I have that code lying around for userland, needs to be cleaned up), and initialise the GPDR, GPSR and GPCR with an initcall. Erik [time to go to sleep] -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department of Electrical Engineering, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Erik M. <er...@us...> - 2001-10-07 23:32:08
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv9847/src/diag Modified Files: Makefile.am commands.c Added Files: command_hist.c Log Message: add command line history to diag (making cmdhist_init() an initcall while doing so) --- NEW FILE: command_hist.c --- /********************************************************************** * Command history * * AUTOR: SELETZ * * Implements a simple command history * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: command_hist.c,v 1.1 2001/10/07 23:32:05 erikm Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/command.h> #include <blob/command_hist.h> #include <blob/errno.h> #include <blob/init.h> #include <blob/util.h> /********************************************************************** * Defines / Makros */ #define CMDHIST_DEBUG 0 #define MAX_HIST 32 /********************************************************************** * Programmglobale Variable */ /********************************************************************** * Modulglobale Variable */ static int cmdhist_entries = 0; static int cmdhist_read = 0; static int cmdhist_write = 0; static char cmdhistory[MAX_HIST][MAX_COMMANDLINE_LENGTH]; /********************************************************************** * Prototypen */ /********************************************************************** * Exported functions */ /********************************************************************* * cmd_push * * AUTOR: SELETZ * REVISED: * * Push a command to the history buffer * */ int cmdhist_push( char *cmd ) { if ( !cmd ) return -EINVAL; if ( strlen( cmd ) > MAX_COMMANDLINE_LENGTH ) return -EINVAL; if ( strlen( cmd ) == 0 ) return 0; strcpy( cmdhistory[ cmdhist_write ], cmd ); cmdhist_write ++; cmdhist_write = cmdhist_write % MAX_HIST; if ( cmdhist_entries < MAX_HIST ) cmdhist_entries++; #if CMDHIST_DEBUG SerialOutputString( "e=" ); SerialOutputDec( cmdhist_entries ); SerialOutputString( " r=" ); SerialOutputDec( cmdhist_read ); SerialOutputString( " w=" ); SerialOutputDec( cmdhist_write ); SerialOutputString( "\n" ); #endif return 0; } /********************************************************************* * cmdhist_reset * * AUTOR: SELETZ * REVISED: * * Resets read ptr * */ int cmdhist_reset( void ) { cmdhist_read = cmdhist_write; return 0; } /********************************************************************* * cmd_next * * AUTOR: seletz * REVISED: * * Gets next command in history * */ int cmdhist_next( char **cmd ) { int ptr; if ( !cmdhist_entries ) return -EINVAL; if ( !cmd ) return -EINVAL; ptr = cmdhist_read; if ( ptr == 0 ) { if ( cmdhist_entries != MAX_HIST ) return -EINVAL; ptr = MAX_HIST - 1; } else { ptr--; } if ( !cmdhistory[ptr][0] ) return -EINVAL; *cmd = cmdhistory[ptr]; cmdhist_read = ptr; #if CMDHIST_DEBUG SerialOutputString( "e=" ); SerialOutputDec( cmdhist_entries ); SerialOutputString( " r=" ); SerialOutputDec( cmdhist_read ); SerialOutputString( " w=" ); SerialOutputDec( cmdhist_write ); SerialOutputString( "\n" ); #endif return 0; } /********************************************************************* * cmd_prev * * AUTOR: SELETZ * REVISED: * * Gets previous command from history * */ int cmdhist_prev( char **cmd ) { int ptr; if ( !cmd ) return -EINVAL; if ( !cmdhist_entries ) return -EINVAL; ptr = cmdhist_read + 1; ptr = ptr % MAX_HIST; if ( ptr == cmdhist_write ) return -EINVAL; if ( !cmdhistory[ptr][0] ) return -EINVAL; *cmd = cmdhistory[ptr]; cmdhist_read = ptr; return 0; } /********************************************************************** * Static functions */ /********************************************************************* * cmdhist_init * * AUTOR: SELETZ * REVISED: * * Initializes this module * */ static void cmdhist_init( void ) { int i; cmdhist_read = 0; cmdhist_write = 0; cmdhist_entries = 0; i=MAX_HIST - 1; while ( i-- ) { cmdhistory[i][0]=0; } } __initlist(cmdhist_init, INIT_LEVEL_OTHER_STUFF); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/diag/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 2001/10/07 22:09:54 1.2 +++ Makefile.am 2001/10/07 23:32:05 1.3 @@ -36,6 +36,7 @@ # be linked in the wrong order! diag_elf32_SOURCES = \ start.S \ + command_hist.c \ commands.c \ initcalls.c \ main.c Index: commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/commands.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- commands.c 2001/10/07 22:36:11 1.2 +++ commands.c 2001/10/07 23:32:05 1.3 @@ -29,11 +29,106 @@ #include <blob/command.h> +#include <blob/command_hist.h> #include <blob/reboot.h> +#include <blob/serial.h> #include <blob/terminal.h> +#include <blob/time.h> +#include <blob/util.h> __commandlist(reset_terminal, "reset", resethelp); __commandlist(reboot, "reboot", reboothelp); + + + + +/* more or less like SerialInputString(), but with echo and backspace */ +/* unlike the version in libblob, this version has a command history */ +int GetCommand(char *command, int len, int timeout) +{ + u32 startTime, currentTime; + char c; + int i; + int numRead; + int maxRead = len - 1; + + TimerClearOverflow(); + + startTime = TimerGetTime(); + + cmdhist_reset(); + + for(numRead = 0, i = 0; numRead < maxRead;) { + /* try to get a byte from the serial port */ + while(!SerialInputByte(&c)) { + currentTime = TimerGetTime(); + + /* check timeout value */ + if((currentTime - startTime) > + (timeout * TICKS_PER_SECOND)) { + /* timeout */ + command[i++] = '\0'; + cmdhist_push( command ); + return(numRead); + } + } + + if((c == '\r') || (c == '\n')) { + command[i++] = '\0'; + + /* print newline */ + SerialOutputByte('\n'); + cmdhist_push( command ); + return(numRead); + } else if(c == '\b') { /* FIXME: is this backspace? */ + if(i > 0) { + i--; + numRead--; + /* cursor one position back. */ + SerialOutputString("\b \b"); + } + } else if ( c == CMDHIST_KEY_UP ) { + char *cmd = NULL; + /* get cmd from history */ + if ( cmdhist_next( &cmd ) != 0 ) + continue; + + /* clear line */ + while ( numRead-- ) { + SerialOutputString("\b \b"); + } + + /* display it */ + SerialOutputString(cmd); + i = numRead = strlen( cmd ); + strcpy( command, cmd ); + } else if ( c == CMDHIST_KEY_DN ) { + char *cmd = NULL; + /* get cmd from history */ + if ( cmdhist_prev( &cmd ) != 0 ) + continue; + + /* clear line */ + while ( numRead-- ) { + SerialOutputString("\b \b"); + } + + /* display it */ + SerialOutputString(cmd); + i = numRead = strlen( cmd ); + strcpy( command, cmd ); + } else { + command[i++] = c; + numRead++; + + /* print character */ + SerialOutputByte(c); + } + } + + cmdhist_push( command ); + return(numRead); +} |
From: Erik M. <er...@us...> - 2001-10-07 23:32:08
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv9847/src/lib Modified Files: command.c Log Message: add command line history to diag (making cmdhist_init() an initcall while doing so) Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- command.c 2001/10/07 21:28:57 1.4 +++ command.c 2001/10/07 23:32:05 1.5 @@ -274,7 +274,7 @@ /* more or less like SerialInputString(), but with echo and backspace */ -int GetCommand(char *command, int len, int timeout) +int __attribute__((weak)) GetCommand(char *command, int len, int timeout) { u32 startTime, currentTime; char c; |
From: Erik M. <er...@us...> - 2001-10-07 23:32:07
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv9847/src Removed Files: command_hist.c Log Message: add command line history to diag (making cmdhist_init() an initcall while doing so) --- command_hist.c DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 23:32:07
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv9847/include/blob Modified Files: Makefile.am Added Files: command_hist.h Log Message: add command line history to diag (making cmdhist_init() an initcall while doing so) --- NEW FILE: command_hist.h --- /********************************************************************** * command_hist.h * * AUTOR: SELETZ * * Header file for command_hist.h * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * */ #ident "$Id: command_hist.h,v 1.1 2001/10/07 23:32:05 erikm Exp $" #ifndef BLOB_COMMAND_HIST_H #define BLOB_COMMAND_HIST_H #define CMDHIST_KEY_UP '\025' // ^U #define CMDHIST_KEY_DN '\004' // ^D int cmdhist_push( char *cmd ); int cmdhist_next( char **cmd ); int cmdhist_prev( char **cmd ); int cmdhist_reset( void ); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 2001/10/07 22:36:11 1.5 +++ Makefile.am 2001/10/07 23:32:05 1.6 @@ -13,6 +13,7 @@ noinst_HEADERS = \ command.h \ + command_hist.h \ errno.h \ error.h \ flash.h \ |
From: Erik M. <er...@us...> - 2001-10-07 23:32:07
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv9847/include Removed Files: command_hist.h Log Message: add command line history to diag (making cmdhist_init() an initcall while doing so) --- command_hist.h DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 23:01:11
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv5107/src/blob Modified Files: chkmem.c clock.c debug.c Log Message: rename strtoval() to strtou32() Index: chkmem.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/chkmem.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- chkmem.c 2001/10/07 19:34:17 1.2 +++ chkmem.c 2001/10/07 23:01:08 1.3 @@ -161,7 +161,7 @@ /* get verbosity level */ showevery = CHKMEM_SHOWEVERY; if ( argc > 2 ) { - if(strtoval(argv[2], &showevery) < 0) { + if(strtou32(argv[2], &showevery) < 0) { SerialOutputString("*** not a value\n"); return CHKMEM_ERR; } @@ -177,7 +177,7 @@ /* get repeat count */ repcount = 1; if ( argc > 3 ) { - if ( strtoval(argv[3], &repcount ) < 0 ) { + if ( strtou32(argv[3], &repcount ) < 0 ) { SerialOutputString("*** not a value\n"); return CHKMEM_ERR; } Index: clock.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/clock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- clock.c 2001/10/07 19:34:17 1.2 +++ clock.c 2001/10/07 23:01:08 1.3 @@ -67,7 +67,7 @@ return -ENOPARAMS; for(i = 0; i < 5; i++) { - if(strtoval(argv[i + 1], ®s[i]) < 0) { + if(strtou32(argv[i + 1], ®s[i]) < 0) { printerror(ENAN, argv[i + 1]); return 0; } Index: debug.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/debug.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- debug.c 2001/10/07 19:34:17 1.2 +++ debug.c 2001/10/07 23:01:08 1.3 @@ -100,13 +100,13 @@ if ( argc < 4 ) ERR( -EINVAL ); - ret = strtoval( argv[1], &src ); + ret = strtou32( argv[1], &src ); if ( ret < 0 ) ERR( -EINVAL ); - ret = strtoval( argv[2], &dest ); + ret = strtou32( argv[2], &dest ); if ( ret < 0 ) ERR( -EINVAL ); - ret = strtoval( argv[3], &len ); + ret = strtou32( argv[3], &len ); if ( ret < 0 ) ERR( -EINVAL ); /* counted in words */ @@ -157,10 +157,10 @@ if ( argc < 3 ) ERR( -EINVAL ); - ret = strtoval(argv[1], &address); + ret = strtou32(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); - ret = strtoval(argv[2], &value); + ret = strtou32(argv[2], &value); if ( ret < 0 ) ERR( -EINVAL ); #if CHKMEM_DEBUG @@ -200,7 +200,7 @@ if ( argc < 2 ) ERR( -EINVAL ); - ret = strtoval(argv[1], &address); + ret = strtou32(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); #if CHKMEM_DEBUG @@ -242,10 +242,10 @@ if ( argc < 4 ) ERR( -EINVAL ); - ret = strtoval( argv[1], &adr ); + ret = strtou32( argv[1], &adr ); if ( ret < 0 ) ERR( -EINVAL ); - ret = strtoval( argv[2], &value ); + ret = strtou32( argv[2], &value ); if ( ret < 0 ) ERR( -EINVAL ); SerialOutputHex( MEM( adr ) ); |
From: Erik M. <er...@us...> - 2001-10-07 23:01:10
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv5107/include/blob Modified Files: util.h Log Message: rename strtoval() to strtou32() Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- util.h 2001/10/07 15:27:35 1.2 +++ util.h 2001/10/07 23:01:08 1.3 @@ -54,6 +54,6 @@ char *strcpy(char *dest, const char *src); /* convert a string to an u32 value */ -int strtoval(const char *str, u32 *value); +int strtou32(const char *str, u32 *value); #endif |
From: Erik M. <er...@us...> - 2001-10-07 22:59:00
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv4549 Modified Files: Makefile.am util.c Added Files: strcpy.c strlen.c strncmp.c strtou32.c Log Message: Move string functions to separate files so the linker will pick up only the necessary functions. --- NEW FILE: strcpy.c --- /* * strcpy.c: copy string * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: strcpy.c,v 1.1 2001/10/07 22:58:56 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: strcpy.c,v 1.1 2001/10/07 22:58:56 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/util.h> char *strcpy(char *dest, const char *src) { while(*src != '\0') *dest++ = *src++; *dest = '\0'; return dest; } --- NEW FILE: strlen.c --- /* * strlen.c: return string length * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: strlen.c,v 1.1 2001/10/07 22:58:56 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: strlen.c,v 1.1 2001/10/07 22:58:56 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/util.h> int strlen(const char *s) { int i = 0; for(;*s != '\0'; s++) i++; return i; } --- NEW FILE: strncmp.c --- /* * strncmp.c: compare two strings * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: strncmp.c,v 1.1 2001/10/07 22:58:56 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: strncmp.c,v 1.1 2001/10/07 22:58:56 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/util.h> int strncmp(const char *s1, const char *s2, int maxlen) { int i; for(i = 0; i < maxlen; i++) { if(s1[i] != s2[i]) return ((int) s1[i]) - ((int) s2[i]); if(s1[i] == 0) return 0; } return 0; } --- NEW FILE: strtou32.c --- /* * strtou32.c: convert string to u32 * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: strtou32.c,v 1.1 2001/10/07 22:58:56 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: strtou32.c,v 1.1 2001/10/07 22:58:56 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/types.h> #include <blob/util.h> /* test for a digit. return value if digit or -1 otherwise */ static int digitvalue(char isdigit) { if (isdigit >= '0' && isdigit <= '9' ) return isdigit - '0'; else return -1; } /* test for a hexidecimal digit. return value if digit or -1 otherwise */ static int xdigitvalue(char isdigit) { if (isdigit >= '0' && isdigit <= '9' ) return isdigit - '0'; if (isdigit >= 'a' && isdigit <= 'f') return 10 + isdigit - 'a'; return -1; } /* convert a string to an u32 value. if the string starts with 0x, it * is a hexidecimal string, otherwise we treat is as decimal. returns * the converted value on success, or -1 on failure. no, we don't care * about overflows if the string is too long. */ int strtou32(const char *str, u32 *value) { int i; *value = 0; if(strncmp(str, "0x", 2) == 0) { /* hexadecimal mode */ str += 2; while(*str != '\0') { if((i = xdigitvalue(*str)) < 0) return -1; *value = (*value << 4) | (u32)i; str++; } } else { /* decimal mode */ while(*str != '\0') { if((i = digitvalue(*str)) < 0) return -1; *value = (*value * 10) + (u32)i; str++; } } return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 2001/10/07 22:36:11 1.4 +++ Makefile.am 2001/10/07 22:58:56 1.5 @@ -33,6 +33,10 @@ led.c \ reboot.c \ serial.c \ + strcpy.c \ + strlen.c \ + strncmp.c \ + strtou32.c \ terminal.c \ time.c \ util.c Index: util.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- util.c 2001/10/07 19:34:17 1.2 +++ util.c 2001/10/07 22:58:56 1.3 @@ -87,112 +87,3 @@ while(dest < limit) *dest++ = wordToWrite; } /* MyMemSet */ - - - - -int strncmp(const char *s1, const char *s2, int maxlen) -{ - int i; - - for(i = 0; i < maxlen; i++) { - if(s1[i] != s2[i]) - return ((int) s1[i]) - ((int) s2[i]); - if(s1[i] == 0) - return 0; - } - - return 0; -} - - - - -int strlen(const char *s) -{ - int i = 0; - - for(;*s != '\0'; s++) - i++; - - return i; -} - - - - -char *strcpy(char *dest, const char *src) -{ - while(*src != '\0') - *dest++ = *src++; - - *dest = '\0'; - - return dest; -} - - - - -/* test for a digit. return value if digit or -1 otherwise */ -static int digitvalue(char isdigit) -{ - if (isdigit >= '0' && isdigit <= '9' ) - return isdigit - '0'; - else - return -1; -} - - - - -/* test for a hexidecimal digit. return value if digit or -1 otherwise */ -static int xdigitvalue(char isdigit) -{ - if (isdigit >= '0' && isdigit <= '9' ) - return isdigit - '0'; - if (isdigit >= 'a' && isdigit <= 'f') - return 10 + isdigit - 'a'; - return -1; -} - - - - -/* convert a string to an u32 value. if the string starts with 0x, it - * is a hexidecimal string, otherwise we treat is as decimal. returns - * the converted value on success, or -1 on failure. no, we don't care - * about overflows if the string is too long. - */ -int strtoval(const char *str, u32 *value) -{ - int i; - - *value = 0; - - if(strncmp(str, "0x", 2) == 0) { - /* hexadecimal mode */ - str += 2; - - while(*str != '\0') { - if((i = xdigitvalue(*str)) < 0) - return -1; - - *value = (*value << 4) | (u32)i; - - str++; - } - } else { - /* decimal mode */ - while(*str != '\0') { - if((i = digitvalue(*str)) < 0) - return -1; - - *value = (*value * 10) + (u32)i; - - str++; - } - } - - return 0; -} |
From: Erik M. <er...@us...> - 2001-10-07 22:36:14
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv32181/src/lib Modified Files: Makefile.am terminal.c Added Files: reboot.c Log Message: - Move the reboot command to the library - Put command help into terminal.c and reboot.c --- NEW FILE: reboot.c --- /* * reboot.c: Reboot board * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: reboot.c,v 1.1 2001/10/07 22:36:11 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: reboot.c,v 1.1 2001/10/07 22:36:11 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/serial.h> #include <blob/sa1100.h> #include <blob/time.h> char reboothelp[] = "reboot\n" "Reboot system\n"; int reboot(int argc, char *argv[]) { SerialOutputString("Rebooting...\n\n"); msleep(500); RCSR = 0; RSRR = 1; /* never reached, but anyway... */ return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 2001/10/07 20:29:38 1.3 +++ Makefile.am 2001/10/07 22:36:11 1.4 @@ -31,6 +31,7 @@ icache.c \ init.c \ led.c \ + reboot.c \ serial.c \ terminal.c \ time.c \ Index: terminal.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/terminal.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- terminal.c 2001/10/07 20:54:23 1.3 +++ terminal.c 2001/10/07 22:36:11 1.4 @@ -33,6 +33,12 @@ +char resethelp[] = "reset\n" +"Reset terminal\n"; + + + + int reset_terminal(int argc, char *argv[]) { int i; |
From: Erik M. <er...@us...> - 2001-10-07 22:36:14
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv32181/src/diag Modified Files: commands.c Log Message: - Move the reboot command to the library - Put command help into terminal.c and reboot.c Index: commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/commands.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- commands.c 2001/10/07 22:09:54 1.1 +++ commands.c 2001/10/07 22:36:11 1.2 @@ -29,12 +29,11 @@ #include <blob/command.h> +#include <blob/reboot.h> #include <blob/terminal.h> -static char resethelp[] = "reset\n" -"Reset terminal\n"; - __commandlist(reset_terminal, "reset", resethelp); +__commandlist(reboot, "reboot", reboothelp); |
From: Erik M. <er...@us...> - 2001-10-07 22:36:13
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv32181/src/blob Modified Files: commands.c reboot.c Log Message: - Move the reboot command to the library - Put command help into terminal.c and reboot.c Index: commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/commands.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- commands.c 2001/10/07 20:54:23 1.1 +++ commands.c 2001/10/07 22:36:11 1.2 @@ -29,12 +29,11 @@ #include <blob/command.h> +#include <blob/reboot.h> #include <blob/terminal.h> -static char resethelp[] = "reset\n" -"Reset terminal\n"; - __commandlist(reset_terminal, "reset", resethelp); +__commandlist(reboot, "reboot", reboothelp); Index: reboot.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/reboot.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reboot.c 2001/10/07 19:34:17 1.2 +++ reboot.c 2001/10/07 22:36:11 1.3 @@ -36,27 +36,6 @@ -static int reboot(int argc, char *argv[]) -{ - SerialOutputString("Rebooting...\n\n"); - - msleep(500); - - RCSR = 0; - RSRR = 1; - - /* never reached, but anyway... */ - return 0; -} - -static char reboothelp[] = "reboot\n" -"Reboot system\n"; - -__commandlist(reboot, "reboot", reboothelp); - - - - static int reblob(int argc, char *argv[]) { void (*blob)(void) = (void (*)(void))BLOB_RAM_BASE; |
From: Erik M. <er...@us...> - 2001-10-07 22:36:13
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv32181/include/blob Modified Files: Makefile.am terminal.h Added Files: reboot.h Log Message: - Move the reboot command to the library - Put command help into terminal.c and reboot.c --- NEW FILE: reboot.h --- /* * reboot.h: header file for lib/reboot.h * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: reboot.h,v 1.1 2001/10/07 22:36:11 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: reboot.h,v 1.1 2001/10/07 22:36:11 erikm Exp $" #ifndef BLOB_REBOOT_H #define BLOB_REBOOT_H extern char reboothelp[]; int reboot(int argc, char *argv[]); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 2001/10/07 20:54:23 1.4 +++ Makefile.am 2001/10/07 22:36:11 1.5 @@ -24,6 +24,7 @@ memory.h \ memsetup.h \ param_block.h \ + reboot.h \ sa1100.h \ serial.h \ terminal.h \ Index: terminal.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/terminal.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- terminal.h 2001/10/07 20:54:23 1.1 +++ terminal.h 2001/10/07 22:36:11 1.2 @@ -29,6 +29,7 @@ +extern char resethelp[]; int reset_terminal(int argc, char *argv[]); |
From: Erik M. <er...@us...> - 2001-10-07 22:09:56
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv27014 Modified Files: Makefile.am Added Files: commands.c initcalls.c ld-script main.c start.S Log Message: Basic files for diag --- NEW FILE: commands.c --- /* * commands.c: commands for diag * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: commands.c,v 1.1 2001/10/07 22:09:54 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: commands.c,v 1.1 2001/10/07 22:09:54 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/command.h> #include <blob/terminal.h> static char resethelp[] = "reset\n" "Reset terminal\n"; __commandlist(reset_terminal, "reset", resethelp); --- NEW FILE: initcalls.c --- /* * initcalls.c: init and exit calls for diag * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: initcalls.c,v 1.1 2001/10/07 22:09:54 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: initcalls.c,v 1.1 2001/10/07 22:09:54 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/icache.h> #include <blob/led.h> #include <blob/serial.h> #include <blob/time.h> /* default serial initialisation */ static void serial_default_init(void) { SerialInit(baud9k6); } /* init calls */ __initlist(serial_default_init, INIT_LEVEL_INITIAL_HARDWARE); __initlist(enable_icache, INIT_LEVEL_INITIAL_HARDWARE); __initlist(led_on, INIT_LEVEL_INITIAL_HARDWARE); __initlist(TimerInit, INIT_LEVEL_OTHER_HARDWARE); /* exit calls */ __exitlist(disable_icache, INIT_LEVEL_INITIAL_HARDWARE); __exitlist(led_off, INIT_LEVEL_INITIAL_HARDWARE); --- NEW FILE: ld-script --- /*------------------------------------------------------------------------- * Filename: ld-script * Version: $Id: ld-script,v 1.1 2001/10/07 22:09:54 erikm Exp $ * Copyright: Copyright (C) 1999, Erik Mouw * Author: Erik Mouw <J.A...@it...> * Description: ld (linker) script to make diag. * Heavily inspired by the Linux kernel linker scripts. * Created at: Tue Aug 24 17:24:06 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sun Aug 29 14:45:54 1999 *-----------------------------------------------------------------------*/ /*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { . = 0xc0008000; . = ALIGN(4); .text : { *(.text) } . = ALIGN(4); .rodata : { *(.rodata) } . = ALIGN(4); .data : { *(.data) } . = ALIGN(4); .got : { *(.got) } . = ALIGN(4); .commandlist : { __commandlist_start = .; *(.commandlist) __commandlist_end = .; } . = ALIGN(4); .initlist : { __initlist_start = .; *(.initlist) __initlist_end = .; } . = ALIGN(4); .exitlist : { __exitlist_start = .; *(.exitlist) __exitlist_end = .; } /* the BSS section should be the last section */ . = ALIGN(4); .bss : { *(.bss) } } --- NEW FILE: main.c --- /* * main.c: main file for diag * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: main.c,v 1.1 2001/10/07 22:09:54 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: main.c,v 1.1 2001/10/07 22:09:54 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/command.h> #include <blob/error.h> #include <blob/init.h> #include <blob/serial.h> int main(void) { int numRead; char commandline[MAX_COMMANDLINE_LENGTH]; int retval; /* call subsystems */ init_subsystems(); SerialOutputString("\ndiag version " VERSION "\n" "Copyright (C) 2001 " "Stefan Eletzhofer and Erik Mouw\n"); SerialOutputString("diag comes with ABSOLUTELY NO WARRANTY; " "read the GNU GPL for details.\n"); SerialOutputString("This is free software, and you are welcome " "to redistribute it\n"); SerialOutputString("under certain conditions; " "read the GNU GPL for details.\n"); /* the command loop. endless, of course */ for(;;) { DisplayPrompt("diag> "); /* wait 10 minutes for a command */ numRead = GetCommand(commandline, MAX_COMMANDLINE_LENGTH, 600); if(numRead > 0) { if((retval = parse_command(commandline)) < 0 ) printerror(retval, NULL); } } return 0; } --- NEW FILE: start.S --- /* * start.S: diag start code * * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...) and * Jan-Derk Bakker (J.D...@it...) * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ .ident "$Id: start.S,v 1.1 2001/10/07 22:09:54 erikm Exp $" .text .globl _start _start: /* set up the stack pointer */ ldr r0, MEM_START add r1, r0, #(1024 * 1024) sub sp, r1, #0x04 loop: bl main /* if main ever returns we just call it again */ b loop /* main memory starts at 0xc0000000 */ MEM_START: .long 0xc0000000 Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/diag/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 2001/10/07 15:07:13 1.1 +++ Makefile.am 2001/10/07 22:09:54 1.2 @@ -0,0 +1,67 @@ +# -*- makefile -*- +# +# Makefile.am +# +# Copyright (C) 2001 Erik Mouw (J.A...@it...) +# +# $Id$ +# +# 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + +bin_PROGRAMS = \ + diag-elf32 \ + diag + + +INCLUDES += \ + -I${top_builddir}/include \ + -I${top_srcdir}/include + + +# WARNING: start.S *must* be the first file, otherwise the target will +# be linked in the wrong order! +diag_elf32_SOURCES = \ + start.S \ + commands.c \ + initcalls.c \ + main.c + + +diag_elf32_LDFLAGS += \ + -Wl,-T,${srcdir}/ld-script + + +diag_elf32_LDADD += \ + -L${top_builddir}/src/lib -lblob \ + -lgcc + + +diag_SOURCES = + + +diag: diag-elf32 + $(OBJCOPY) $(OCFLAGS) $< $@ + + +EXTRA_DIST = \ + ld-script + + +CLEANFILES = ${srcdir}/*~ + + +DISTCLEANFILES = ${builddir}/.deps/*.P |
From: Erik M. <er...@us...> - 2001-10-07 21:29:02
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv19756/include/blob Modified Files: errno.h Log Message: Add command abbreviation. Index: errno.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/errno.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- errno.h 2001/10/07 15:17:49 1.1 +++ errno.h 2001/10/07 21:28:57 1.2 @@ -38,5 +38,6 @@ #define ETIMEOUT 8 /* timeout exceeded */ #define ETOOSHORT 9 /* short file */ #define ETOOLONG 10 /* long file */ +#define EAMBIGCMD 11 /* ambiguous command */ #endif |
From: Erik M. <er...@us...> - 2001-10-07 21:29:02
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv19756/src/lib Modified Files: command.c error.c Log Message: Add command abbreviation. Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- command.c 2001/10/07 20:29:38 1.3 +++ command.c 2001/10/07 21:28:57 1.4 @@ -78,7 +78,7 @@ #define STATE_WHITESPACE (0) #define STATE_WORD (1) -void parse_args(char *cmdline, int *argc, char **argv) +static void parse_args(char *cmdline, int *argc, char **argv) { char *c; int state = STATE_WHITESPACE; @@ -136,10 +136,40 @@ +/* return the number of commands that match */ +static int get_num_command_matches(char *cmdline) +{ + commandlist_t *cmd; + int len; + int num_matches = 0; + + len = strlen(cmdline); + + for(cmd = commands; cmd != NULL; cmd = cmd->next) { + if(cmd->magic != COMMAND_MAGIC) { +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("Address = 0x"); + SerialOutputHex((u32)cmd); + SerialOutputString("!\n"); +#endif + return -EMAGIC; + } + + if(strncmp(cmd->name, cmdline, len) == 0) + num_matches++; + } + + return num_matches; +} + + + + int parse_command(char *cmdline) { commandlist_t *cmd; - int argc; + int argc, num_commands, len; char *argv[MAX_ARGS]; parse_args(cmdline, &argc, argv); @@ -148,6 +178,23 @@ if(argc == 0) return 0; + num_commands = get_num_command_matches(argv[0]); + + /* error */ + if(num_commands < 0) + return num_commands; + + /* no command matches */ + if(num_commands == 0) + return -ECOMMAND; + + /* ambiguous command */ + if(num_commands > 1) + return -EAMBIGCMD; + + len = strlen(argv[0]); + + /* single command, go for it */ for(cmd = commands; cmd != NULL; cmd = cmd->next) { if(cmd->magic != COMMAND_MAGIC) { #ifdef BLOB_DEBUG @@ -160,7 +207,7 @@ return -EMAGIC; } - if(strcmp(cmd->name, cmdline) == 0) { + if(strncmp(cmd->name, argv[0], len) == 0) { /* call function */ return cmd->callback(argc, argv); } Index: error.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/error.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- error.c 2001/10/07 19:34:17 1.2 +++ error.c 2001/10/07 21:28:57 1.3 @@ -51,6 +51,7 @@ { ETIMEOUT, "timeout exceeded" }, { ETOOSHORT, "short file" }, { ETOOLONG, "long file" }, + { EAMBIGCMD, "ambiguous command" }, }; |
From: Erik M. <er...@us...> - 2001-10-07 20:54:26
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv13865/src/lib Modified Files: terminal.c Log Message: Hack to get the "reset" command back. Index: terminal.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/terminal.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- terminal.c 2001/10/07 19:34:17 1.2 +++ terminal.c 2001/10/07 20:54:23 1.3 @@ -27,18 +27,16 @@ # include <blob/config.h> #endif -#include <blob/command.h> -#include <blob/main.h> #include <blob/serial.h> +#include <blob/terminal.h> -static int reset_terminal(int argc, char *argv[]) +int reset_terminal(int argc, char *argv[]) { int i; - SerialInit(blob_status.terminalSpeed); SerialOutputString(" c"); for(i = 0; i < 100; i++) SerialOutputByte('\n'); @@ -47,8 +45,3 @@ return 0; } - -static char resethelp[] = "reset\n" -"Reset terminal\n"; - -__commandlist(reset_terminal, "reset", resethelp); |
From: Erik M. <er...@us...> - 2001-10-07 20:54:26
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv13865/src/blob Modified Files: Makefile.am Added Files: commands.c Log Message: Hack to get the "reset" command back. --- NEW FILE: commands.c --- /* * commands.c: commands for blob * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: commands.c,v 1.1 2001/10/07 20:54:23 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: commands.c,v 1.1 2001/10/07 20:54:23 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/command.h> #include <blob/terminal.h> static char resethelp[] = "reset\n" "Reset terminal\n"; __commandlist(reset_terminal, "reset", resethelp); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 2001/10/07 20:16:57 1.4 +++ Makefile.am 2001/10/07 20:54:23 1.5 @@ -77,6 +77,7 @@ trampoline.S \ flashasm.S \ testmem2.S \ + commands.c \ flash.c \ initcalls.c \ linux.c \ |
From: Erik M. <er...@us...> - 2001-10-07 20:54:26
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv13865/include/blob Modified Files: Makefile.am Added Files: terminal.h Log Message: Hack to get the "reset" command back. --- NEW FILE: terminal.h --- /* * terminal.h: header file for terminal.c * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: terminal.h,v 1.1 2001/10/07 20:54:23 erikm Exp $ * * 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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: terminal.h,v 1.1 2001/10/07 20:54:23 erikm Exp $" #ifndef BLOB_TERMINAL_H #define BLOB_TERMINAL_H int reset_terminal(int argc, char *argv[]); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 2001/10/07 20:16:57 1.3 +++ Makefile.am 2001/10/07 20:54:23 1.4 @@ -26,6 +26,7 @@ param_block.h \ sa1100.h \ serial.h \ + terminal.h \ time.h \ types.h \ util.h \ |