search for: console_ansi_std

Displaying 10 results from an estimated 10 matches for "console_ansi_std".

2010 Mar 27
1
Syslinux-4/libutil: console_ansi_std()
Well, I decided to get ROSH back out and try to get it functioning in Syslinux-4. As has been my habit, I first recompiled the Linux binary and tried it out. In the beginning of ROSH, it calls console_ansi_std(). When I was working on this in the past, using this function ensured both the Linux and the Syslinux/COM32 binaries function similarly. When using fgets() to get an input string in the Linux binary, I noticed that hitting the "Enter" key had no results and therefore ROSH did not proce...
2008 Dec 09
1
COM32: console_ansi_raw() and later segfaults
...;m working on, I'm running into a slight snag. I'm trying to build a paging command (emulating the function of more). It seems get_key() is probably the best function to use for obtaining just a single key sequence. On my first run, I tried to call console_ansi_raw(), then get_key() then console_ansi_std() to change it back to a more normal mode. When I then attempt to use fgets() (in Linux, not syslinux/com32), it segfaults. I then decided to try just tweaking the two local flag bits, ICANON and ECHO and it works fine for Linux but now I'm going to have to write alternate code for the COM32...
2009 Feb 22
2
NEW: COM32 module to run another command, optionally clearing the screen
...[RUN_CMD_SZ]; /* Command string to execute */ int curpos; /* Current position in cmdstr; Use memcpy rather than strcat */ int arglen; /* length of current argument string */ int argst; /* Starting argument to listen to */ int i; /* Initialization */ curpos = 0; argst = 1; cmdstr[0] = 0; console_ansi_std(); DEBUG_PRINTF("\nMax Command line:%d\n", RUN_CMD_SZ); DEBUG_PRINTF("argc:%d\n\n", argc); if (strcmp(argv[1], "-c") == 0) { DEBUG_PRINTF("--Found '-c'\n"); argst++; for (i = 0; i < NUM_NL; i++) printf("\n"); } for (i = ar...
2010 Jun 27
1
[PATCH] ROSH: Upgraded
...console_ansi_raw(); /* Allows get_key to get just 1 key sequence - (w/o delay or display */ -// tcgetattr(0, &ntio); -// rosh_print_tc(&ntio); -} - -/* - * Switches back to standard getline mode. - */ -void rosh_console_std(void) -{ -// struct termios itio, ntio; - console_ansi_std(); -// tcsetattr(0, TCSANOW, &itio); -} - -/* * Attempts to get a single key from the console * returns key pressed */ @@ -257,37 +250,45 @@ int rosh_getkey(void) int inc; inc = KEY_NONE; -// rosh_console_raw(); - while (inc == KEY_NONE) { + while (inc == KEY_NO...
2009 Feb 15
2
COM32 module: Read-Only shell
...SAFLUSH, &ntio);*/ + console_ansi_raw(); /* Allows get_key to get just 1 key sequence + (w/o delay or display */ +// tcgetattr(0, &ntio); +// rosh_print_tc(&ntio); +} + +/* + * Switches back to standard getline mode. + */ +void rosh_console_std() +{ +// struct termios itio, ntio; + console_ansi_std(); +// tcsetattr(0, TCSANOW, &itio); +} + +/* + * Attempts to get a single key from the console + * returns key pressed + */ +int rosh_getkey() +{ + int inc; + + inc = KEY_NONE; +// rosh_console_raw(); + while (inc == KEY_NONE){ + inc = get_key(stdin, 6000); + } +// rosh_console_std(); + re...
2008 Jun 24
1
com32: \n to \r\n?
Hi, I wonder if CRLF conversion should be done in the com32 library. com32/modules is full of standard C printf("...\n") statements, which display OK on VGA but produce staircase effect over a serial connection. The core terminates each line with CRLF, which comes out OK in both cases. I patched mboot.c to make its output readable, and could do so with the other modules as well, but
2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...CSAFLUSH, &ntio);*/ console_ansi_raw(); /* Allows get_key to get just 1 key sequence (w/o delay or display */ -// tcgetattr(0, &ntio); -// rosh_print_tc(&ntio); } /* @@ -233,9 +252,7 @@ void rosh_console_raw() */ void rosh_console_std() { -// struct termios itio, ntio; console_ansi_std(); -// tcsetattr(0, TCSANOW, &itio); } /* @@ -247,11 +264,8 @@ int rosh_getkey() int inc; inc = KEY_NONE; -// rosh_console_raw(); - while (inc == KEY_NONE){ + while (inc == KEY_NONE) inc = get_key(stdin, 6000); - } -// rosh_console_std(); return inc; } /* rosh_getkey */ @@ -29...
2010 Mar 18
0
[MODULE] COM32 module to time null-dumping a file
...+ ec = times(&tm); + close(fd); + if (do_simple) + print_cp_result_simple(fn, bcnt, bc, ec); + else + print_cp_result(fn, bcnt, bc, ec); + } + return rv; +} /* int time_copy(char *fn, char do_simple) */ + +int main(int argc, char *argv[]) +{ + int i, st_arg = 1; + char do_simple = 0; + console_ansi_std(); + if (argc == 1) + printf("%s: Please specify a file\n", argv[0]); + if ((argc > 2) && (argv[1][0] == '-') && (argv[1][1] == 's') & (argv[1][2] == 0) ) + { + do_simple = 1; + st_arg = 2; + } + for (i=st_arg;i<argc;i++) + time_copy(argv[i],...
2010 Sep 16
1
[RFC] function to parse string to argc/argv pair
...ess the maximum length is met/exceeded. */ if (str[curpos - 1] == ' ') str[--curpos] = '\0'; return curpos; } /* rosh_argcat */ int main (int argc, char *argv[]) { char in[INS]; int inl; char *ret; int argc2; char **argv2; #ifdef __COM32__ console_ansi_std(); #endif inl = argcat(in, INS, argc, argv); printf(" %d: ", inl); puts(in); argc2 = parse_args1(&argv2, in); print_argv(argc2, argv2); free_args1(&argv2); puts(""); return 0; }
2010 Mar 20
1
[MODULE] COM32 module to time null-dumping a file, v1.1
...n, bcnt, bc, ec, bufsz); + else + print_cp_result(fn, bcnt, bc, ec, bufsz); + } + } + return rv; +} /* int time_copy(char *fn, char do_simple) */ + +int main(int argc, char *argv[]) +{ + int i; + char do_simple = 0; + int bufsz = min((BUFSZ_DEF), (BUFSZ_MAX)); + int tbufsz; + int numfl = 0; + console_ansi_std(); + for (i=1;i<argc;i++) + { + if (strcmp(argv[i], "-b") == 0) + { + i++; + if (i<argc) + { + tbufsz = atoi(argv[i]); + if (tbufsz > 0) + bufsz = min(max(BUFSZ_MIN, tbufsz), (BUFSZ_MAX)); + printf("Using bufsz %d\n", bufsz); + } + }else if (strc...