Changes in / [c1a5d8d:c3f95d8] in mainline


Ignore:
Files:
34 added
10 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified boot/Makefile.common

    rc1a5d8d rc3f95d8  
    9797        $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \
    9898        $(USPACE_PATH)/srv/fs/fat/fat \
     99        $(USPACE_PATH)/srv/fs/pipefs/pipefs \
     100        $(USPACE_PATH)/srv/fs/ext2fs/ext2fs \
    99101        $(USPACE_PATH)/srv/taskmon/taskmon \
    100102        $(USPACE_PATH)/srv/hw/netif/ne2000/ne2000 \
     
    124126
    125127RD_APPS_NON_ESSENTIAL = \
     128        $(USPACE_PATH)/app/blkdump/blkdump \
    126129        $(USPACE_PATH)/app/edit/edit \
     130        $(USPACE_PATH)/app/ext2info/ext2info \
    127131        $(USPACE_PATH)/app/kill/kill \
    128132        $(USPACE_PATH)/app/killall/killall \
  • TabularUnified uspace/Makefile

    rc1a5d8d rc3f95d8  
    3535DIRS = \
    3636        app/bdsh \
     37        app/blkdump \
    3738        app/edit \
     39        app/ext2info \
    3840        app/getterm \
    3941        app/init \
     
    7274        srv/fs/tmpfs \
    7375        srv/fs/devfs \
     76        srv/fs/pipefs \
     77        srv/fs/ext2fs \
    7478        srv/hid/adb_mouse \
    7579        srv/hid/char_mouse \
     
    148152        lib/drv \
    149153        lib/packet \
    150         lib/net
     154        lib/net \
     155        lib/ext2
    151156
    152157LIBC_BUILD = $(addsuffix .build,$(LIBC))
  • TabularUnified uspace/Makefile.common

    rc1a5d8d rc3f95d8  
    8686LIBCLUI_PREFIX = $(LIB_PREFIX)/clui
    8787
     88LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2
     89
    8890LIBDRV_PREFIX = $(LIB_PREFIX)/drv
    8991LIBPACKET_PREFIX = $(LIB_PREFIX)/packet
  • TabularUnified uspace/app/bdsh/cmds/modules/mount/mount.c

    rc1a5d8d rc3f95d8  
    5151{
    5252        static char helpfmt[] =
    53             "Usage:  %s <fstype> <mp> <dev> [<moptions>]\n";
     53            "Usage:  %s <fstype> <mp> [dev] [<moptions>]\n";
    5454        if (level == HELP_SHORT) {
    5555                printf("'%s' mounts a file system.\n", cmdname);
     
    6666        unsigned int argc;
    6767        const char *mopts = "";
     68        const char *dev = "";
    6869        int rc, c, opt_ind;
    6970
     
    7980        }
    8081
    81         if ((argc < 4) || (argc > 5)) {
     82        if ((argc < 3) || (argc > 5)) {
    8283                printf("%s: invalid number of arguments. Try `mount --help'\n",
    8384                    cmdname);
    8485                return CMD_FAILURE;
    8586        }
     87        if (argc > 3)
     88                dev = argv[3];
    8689        if (argc == 5)
    8790                mopts = argv[4];
    8891
    89         rc = mount(argv[1], argv[2], argv[3], mopts, 0);
     92        rc = mount(argv[1], argv[2], dev, mopts, 0);
    9093        if (rc != EOK) {
    9194                printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
  • TabularUnified uspace/app/redir/redir.c

    rc1a5d8d rc3f95d8  
    4949static void usage(void)
    5050{
    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",
    5252            NAME);
    5353}
     
    8383        args = (const char **) calloc(argc + 1, sizeof(char *));
    8484        if (!args) {
    85                 printf("No memory available\n");
     85                fprintf(stderr, "No memory available\n");
    8686                return 0;
    8787        }
     
    9898       
    9999        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],
    101101                    str_error(rc));
     102                return 0;
    102103        }
    103104       
  • TabularUnified uspace/app/tester/Makefile

    rc1a5d8d rc3f95d8  
    2929
    3030USPACE_PREFIX = ../..
     31LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBEXT2_PREFIX)/libext2.a
     32EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBEXT2_PREFIX)
    3133BINARY = tester
    3234
    3335SOURCES = \
    3436        tester.c \
     37        util.c \
    3538        thread/thread1.c \
    3639        print/print1.c \
     
    5053        mm/malloc1.c \
    5154        hw/misc/virtchar1.c \
    52         hw/serial/serial1.c
     55        hw/serial/serial1.c \
     56        libext2/libext2_1.c
    5357
    5458include $(USPACE_PREFIX)/Makefile.common
  • TabularUnified uspace/app/tester/tester.c

    rc1a5d8d rc3f95d8  
    6464#include "hw/serial/serial1.def"
    6565#include "hw/misc/virtchar1.def"
     66#include "libext2/libext2_1.def"
    6667        {NULL, NULL, NULL, false}
    6768};
  • TabularUnified uspace/app/tester/tester.h

    rc1a5d8d rc3f95d8  
    8080extern const char *test_serial1(void);
    8181extern const char *test_virtchar1(void);
     82extern const char *test_libext2_1(void);
    8283
    8384extern test_t tests[];
  • TabularUnified uspace/lib/block/libblock.c

    rc1a5d8d rc3f95d8  
    22 * Copyright (c) 2008 Jakub Jermar
    33 * Copyright (c) 2008 Martin Decky
     4 * Copyright (c) 2011 Martin Sucha
    45 * All rights reserved.
    56 *
     
    825826}
    826827
     828/** Read bytes directly from the device (bypass cache)
     829 *
     830 * @param devmap_handle Device handle of the block device.
     831 * @param abs_offset    Absolute offset in bytes where to start reading
     832 * @param bytes                 Number of bytes to read
     833 * @param data                  Buffer that receives the data
     834 *
     835 * @return              EOK on success or negative error code on failure.
     836 */
     837int block_read_bytes_direct(devmap_handle_t devmap_handle, aoff64_t abs_offset,
     838    size_t bytes, void *data)
     839{
     840        int rc;
     841        size_t phys_block_size;
     842        size_t buf_size;
     843        void *buffer;
     844        aoff64_t first_block;
     845        aoff64_t last_block;
     846        size_t blocks;
     847        size_t offset;
     848       
     849        rc = block_get_bsize(devmap_handle, &phys_block_size);
     850        if (rc != EOK) {
     851                return rc;
     852        }
     853       
     854        // calculate data position and required space
     855        first_block = abs_offset / phys_block_size;
     856        offset = abs_offset % phys_block_size;
     857        last_block = (abs_offset + bytes - 1) / phys_block_size;
     858        blocks = last_block - first_block + 1;
     859        buf_size = blocks * phys_block_size;
     860       
     861        // read the data into memory
     862        buffer = malloc(buf_size);
     863        if (buffer == NULL) {
     864                return ENOMEM;
     865        }
     866       
     867        rc = block_read_direct(devmap_handle, first_block, blocks, buffer);
     868        if (rc != EOK) {
     869                free(buffer);
     870                return rc;
     871        }
     872       
     873        // copy the data from the buffer
     874        memcpy(data, buffer + offset, bytes);
     875        free(buffer);
     876       
     877        return EOK;
     878}
     879
    827880/** Read blocks from block device.
    828881 *
  • TabularUnified uspace/lib/block/libblock.h

    rc1a5d8d rc3f95d8  
    22 * Copyright (c) 2008 Jakub Jermar
    33 * Copyright (c) 2008 Martin Decky
     4 * Copyright (c) 2011 Martin Sucha
    45 * All rights reserved.
    56 *
     
    113114extern int block_get_nblocks(devmap_handle_t, aoff64_t *);
    114115extern int block_read_direct(devmap_handle_t, aoff64_t, size_t, void *);
     116extern int block_read_bytes_direct(devmap_handle_t, aoff64_t, size_t, void *);
    115117extern int block_write_direct(devmap_handle_t, aoff64_t, size_t, const void *);
    116118
Note: See TracChangeset for help on using the changeset viewer.