Changes in / [5265eea4:77a194c] in mainline


Ignore:
Files:
48 added
26 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r5265eea4 r77a194c  
    3434uspace/app/dnsres/dnsres
    3535uspace/app/edit/edit
     36uspace/app/fdisk/fdisk
    3637uspace/app/fontviewer/fontviewer
    3738uspace/app/getterm/getterm
     
    9192uspace/dist/app/dnsres
    9293uspace/dist/app/edit
     94uspace/dist/app/fdisk
    9395uspace/dist/app/fontviewer
    9496uspace/dist/app/getterm
     
    181183uspace/dist/srv/fat
    182184uspace/dist/srv/file_bd
    183 uspace/dist/srv/g_part
    184185uspace/dist/srv/hound
    185186uspace/dist/srv/i8259
     
    189190uspace/dist/srv/locfs
    190191uspace/dist/srv/loopip
    191 uspace/dist/srv/mbr_part
    192192uspace/dist/srv/mfs
    193193uspace/dist/srv/output
     
    200200uspace/dist/srv/udf
    201201uspace/dist/srv/udp
     202uspace/dist/srv/vbd
     203uspace/dist/srv/volsrv
    202204uspace/dist/test/*
    203205uspace/drv/audio/hdaudio/hdaudio
     
    252254uspace/srv/audio/hound/hound
    253255uspace/srv/bd/file_bd/file_bd
    254 uspace/srv/bd/part/guid_part/g_part
    255 uspace/srv/bd/part/mbr_part/mbr_part
    256256uspace/srv/bd/rd/rd
    257257uspace/srv/bd/sata_bd/sata_bd
     258uspace/srv/bd/vbd/vbd
    258259uspace/srv/clipboard/clipboard
    259260uspace/srv/devman/devman
     
    290291uspace/srv/ns/ns
    291292uspace/srv/taskmon/taskmon
     293uspace/srv/volsrv/volsrv
    292294uspace/srv/vfs/vfs
    293295kernel/arch/ia32/_link.ld
     
    313315uspace/app/viewer/viewer
    314316uspace/dist/app/viewer
    315 uspace/app/hdisk/hdisk
    316 uspace/dist/app/hdisk
    317317uspace/app/untar/untar
    318318uspace/dist/app/untar
  • abi/include/abi/fourcc.h

    r5265eea4 r77a194c  
    3636#define ABI_FOURCC_H_
    3737
     38#include "../../../common.h"
     39
    3840#define FOURCC(a, b, c, d) \
    3941        (((UINT32_T) (a)) | (((UINT32_T) (b)) << 8) | \
  • abi/include/abi/ipc/interfaces.h

    r5265eea4 r77a194c  
    174174            FOURCC_COMPACT('m', 'o', 'u', 's') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK,
    175175        INTERFACE_KBD_CB =
    176             FOURCC_COMPACT('k', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK
     176            FOURCC_COMPACT('k', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK,
     177        INTERFACE_VOL =
     178            FOURCC_COMPACT('v', 'o', 'l', ' ') | IFACE_EXCHANGE_SERIALIZE,
     179        INTERFACE_VBD =
     180            FOURCC_COMPACT('v', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE
    177181} iface_t;
    178182
  • boot/Makefile.common

    r5265eea4 r77a194c  
    101101RD_SRVS_NON_ESSENTIAL = \
    102102        $(USPACE_PATH)/srv/bd/file_bd/file_bd \
    103         $(USPACE_PATH)/srv/bd/part/guid_part/g_part \
    104         $(USPACE_PATH)/srv/bd/part/mbr_part/mbr_part \
    105103        $(USPACE_PATH)/srv/bd/sata_bd/sata_bd \
     104        $(USPACE_PATH)/srv/bd/vbd/vbd \
    106105        $(USPACE_PATH)/srv/clipboard/clipboard \
    107106        $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \
     
    124123        $(USPACE_PATH)/srv/net/tcp/tcp \
    125124        $(USPACE_PATH)/srv/net/udp/udp \
    126         $(USPACE_PATH)/srv/taskmon/taskmon
     125        $(USPACE_PATH)/srv/taskmon/taskmon \
     126        $(USPACE_PATH)/srv/volsrv/volsrv
    127127
    128128RD_DRVS_ESSENTIAL = \
     
    182182        $(USPACE_PATH)/app/download/download \
    183183        $(USPACE_PATH)/app/edit/edit \
    184         $(USPACE_PATH)/app/hdisk/hdisk \
     184        $(USPACE_PATH)/app/fdisk/fdisk \
    185185        $(USPACE_PATH)/app/inet/inet \
    186186        $(USPACE_PATH)/app/kill/kill \
  • uspace/Makefile

    r5265eea4 r77a194c  
    4545        app/download \
    4646        app/edit \
     47        app/fdisk \
    4748        app/fontviewer \
    4849        app/getterm \
    49         app/hdisk \
    5050        app/init \
    5151        app/inet \
     
    112112        srv/bd/file_bd \
    113113        srv/bd/rd \
    114         srv/bd/part/guid_part \
    115         srv/bd/part/mbr_part \
     114        srv/bd/vbd \
    116115        srv/fs/exfat \
    117116        srv/fs/udf \
     
    122121        srv/fs/locfs \
    123122        srv/fs/ext4fs \
     123        srv/volsrv \
    124124        srv/hid/compositor \
    125125        srv/hid/console \
     
    217217        lib/crypto \
    218218        lib/clui \
     219        lib/fdisk \
    219220        lib/fmtutil \
    220221        lib/scsi \
     
    229230        lib/softrend \
    230231        lib/draw \
     232        lib/label \
    231233        lib/math \
    232234        lib/nettl \
     
    245247        lib/bithenge \
    246248        lib/posix \
    247         lib/mbr \
    248         lib/gpt \
    249249        lib/ieee80211
    250250
  • uspace/Makefile.common

    r5265eea4 r77a194c  
    122122LIBCRYPTO_PREFIX = $(LIB_PREFIX)/crypto
    123123LIBBLOCK_PREFIX = $(LIB_PREFIX)/block
     124LIBFDISK_PREFIX = $(LIB_PREFIX)/fdisk
     125LIBLABEL_PREFIX = $(LIB_PREFIX)/label
    124126LIBFS_PREFIX = $(LIB_PREFIX)/fs
    125127LIBCLUI_PREFIX = $(LIB_PREFIX)/clui
     
    155157LIBURI_PREFIX = $(LIB_PREFIX)/uri
    156158
    157 LIBMBR_PREFIX = $(LIB_PREFIX)/mbr
    158 LIBGPT_PREFIX = $(LIB_PREFIX)/gpt
    159159LIBNETTL_PREFIX = $(LIB_PREFIX)/nettl
    160160
  • uspace/app/init/init.c

    r5265eea4 r77a194c  
    337337        srv_start("/srv/s3c24xx_ts");
    338338       
     339        srv_start("/srv/vbd");
     340        srv_start("/srv/volsrv");
     341       
    339342        srv_start("/srv/loopip");
    340343        srv_start("/srv/ethip");
  • uspace/drv/block/ata_bd/main.c

    r5265eea4 r77a194c  
    199199
    200200        ddf_fun_add_to_category(fun, "bd");
     201        ddf_fun_add_to_category(fun, "disk");
    201202
    202203        free(fun_name);
  • uspace/lib/block/block.c

    r5265eea4 r77a194c  
    788788}
    789789
     790/** Synchronize blocks to persistent storage.
     791 *
     792 * @param service_id    Service ID of the block device.
     793 * @param ba            Address of first block (physical).
     794 * @param cnt           Number of blocks.
     795 *
     796 * @return              EOK on success or negative error code on failure.
     797 */
     798int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
     799{
     800        devcon_t *devcon;
     801
     802        devcon = devcon_search(service_id);
     803        assert(devcon);
     804
     805        return bd_sync_cache(devcon->bd, ba, cnt);
     806}
     807
    790808/** Get device block size.
    791809 *
  • uspace/lib/block/block.h

    r5265eea4 r77a194c  
    120120extern int block_read_bytes_direct(service_id_t, aoff64_t, size_t, void *);
    121121extern int block_write_direct(service_id_t, aoff64_t, size_t, const void *);
     122extern int block_sync_cache(service_id_t, aoff64_t, size_t);
    122123
    123124#endif
  • uspace/lib/c/Makefile

    r5265eea4 r77a194c  
    9595        generic/task.c \
    9696        generic/futex.c \
     97        generic/imath.c \
    9798        generic/inet/addr.c \
    9899        generic/inet/endpoint.c \
     
    152153        generic/stats.c \
    153154        generic/assert.c \
    154         generic/pio_trace.c
     155        generic/pio_trace.c \
     156        generic/uuid.c \
     157        generic/vbd.c \
     158        generic/vol.c
    155159
    156160ifeq ($(CONFIG_RTLD),y)
  • uspace/lib/c/generic/str.c

    r5265eea4 r77a194c  
    519519        wchar_t c1 = 0;
    520520        wchar_t c2 = 0;
    521        
     521
    522522        size_t off1 = 0;
    523523        size_t off2 = 0;
     
    529529                if (c1 < c2)
    530530                        return -1;
    531                
     531
    532532                if (c1 > c2)
    533533                        return 1;
    534534
    535535                if (c1 == 0 || c2 == 0)
    536                         break;         
     536                        break;
    537537        }
    538538
     
    566566        wchar_t c1 = 0;
    567567        wchar_t c2 = 0;
    568        
     568
    569569        size_t off1 = 0;
    570570        size_t off2 = 0;
    571        
     571
    572572        size_t len = 0;
    573573
     
    578578                c1 = str_decode(s1, &off1, STR_NO_LIMIT);
    579579                c2 = str_decode(s2, &off2, STR_NO_LIMIT);
     580
     581                if (c1 < c2)
     582                        return -1;
     583
     584                if (c1 > c2)
     585                        return 1;
     586
     587                if (c1 == 0 || c2 == 0)
     588                        break;
     589
     590                ++len;
     591        }
     592
     593        return 0;
     594
     595}
     596
     597/** Compare two NULL terminated strings in case-insensitive manner.
     598 *
     599 * Do a char-by-char comparison of two NULL-terminated strings.
     600 * The strings are considered equal iff their length is equal
     601 * and both strings consist of the same sequence of characters
     602 * when converted to lower case.
     603 *
     604 * A string S1 is less than another string S2 if it has a character with
     605 * lower value at the first character position where the strings differ.
     606 * If the strings differ in length, the shorter one is treated as if
     607 * padded by characters with a value of zero.
     608 *
     609 * @param s1 First string to compare.
     610 * @param s2 Second string to compare.
     611 *
     612 * @return 0 if the strings are equal, -1 if the first is less than the second,
     613 *         1 if the second is less than the first.
     614 *
     615 */
     616int str_casecmp(const char *s1, const char *s2)
     617{
     618        wchar_t c1 = 0;
     619        wchar_t c2 = 0;
     620
     621        size_t off1 = 0;
     622        size_t off2 = 0;
     623
     624        while (true) {
     625                c1 = tolower(str_decode(s1, &off1, STR_NO_LIMIT));
     626                c2 = tolower(str_decode(s2, &off2, STR_NO_LIMIT));
     627
     628                if (c1 < c2)
     629                        return -1;
     630
     631                if (c1 > c2)
     632                        return 1;
     633
     634                if (c1 == 0 || c2 == 0)
     635                        break;
     636        }
     637
     638        return 0;
     639}
     640
     641/** Compare two NULL terminated strings with length limit in case-insensitive
     642 * manner.
     643 *
     644 * Do a char-by-char comparison of two NULL-terminated strings.
     645 * The strings are considered equal iff
     646 * min(str_length(s1), max_len) == min(str_length(s2), max_len)
     647 * and both strings consist of the same sequence of characters,
     648 * up to max_len characters.
     649 *
     650 * A string S1 is less than another string S2 if it has a character with
     651 * lower value at the first character position where the strings differ.
     652 * If the strings differ in length, the shorter one is treated as if
     653 * padded by characters with a value of zero. Only the first max_len
     654 * characters are considered.
     655 *
     656 * @param s1      First string to compare.
     657 * @param s2      Second string to compare.
     658 * @param max_len Maximum number of characters to consider.
     659 *
     660 * @return 0 if the strings are equal, -1 if the first is less than the second,
     661 *         1 if the second is less than the first.
     662 *
     663 */
     664int str_lcasecmp(const char *s1, const char *s2, size_t max_len)
     665{
     666        wchar_t c1 = 0;
     667        wchar_t c2 = 0;
     668       
     669        size_t off1 = 0;
     670        size_t off2 = 0;
     671       
     672        size_t len = 0;
     673
     674        while (true) {
     675                if (len >= max_len)
     676                        break;
     677
     678                c1 = tolower(str_decode(s1, &off1, STR_NO_LIMIT));
     679                c2 = tolower(str_decode(s2, &off2, STR_NO_LIMIT));
    580680
    581681                if (c1 < c2)
  • uspace/lib/c/include/ipc/services.h

    r5265eea4 r77a194c  
    5959#define SERVICE_NAME_UDP      "net/udp"
    6060#define SERVICE_NAME_TCP      "net/tcp"
     61#define SERVICE_NAME_VBD      "vbd"
     62#define SERVICE_NAME_VOLSRV   "volsrv"
    6163
    6264#endif
  • uspace/lib/c/include/str.h

    r5265eea4 r77a194c  
    8282extern int str_cmp(const char *s1, const char *s2);
    8383extern int str_lcmp(const char *s1, const char *s2, size_t max_len);
     84extern int str_casecmp(const char *s1, const char *s2);
     85extern int str_lcasecmp(const char *s1, const char *s2, size_t max_len);
    8486
    8587extern bool str_test_prefix(const char *s, const char *p);
  • uspace/lib/clui/Makefile

    r5265eea4 r77a194c  
    3232
    3333SOURCES = \
     34        nchoice.c \
    3435        tinput.c
    3536
  • uspace/lib/clui/tinput.c

    r5265eea4 r77a194c  
    457457}
    458458
    459 static void tinput_set_str(tinput_t *ti, char *str)
     459static void tinput_set_str(tinput_t *ti, const char *str)
    460460{
    461461        str_to_wstr(ti->buffer, INPUT_MAX_SIZE, str);
     
    853853}
    854854
    855 /** Read in one line of input.
    856  *
    857  * @param ti   Text input.
    858  * @param dstr Place to save pointer to new string.
     855/** Read in one line of input with initial text provided.
     856 *
     857 * @param ti   Text input
     858 * @param istr Initial string
     859 * @param dstr Place to save pointer to new string
    859860 *
    860861 * @return EOK on success
     
    863864 *
    864865 */
    865 int tinput_read(tinput_t *ti, char **dstr)
     866int tinput_read_i(tinput_t *ti, const char *istr, char **dstr)
    866867{
    867868        console_flush(ti->console);
     
    869870                return EIO;
    870871       
    871         ti->pos = 0;
     872        tinput_set_str(ti, istr);
     873
    872874        ti->sel_start = 0;
    873         ti->nc = 0;
    874         ti->buffer[0] = '\0';
    875875        ti->done = false;
    876876        ti->exit_clui = false;
     
    916916}
    917917
     918/** Read in one line of input.
     919 *
     920 * @param ti   Text input
     921 * @param dstr Place to save pointer to new string.
     922 *
     923 * @return EOK on success
     924 * @return ENOENT if user requested abort
     925 * @return EIO if communication with console failed
     926 *
     927 */
     928int tinput_read(tinput_t *ti, char **dstr)
     929{
     930        return tinput_read_i(ti, "", dstr);
     931}
     932
    918933static void tinput_key_ctrl(tinput_t *ti, kbd_event_t *ev)
    919934{
  • uspace/lib/clui/tinput.h

    r5265eea4 r77a194c  
    159159extern void tinput_destroy(tinput_t *);
    160160extern int tinput_read(tinput_t *, char **);
     161extern int tinput_read_i(tinput_t *, const char *, char **);
    161162
    162163#endif
  • uspace/srv/locsrv/locsrv.c

    r5265eea4 r77a194c  
    13171317        categ_dir_add_cat(&cdir, cat);
    13181318
     1319        cat = category_new("disk");
     1320        categ_dir_add_cat(&cdir, cat);
     1321
     1322        cat = category_new("partition");
     1323        categ_dir_add_cat(&cdir, cat);
     1324
    13191325        cat = category_new("iplink");
    13201326        categ_dir_add_cat(&cdir, cat);
Note: See TracChangeset for help on using the changeset viewer.