Changes in / [664af708:f483a15] in mainline
- Files:
-
- 27 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
r664af708 rf483a15 97 97 $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \ 98 98 $(USPACE_PATH)/srv/fs/fat/fat \ 99 $(USPACE_PATH)/srv/fs/pipefs/pipefs \ 100 $(USPACE_PATH)/srv/fs/ext2/ext2 \ 99 101 $(USPACE_PATH)/srv/taskmon/taskmon \ 100 102 $(USPACE_PATH)/srv/hw/netif/ne2000/ne2000 \ … … 124 126 125 127 RD_APPS_NON_ESSENTIAL = \ 128 $(USPACE_PATH)/app/blkdump/blkdump \ 126 129 $(USPACE_PATH)/app/edit/edit \ 130 $(USPACE_PATH)/app/ext2info/ext2info \ 127 131 $(USPACE_PATH)/app/kill/kill \ 128 132 $(USPACE_PATH)/app/killall/killall \ -
uspace/Makefile
r664af708 rf483a15 35 35 DIRS = \ 36 36 app/bdsh \ 37 app/blkdump \ 37 38 app/edit \ 39 app/ext2info \ 38 40 app/getterm \ 39 41 app/init \ … … 72 74 srv/fs/tmpfs \ 73 75 srv/fs/devfs \ 76 srv/fs/pipefs \ 77 srv/fs/ext2 \ 74 78 srv/hid/adb_mouse \ 75 79 srv/hid/char_mouse \ … … 148 152 lib/drv \ 149 153 lib/packet \ 150 lib/net 154 lib/net \ 155 lib/ext2 151 156 152 157 LIBC_BUILD = $(addsuffix .build,$(LIBC)) -
uspace/Makefile.common
r664af708 rf483a15 86 86 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 87 87 88 LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2 89 88 90 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 89 91 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet -
uspace/app/bdsh/cmds/modules/mount/mount.c
r664af708 rf483a15 44 44 { 45 45 static char helpfmt[] = 46 "Usage: %s <fstype> <mp> <dev>[<moptions>]\n";46 "Usage: %s <fstype> <mp> [dev] [<moptions>]\n"; 47 47 if (level == HELP_SHORT) { 48 48 printf("'%s' mounts a file system.\n", cmdname); … … 59 59 unsigned int argc; 60 60 const char *mopts = ""; 61 const char *dev = ""; 61 62 int rc; 62 63 63 64 argc = cli_count_args(argv); 64 65 65 if ((argc < 4) || (argc > 5)) {66 if ((argc < 3) || (argc > 5)) { 66 67 printf("%s: invalid number of arguments.\n", 67 68 cmdname); 68 69 return CMD_FAILURE; 69 70 } 71 if (argc > 3) 72 dev = argv[3]; 70 73 if (argc == 5) 71 74 mopts = argv[4]; 72 75 73 rc = mount(argv[1], argv[2], argv[3], mopts, 0);76 rc = mount(argv[1], argv[2], dev, mopts, 0); 74 77 if (rc != EOK) { 75 78 printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n", -
uspace/app/redir/redir.c
r664af708 rf483a15 49 49 static void usage(void) 50 50 { 51 printf("Usage: %s [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n",51 fprintf(stderr, "Usage: %s [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n", 52 52 NAME); 53 53 } … … 83 83 args = (const char **) calloc(argc + 1, sizeof(char *)); 84 84 if (!args) { 85 printf("No memory available\n");85 fprintf(stderr, "No memory available\n"); 86 86 return 0; 87 87 } … … 98 98 99 99 if (rc != EOK) { 100 printf("%s: Error spawning %s (%s)\n", NAME, argv[0],100 fprintf(stderr, "%s: Error spawning %s (%s)\n", NAME, argv[0], 101 101 str_error(rc)); 102 return 0; 102 103 } 103 104 -
uspace/lib/block/libblock.c
r664af708 rf483a15 2 2 * Copyright (c) 2008 Jakub Jermar 3 3 * Copyright (c) 2008 Martin Decky 4 * Copyright (c) 2011 Martin Sucha 4 5 * All rights reserved. 5 6 * … … 810 811 } 811 812 813 /** Read bytes directly from the device (bypass cache) 814 * 815 * @param devmap_handle Device handle of the block device. 816 * @param abs_offset Absolute offset in bytes where to start reading 817 * @param bytes Number of bytes to read 818 * @param data Buffer that receives the data 819 * 820 * @return EOK on success or negative error code on failure. 821 */ 822 int block_read_bytes_direct(devmap_handle_t devmap_handle, aoff64_t abs_offset, 823 size_t bytes, void *data) 824 { 825 int rc; 826 size_t phys_block_size; 827 size_t buf_size; 828 void *buffer; 829 aoff64_t first_block; 830 aoff64_t last_block; 831 size_t blocks; 832 size_t offset; 833 834 rc = block_get_bsize(devmap_handle, &phys_block_size); 835 if (rc != EOK) { 836 return rc; 837 } 838 839 // calculate data position and required space 840 first_block = abs_offset / phys_block_size; 841 offset = abs_offset % phys_block_size; 842 last_block = (abs_offset + bytes - 1) / phys_block_size; 843 blocks = last_block - first_block + 1; 844 buf_size = blocks * phys_block_size; 845 846 // read the data into memory 847 buffer = malloc(buf_size); 848 if (buffer == NULL) { 849 return ENOMEM; 850 } 851 852 rc = block_read_direct(devmap_handle, first_block, blocks, buffer); 853 if (rc != EOK) { 854 free(buffer); 855 return rc; 856 } 857 858 // copy the data from the buffer 859 memcpy(data, buffer + offset, bytes); 860 free(buffer); 861 862 return EOK; 863 } 864 812 865 /** Read blocks from block device. 813 866 * -
uspace/lib/block/libblock.h
r664af708 rf483a15 2 2 * Copyright (c) 2008 Jakub Jermar 3 3 * Copyright (c) 2008 Martin Decky 4 * Copyright (c) 2011 Martin Sucha 4 5 * All rights reserved. 5 6 * … … 113 114 extern int block_get_nblocks(devmap_handle_t, aoff64_t *); 114 115 extern int block_read_direct(devmap_handle_t, aoff64_t, size_t, void *); 116 extern int block_read_bytes_direct(devmap_handle_t, aoff64_t, size_t, void *); 115 117 extern int block_write_direct(devmap_handle_t, aoff64_t, size_t, const void *); 116 118
Note:
See TracChangeset
for help on using the changeset viewer.