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: Erik M. <er...@us...> - 2001-10-07 15:17:51
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv16987 Modified Files: Makefile.am Removed Files: command.h errno.h error.h flash.h init.h led.h linux.h main.h memory.h memsetup.h param_block.h sa1100.h serial.h time.h types.h util.h uucodec.h Log Message: Move header files and adjust Makefiles Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile.am 2001/10/05 12:11:46 1.8 +++ Makefile.am 2001/10/07 15:17:49 1.9 @@ -11,26 +11,8 @@ ########################################################################### -noinst_HEADERS = \ - command.h \ - command_hist.h \ - errno.h \ - error.h \ - flash.h \ - init.h \ - led.h \ - linux.h \ - main.h \ - memory.h \ - memsetup.h \ - param_block.h \ - registers.h \ - sa1100.h \ - serial.h \ - time.h \ - types.h \ - util.h \ - uucodec.h +SUBDIRS = \ + blob CLEANFILES = *~ --- command.h DELETED --- --- errno.h DELETED --- --- error.h DELETED --- --- flash.h DELETED --- --- init.h DELETED --- --- led.h DELETED --- --- linux.h DELETED --- --- main.h DELETED --- --- memory.h DELETED --- --- memsetup.h DELETED --- --- param_block.h DELETED --- --- sa1100.h DELETED --- --- serial.h DELETED --- --- time.h DELETED --- --- types.h DELETED --- --- util.h DELETED --- --- uucodec.h DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 15:07:17
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv15221/src/diag Added Files: Makefile.am Log Message: commit empty Makefiles --- NEW FILE Makefile.am --- |
From: Erik M. <er...@us...> - 2001-10-07 15:07:17
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv15221/src/lib Added Files: Makefile.am Log Message: commit empty Makefiles --- NEW FILE Makefile.am --- |
From: Erik M. <er...@us...> - 2001-10-07 15:07:17
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv15221/src/blob Added Files: Makefile.am Log Message: commit empty Makefiles --- NEW FILE Makefile.am --- |
From: Erik M. <er...@us...> - 2001-10-07 15:07:17
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv15221/include/blob Added Files: Makefile.am Log Message: commit empty Makefiles --- NEW FILE Makefile.am --- |
From: Erik M. <er...@us...> - 2001-10-07 14:53:07
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv12505 Modified Files: memsetup-sa1110.S Log Message: remove call to LED blinker Index: memsetup-sa1110.S =================================================================== RCS file: /cvsroot/blob/blob/src/memsetup-sa1110.S,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- memsetup-sa1110.S 2001/10/04 16:26:50 1.4 +++ memsetup-sa1110.S 2001/10/07 14:53:04 1.5 @@ -173,7 +173,4 @@ ldr r2, [r1, #MCS2 ] str r2, [r0, #MCS2 ] - mov r2, #3 - bl led_blink - mov pc, r5 |
From: Erik M. <er...@us...> - 2001-10-07 14:51:50
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv12297 Modified Files: start.S ledasm.S Log Message: cleanup LED blinker all faults now let the LED blink Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- start.S 2001/10/04 16:37:06 1.6 +++ start.S 2001/10/07 14:51:46 1.7 @@ -111,7 +111,6 @@ /* setup memory */ bl memsetup - /* check if this is a wake-up from sleep */ ldr r0, RST_BASE ldr r1, [r0, #RCSR] @@ -203,33 +202,31 @@ badram: - b blinky + mov r6, #2 + b endless_blink - - -blinky: - /* This is test code to blink the LED - very useful if nothing else works */ - bl led_on - bl wait_loop - bl led_off - bl wait_loop - b blinky -wait_loop: +endless_blink: + bl wait + mov r0, r6 + bl led_blink + b endless_blink + +wait: /* busy wait loop*/ - mov r2, #0x1000000 -wait_loop1: - subs r2, r2, #1 - bne wait_loop1 + mov r5, #0x1000000 +wait0: + subs r5, r5, #1 + bne wait0 mov pc, lr undefined_instruction: - b blinky + mov r6, #3 + b endless_blink @@ -240,34 +237,42 @@ * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT * simply because blob is not angel. -- Erik */ - b blinky + mov r6, #4 + b endless_blink + prefetch_abort: - b blinky + mov r6, #5 + b endless_blink data_abort: - b blinky + mov r6, #6 + b endless_blink not_used: - b blinky + /* we *should* never reach this */ + mov r6, #7 + b endless_blink irq: - b blinky + mov r6, #8 + b endless_blink fiq: - b blinky + mov r6, #9 + b endless_blink Index: ledasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/ledasm.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ledasm.S 2001/10/04 12:17:37 1.3 +++ ledasm.S 2001/10/07 14:51:46 1.4 @@ -74,39 +74,43 @@ .globl led_off - /* turn LED off. clobbers r0 and r1 */ + /* turn LED off. clobbers r0 - r2 */ led_off: ldr r0, GPIO_BASE ldr r1, LED str r1, [r0, #GPCR] mov pc, lr -.globl led_blink - /* blinks LED r2 times. clobbers r0 and r1, changes r2 */ -led_blink: -loop0: - /* led off */ - ldr r0, GPIO_BASE - ldr r1, LED - str r1, [r0, #GPSR] - mov r0, #0x20000 -wloop1: - subs r0, r0, #1 - bne wloop1 + /* busy wait loop. clobbers r0 */ +wait_loop: + mov r0, #0x400000 +wait_loop1: + subs r0, r0, #1 + bne wait_loop1 + mov pc, lr - /* led on */ - ldr r0, GPIO_BASE - ldr r1, LED - str r1, [r0, #GPCR] + +blinky: + /* blink LED. clobbers r0 and r1 */ + mov r2, lr + bl led_off + bl wait_loop + bl led_on + bl wait_loop + mov pc, r2 - mov r0, #0x20000 -wloop2: - subs r0, r0, #1 - bne wloop2 - subs r2, r2, #1 - bne loop0 +.globl led_blink + /* blinks LED r0 times */ + /* clobbers r0 - r4 */ +led_blink: + mov r4, lr + mov r3, r0 - mov pc, lr +blink0: + bl blinky + subs r3, r3, #1 + bne blink0 + mov pc, r4 |
From: Erik M. <er...@us...> - 2001-10-06 12:49:57
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv26347/lib Log Message: Directory /cvsroot/blob/blob/src/lib added to the repository |
From: Erik M. <er...@us...> - 2001-10-06 12:49:57
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv26347/diag Log Message: Directory /cvsroot/blob/blob/src/diag added to the repository |
From: Erik M. <er...@us...> - 2001-10-06 12:49:57
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv26347/blob Log Message: Directory /cvsroot/blob/blob/src/blob added to the repository |
From: Erik M. <er...@us...> - 2001-10-06 12:49:29
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv26294/blob Log Message: Directory /cvsroot/blob/blob/include/blob added to the repository |
From: Erik M. <J.A...@IT...> - 2001-10-05 14:17:52
|
On Fri, Oct 05, 2001 at 02:37:41PM +0200, Stefan Eletzhofer wrote: > well, ok then. From your comments I assume that I'll have to put this code > under a #ifdef and make it a compile-time option. No, I'd rather have it removed completely. It doesn't belong in a boot loader which main goal was to be simple. > Please do understand my arguments, tough: > - blob is a bootloader, yes. Most of the time only loads the kernel in a > specified (quick) way, nothing else. Say 99.99% of all cases. > - when one gets a defective board from a customer, blob _could_ be used > as a diagnosis tool as well. I do not want to have first a special > blob version flashed, because then i'd have to change the system in > order to check it. I want to test the board as it is, right then when > i get it. I could even instruct a technican via phone, specially > useful when the board is somewhere in brazil and a machine does not > work because of your board not running (which ist exactly what will > happen, think of murphy's law). This is where a diagnostics tool comes in handy. Make a standalone diagnostics tool that can be downloaded with "download kernel". Now type "boot", and voila, you're running the diagnostics tool. > - a command line history is rather handy if you have to issue > several commands in a row and misspelled one - blob commands are simple. "download krnl" can be easily retyped as "download kernel". - Several commands in a row almost never happens and if it happens it doesn't justify a command line history. The longest command sequence I know is "download kernel ; flash kernel ; download ramdisk ; flash ramdisk" but that is scriptable as Wookey showed before. > - that's why i keep adding test/diagnosis commands, because i _know_ > i will need exactly these commands later for customer support, > because i need them _now_ to get our new board running. OK, what about this: 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? Erik -- 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: <sch...@t-...> - 2001-10-05 12:59:01
|
Hi all, well, ok then. From your comments I assume that I'll have to put this code under a #ifdef and make it a compile-time option. Please do understand my arguments, tough: - blob is a bootloader, yes. Most of the time only loads the kernel in a specified (quick) way, nothing else. - when one gets a defective board from a customer, blob _could_ be used as a diagnosis tool as well. I do not want to have first a special blob version flashed, because then i'd have to change the system in order to check it. I want to test the board as it is, right then when i get it. I could even instruct a technican via phone, specially useful when the board is somewhere in brazil and a machine does not work because of your board not running (which ist exactly what will happen, think of murphy's law). - a command line history is rather handy if you have to issue several commands in a row and misspelled one - that's why i keep adding test/diagnosis commands, because i _know_ i will need exactly these commands later for customer support, because i need them _now_ to get our new board running. Does this sound reasonable, or am i completly wrong? Stefan |
From: Abraham vd M. <ab...@2d...> - 2001-10-05 12:30:53
|
Hi J.D.! > >> Update of /cvsroot/blob/blob/src > >> In directory usw-pr-cvs1:/tmp/cvs-serv24606 > >> > >> Modified Files: > >> command_hist.c > >> Log Message: > >> - simple command line history > > > >Why would we need this at all? Blob is a bootloader, not a shell. >=20 > Seconded. What *would* be useful, though, is either auto-completion=20 > or command abbreviation. I don't think it should be removed though. As long as there's a configure option not to compile this in. In that case, those who want a stripped down bootloader can have one and rest in peace that there's no bloated code and those who wants a bells & whistles boot loader can also have one (: --=20 Regards Abraham When the speaker and he to whom he is speaks do not understand, that is metaphysics. -- Voltaire __________________________________________________________ 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: J.D. B. <ba...@th...> - 2001-10-05 12:21:00
|
At 14:13 +0200 05-10-2001, Erik Mouw wrote: >On Fri, Oct 05, 2001 at 04:53:48AM -0700, Stefan Eletzhofer wrote: >> Update of /cvsroot/blob/blob/src >> In directory usw-pr-cvs1:/tmp/cvs-serv24606 >> >> Modified Files: >> command_hist.c >> Log Message: >> - simple command line history > >Why would we need this at all? Blob is a bootloader, not a shell. Seconded. What *would* be useful, though, is either auto-completion or command abbreviation. JDB. -- LART. 250 MIPS under one Watt. Free hardware design files. http://www.lart.tudelft.nl/ |
From: Erik M. <J.A...@IT...> - 2001-10-05 12:13:28
|
On Fri, Oct 05, 2001 at 04:53:48AM -0700, Stefan Eletzhofer wrote: > Update of /cvsroot/blob/blob/src > In directory usw-pr-cvs1:/tmp/cvs-serv24606 > > Modified Files: > command_hist.c > Log Message: > - simple command line history Why would we need this at all? Blob is a bootloader, not a shell. You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away. -- Antoine de Saint-Exupery Erik -- 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: Stefan E. <se...@us...> - 2001-10-05 12:11:49
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv1348 Modified Files: Makefile.am Log Message: - added header file for command line history module Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile.am 2001/10/04 16:28:40 1.7 +++ Makefile.am 2001/10/05 12:11:46 1.8 @@ -13,6 +13,7 @@ noinst_HEADERS = \ command.h \ + command_hist.h \ errno.h \ error.h \ flash.h \ |
From: Stefan E. <se...@us...> - 2001-10-05 12:09:37
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv32673 Modified Files: Makefile.am Log Message: - added command line history module Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Makefile.am 2001/10/04 14:49:08 1.11 +++ Makefile.am 2001/10/05 12:09:35 1.12 @@ -59,6 +59,7 @@ flashasm.S \ testmem2.S \ command.c \ + command_hist.c \ error.c \ flash.c \ help.c \ |
From: Stefan E. <se...@us...> - 2001-10-05 12:07:29
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv31277 Modified Files: command.c Log Message: - added calls for command line history Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/command.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- command.c 2001/10/03 16:09:09 1.9 +++ command.c 2001/10/05 12:07:27 1.10 @@ -36,6 +36,7 @@ #endif #include "command.h" +#include "command_hist.h" #include "errno.h" #include "init.h" #include "serial.h" @@ -48,7 +49,6 @@ extern u32 __commandlist_end; - /* the first command */ commandlist_t *commands; @@ -193,11 +193,13 @@ 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)) { @@ -208,6 +210,7 @@ (timeout * TICKS_PER_SECOND)) { /* timeout */ command[i++] = '\0'; + cmdhist_push( command ); return(numRead); } } @@ -217,6 +220,7 @@ /* print newline */ SerialOutputByte('\n'); + cmdhist_push( command ); return(numRead); } else if(c == '\b') { /* FIXME: is this backspace? */ if(i > 0) { @@ -225,6 +229,36 @@ /* 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++; @@ -234,5 +268,7 @@ } } + cmdhist_push( command ); return(numRead); } + |
From: Stefan E. <se...@us...> - 2001-10-05 12:05:53
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv30855 Modified Files: command_hist.h Log Message: - added define for up/down key Index: command_hist.h =================================================================== RCS file: /cvsroot/blob/blob/include/command_hist.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- command_hist.h 2001/10/05 11:51:52 1.2 +++ command_hist.h 2001/10/05 12:05:50 1.3 @@ -29,6 +29,9 @@ #ifndef INC_COMMAND_HIST_H #define INC_COMMAND_HIST_H 1 +#define CMDHIST_KEY_UP '\025' // ^U +#define CMDHIST_KEY_DN '\004' // ^D + int cmdhist_init( void ); int cmdhist_push( char *cmd ); int cmdhist_next( char **cmd ); |
From: Stefan E. <se...@us...> - 2001-10-05 11:53:49
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv24606 Modified Files: command_hist.c Log Message: - simple command line history Index: command_hist.c =================================================================== RCS file: /cvsroot/blob/blob/src/command_hist.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- command_hist.c 2001/10/05 11:48:11 1.1 +++ command_hist.c 2001/10/05 11:53:46 1.2 @@ -0,0 +1,260 @@ +/********************************************************************** + * 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$" + +/********************************************************************** + * Includes + */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "command.h" +#include "errno.h" +#include "init.h" +#include "serial.h" +#include "time.h" +#include "types.h" +#include "util.h" + +/********************************************************************** + * Defines / Makros + */ + +#define CMDHIST_DEBUG 0 + +#define MAX_HIST 32 + +/********************************************************************** + * Programmglobale Variable + */ + +/********************************************************************** + * Modulglobale Variable + */ + +static int is_initialized = 0; +static int cmdhist_entries = 0; +static int cmdhist_read = 0; +static int cmdhist_write = 0; +static char cmdhistory[MAX_HIST][MAX_COMMANDLINE_LENGTH]; + + +/********************************************************************** + * Prototypen + */ + +/********************************************************************** + * Exportierte Funktionen + */ + +/********************************************************************* + * cmdhist_init + * + * AUTOR: SELETZ + * REVISED: + * + * Initializes this module + * + */ +int cmdhist_init( void ) +{ + int i; + + cmdhist_read = 0; + cmdhist_write = 0; + cmdhist_entries = 0; + + i=MAX_HIST - 1; + while ( i-- ) { + cmdhistory[i][0]=0; + } + + is_initialized = 1; + return 0; +} + + +/********************************************************************* + * cmd_push + * + * AUTOR: SELETZ + * REVISED: + * + * Push a command to the history buffer + * + */ +int cmdhist_push( char *cmd ) +{ + if ( !is_initialized ) { + cmdhist_init(); + } + + 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 ( !is_initialized ) { + cmdhist_init(); + } + + 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 ( !is_initialized ) { + cmdhist_init(); + } + + 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; +} + +/********************************************************************** + * Statische Funktionen + */ |
From: Stefan E. <se...@us...> - 2001-10-05 11:51:55
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv24043 Modified Files: command_hist.h Log Message: - command line history functions Index: command_hist.h =================================================================== RCS file: /cvsroot/blob/blob/include/command_hist.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- command_hist.h 2001/10/05 11:49:29 1.1 +++ command_hist.h 2001/10/05 11:51:52 1.2 @@ -0,0 +1,38 @@ +/********************************************************************** + * 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$" + +#ifndef INC_COMMAND_HIST_H +#define INC_COMMAND_HIST_H 1 + +int cmdhist_init( void ); +int cmdhist_push( char *cmd ); +int cmdhist_next( char **cmd ); +int cmdhist_prev( char **cmd ); +int cmdhist_reset( void ); + +#endif |
From: Stefan E. <se...@us...> - 2001-10-05 11:49:33
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv22540 Added Files: command_hist.h Log Message: - new file: header file for command line history --- NEW FILE command_hist.h --- |
From: Stefan E. <se...@us...> - 2001-10-05 11:48:14
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv21537 Added Files: command_hist.c Log Message: - new file: will add command line history via ^U and ^D keys --- NEW FILE command_hist.c --- |
From: Stefan E. <se...@us...> - 2001-10-04 16:37:10
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv28648 Modified Files: start.S Log Message: - added clock speed setting for pt system 3 platform Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/start.S,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- start.S 2001/10/04 16:26:50 1.5 +++ start.S 2001/10/04 16:37:06 1.6 @@ -81,6 +81,8 @@ cpuspeed: .long 0x0a /* 206.4 MHz */ #elif defined SHANNON cpuspeed: .long 0x09 /* 191.7 MHz */ +#elif defined PT_SYSTEM3 +cpuspeed: .long 0x05 /* 133 MHz for now */ #else #warning "FIXME: Include code to use the correct clock speed for your board" cpuspeed: .long 0x05 /* safe 133 MHz speed */ |