Changeset 925a21e in mainline for uspace/app/bdsh/cmds
- Timestamp:
- 2011-09-24T14:20:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bf76c1
- Parents:
- 867e2555 (diff), 1ab4aca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/app/bdsh/cmds
- Files:
-
- 4 added
- 6 edited
-
builtins/batch/batch.c (added)
-
builtins/batch/batch.h (added)
-
builtins/batch/batch_def.h (added)
-
builtins/batch/entry.h (added)
-
builtins/builtins.h (modified) (1 diff)
-
modules/bdd/bdd.c (modified) (8 diffs)
-
modules/cat/cat.c (modified) (1 diff)
-
modules/help/help.c (modified) (3 diffs)
-
modules/mount/mount.c (modified) (3 diffs)
-
modules/rm/rm.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/builtins/builtins.h
r867e2555 r925a21e 4 4 #include "config.h" 5 5 6 #include "batch/entry.h" 6 7 #include "cd/entry.h" 7 8 #include "exit/entry.h" 8 9 9 10 builtin_t builtins[] = { 11 #include "batch/batch_def.h" 10 12 #include "cd/cd_def.h" 11 13 #include "exit/exit_def.h" -
uspace/app/bdsh/cmds/modules/bdd/bdd.c
r867e2555 r925a21e 39 39 40 40 #include <libblock.h> 41 #include < devmap.h>41 #include <loc.h> 42 42 #include <errno.h> 43 43 #include <assert.h> … … 69 69 unsigned int argc; 70 70 unsigned int i, j; 71 devmap_handle_t handle;71 service_id_t service_id; 72 72 aoff64_t offset; 73 73 uint8_t *blk; … … 96 96 size = 256; 97 97 98 rc = devmap_device_get_handle(argv[1], &handle, 0);98 rc = loc_service_get_id(argv[1], &service_id, 0); 99 99 if (rc != EOK) { 100 100 printf("%s: Error resolving device `%s'.\n", cmdname, argv[1]); … … 102 102 } 103 103 104 rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);104 rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048); 105 105 if (rc != EOK) { 106 106 printf("%s: Error initializing libblock.\n", cmdname); … … 108 108 } 109 109 110 rc = block_get_bsize( handle, &block_size);110 rc = block_get_bsize(service_id, &block_size); 111 111 if (rc != EOK) { 112 112 printf("%s: Error determining device block size.\n", cmdname); … … 117 117 if (blk == NULL) { 118 118 printf("%s: Error allocating memory.\n", cmdname); 119 block_fini( handle);119 block_fini(service_id); 120 120 return CMD_FAILURE; 121 121 } … … 124 124 125 125 while (size > 0) { 126 rc = block_read_direct( handle, ba, 1, blk);126 rc = block_read_direct(service_id, ba, 1, blk); 127 127 if (rc != EOK) { 128 128 printf("%s: Error reading block %" PRIuOFF64 "\n", cmdname, ba); 129 129 free(blk); 130 block_fini( handle);130 block_fini(service_id); 131 131 return CMD_FAILURE; 132 132 } … … 170 170 171 171 free(blk); 172 block_fini( handle);172 block_fini(service_id); 173 173 174 174 return CMD_SUCCESS; -
uspace/app/bdsh/cmds/modules/cat/cat.c
r867e2555 r925a21e 103 103 { 104 104 console_set_pos(console, 0, console_rows-1); 105 console_set_color(console, COLOR_ BLUE, COLOR_WHITE, 0);105 console_set_color(console, COLOR_WHITE, COLOR_BLUE, 0); 106 106 107 107 printf("ENTER/SPACE/PAGE DOWN - next page, " -
uspace/app/bdsh/cmds/modules/help/help.c
r867e2555 r925a21e 1 1 /* 2 2 * Copyright (c) 2008 Tim Post 3 * Copyright (c) 2011 Martin Sucha 3 4 * All rights reserved. 4 5 * … … 30 31 #include <stdlib.h> 31 32 #include <str.h> 33 #include <fmtutil.h> 32 34 33 35 #include "config.h" … … 128 130 static void help_survival(void) 129 131 { 130 printf("Don't panic!\n\n"); 131 132 printf("This is Bdsh, the Brain dead shell, currently " 132 print_wrapped_console( 133 "Don't panic!\n\n" 134 135 "This is Bdsh, the Brain dead shell, currently " 133 136 "the primary user interface to HelenOS. Bdsh allows you to enter " 134 137 "commands and supports history (Up, Down arrow keys), " 135 138 "line editing (Left Arrow, Right Arrow, Home, End, Backspace), " 136 139 "selection (Shift + movement keys), copy and paste (Ctrl-C, " 137 "Ctrl-V), similar to common desktop environments.\n\n" );138 139 printf("The most basic filesystem commands are Bdsh builtins. Type "140 "Ctrl-V), similar to common desktop environments.\n\n" 141 142 "The most basic filesystem commands are Bdsh builtins. Type " 140 143 "'help commands' [Enter] to see the list of Bdsh builtin commands. " 141 144 "Other commands are external executables located in the /app and " 142 145 "/srv directories. Type 'ls /app' [Enter] and 'ls /srv' [Enter] " 143 146 "to see their list. You can execute an external command simply " 144 "by entering its name (e.g. type 'tetris' [Enter]).\n\n" );145 146 printf("HelenOS has virtual consoles (VCs). You can switch between "147 "these using the F1-F11 keys.\n\n" );148 149 printf("This is but a small glimpse of what you can do with HelenOS. "147 "by entering its name (e.g. type 'tetris' [Enter]).\n\n" 148 149 "HelenOS has virtual consoles (VCs). You can switch between " 150 "these using the F1-F11 keys.\n\n" 151 152 "This is but a small glimpse of what you can do with HelenOS. " 150 153 "To learn more please point your browser to the HelenOS User's " 151 "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n"); 154 "Guide: http://trac.helenos.org/wiki/UsersGuide\n\n", 155 ALIGN_LEFT); 152 156 } 153 157 -
uspace/app/bdsh/cmds/modules/mount/mount.c
r867e2555 r925a21e 43 43 static struct option const long_options[] = { 44 44 { "help", no_argument, 0, 'h' }, 45 { "instance", required_argument, 0, 'i' }, 45 46 { 0, 0, 0, 0 } 46 47 }; … … 68 69 const char *dev = ""; 69 70 int rc, c, opt_ind; 71 unsigned int instance = 0; 72 bool instance_set = false; 73 char **t_argv; 70 74 71 75 argc = cli_count_args(argv); 72 76 73 77 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 74 c = getopt_long(argc, argv, " h", long_options, &opt_ind);78 c = getopt_long(argc, argv, "i:h", long_options, &opt_ind); 75 79 switch (c) { 76 80 case 'h': 77 81 help_cmd_mount(HELP_LONG); 78 82 return CMD_SUCCESS; 83 case 'i': 84 instance = (unsigned int) strtol(optarg, NULL, 10); 85 instance_set = true; 86 break; 79 87 } 80 88 } 89 90 if (instance_set) { 91 argc -= 2; 92 t_argv = &argv[2]; 93 } else 94 t_argv = &argv[0]; 81 95 82 96 if ((argc < 3) || (argc > 5)) { … … 86 100 } 87 101 if (argc > 3) 88 dev = argv[3];102 dev = t_argv[3]; 89 103 if (argc == 5) 90 mopts = argv[4];104 mopts = t_argv[4]; 91 105 92 rc = mount( argv[1], argv[2], dev, mopts, 0);106 rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance); 93 107 if (rc != EOK) { 94 108 printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n", 95 argv[1], argv[2],argv[3], rc);109 t_argv[1], t_argv[2], t_argv[3], rc); 96 110 return CMD_FAILURE; 97 111 } -
uspace/app/bdsh/cmds/modules/rm/rm.c
r867e2555 r925a21e 95 95 if (NULL != rm->cwd) 96 96 free(rm->cwd); 97 98 return;99 97 } 100 98 … … 129 127 } 130 128 } 129 130 closedir(dirp); 131 131 132 132 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.
