Changeset 77a194c in mainline
- Timestamp:
- 2015-11-04T18:55:46Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44183b98
- Parents:
- 5265eea4 (diff), bfcde8d (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. - Files:
-
- 35 added
- 13 deleted
- 18 edited
- 13 moved
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r5265eea4 r77a194c 34 34 uspace/app/dnsres/dnsres 35 35 uspace/app/edit/edit 36 uspace/app/fdisk/fdisk 36 37 uspace/app/fontviewer/fontviewer 37 38 uspace/app/getterm/getterm … … 91 92 uspace/dist/app/dnsres 92 93 uspace/dist/app/edit 94 uspace/dist/app/fdisk 93 95 uspace/dist/app/fontviewer 94 96 uspace/dist/app/getterm … … 181 183 uspace/dist/srv/fat 182 184 uspace/dist/srv/file_bd 183 uspace/dist/srv/g_part184 185 uspace/dist/srv/hound 185 186 uspace/dist/srv/i8259 … … 189 190 uspace/dist/srv/locfs 190 191 uspace/dist/srv/loopip 191 uspace/dist/srv/mbr_part192 192 uspace/dist/srv/mfs 193 193 uspace/dist/srv/output … … 200 200 uspace/dist/srv/udf 201 201 uspace/dist/srv/udp 202 uspace/dist/srv/vbd 203 uspace/dist/srv/volsrv 202 204 uspace/dist/test/* 203 205 uspace/drv/audio/hdaudio/hdaudio … … 252 254 uspace/srv/audio/hound/hound 253 255 uspace/srv/bd/file_bd/file_bd 254 uspace/srv/bd/part/guid_part/g_part255 uspace/srv/bd/part/mbr_part/mbr_part256 256 uspace/srv/bd/rd/rd 257 257 uspace/srv/bd/sata_bd/sata_bd 258 uspace/srv/bd/vbd/vbd 258 259 uspace/srv/clipboard/clipboard 259 260 uspace/srv/devman/devman … … 290 291 uspace/srv/ns/ns 291 292 uspace/srv/taskmon/taskmon 293 uspace/srv/volsrv/volsrv 292 294 uspace/srv/vfs/vfs 293 295 kernel/arch/ia32/_link.ld … … 313 315 uspace/app/viewer/viewer 314 316 uspace/dist/app/viewer 315 uspace/app/hdisk/hdisk316 uspace/dist/app/hdisk317 317 uspace/app/untar/untar 318 318 uspace/dist/app/untar -
abi/include/abi/fourcc.h
r5265eea4 r77a194c 36 36 #define ABI_FOURCC_H_ 37 37 38 #include "../../../common.h" 39 38 40 #define FOURCC(a, b, c, d) \ 39 41 (((UINT32_T) (a)) | (((UINT32_T) (b)) << 8) | \ -
abi/include/abi/ipc/interfaces.h
r5265eea4 r77a194c 174 174 FOURCC_COMPACT('m', 'o', 'u', 's') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK, 175 175 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 177 181 } iface_t; 178 182 -
boot/Makefile.common
r5265eea4 r77a194c 101 101 RD_SRVS_NON_ESSENTIAL = \ 102 102 $(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 \105 103 $(USPACE_PATH)/srv/bd/sata_bd/sata_bd \ 104 $(USPACE_PATH)/srv/bd/vbd/vbd \ 106 105 $(USPACE_PATH)/srv/clipboard/clipboard \ 107 106 $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \ … … 124 123 $(USPACE_PATH)/srv/net/tcp/tcp \ 125 124 $(USPACE_PATH)/srv/net/udp/udp \ 126 $(USPACE_PATH)/srv/taskmon/taskmon 125 $(USPACE_PATH)/srv/taskmon/taskmon \ 126 $(USPACE_PATH)/srv/volsrv/volsrv 127 127 128 128 RD_DRVS_ESSENTIAL = \ … … 182 182 $(USPACE_PATH)/app/download/download \ 183 183 $(USPACE_PATH)/app/edit/edit \ 184 $(USPACE_PATH)/app/ hdisk/hdisk \184 $(USPACE_PATH)/app/fdisk/fdisk \ 185 185 $(USPACE_PATH)/app/inet/inet \ 186 186 $(USPACE_PATH)/app/kill/kill \ -
uspace/Makefile
r5265eea4 r77a194c 45 45 app/download \ 46 46 app/edit \ 47 app/fdisk \ 47 48 app/fontviewer \ 48 49 app/getterm \ 49 app/hdisk \50 50 app/init \ 51 51 app/inet \ … … 112 112 srv/bd/file_bd \ 113 113 srv/bd/rd \ 114 srv/bd/part/guid_part \ 115 srv/bd/part/mbr_part \ 114 srv/bd/vbd \ 116 115 srv/fs/exfat \ 117 116 srv/fs/udf \ … … 122 121 srv/fs/locfs \ 123 122 srv/fs/ext4fs \ 123 srv/volsrv \ 124 124 srv/hid/compositor \ 125 125 srv/hid/console \ … … 217 217 lib/crypto \ 218 218 lib/clui \ 219 lib/fdisk \ 219 220 lib/fmtutil \ 220 221 lib/scsi \ … … 229 230 lib/softrend \ 230 231 lib/draw \ 232 lib/label \ 231 233 lib/math \ 232 234 lib/nettl \ … … 245 247 lib/bithenge \ 246 248 lib/posix \ 247 lib/mbr \248 lib/gpt \249 249 lib/ieee80211 250 250 -
uspace/Makefile.common
r5265eea4 r77a194c 122 122 LIBCRYPTO_PREFIX = $(LIB_PREFIX)/crypto 123 123 LIBBLOCK_PREFIX = $(LIB_PREFIX)/block 124 LIBFDISK_PREFIX = $(LIB_PREFIX)/fdisk 125 LIBLABEL_PREFIX = $(LIB_PREFIX)/label 124 126 LIBFS_PREFIX = $(LIB_PREFIX)/fs 125 127 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui … … 155 157 LIBURI_PREFIX = $(LIB_PREFIX)/uri 156 158 157 LIBMBR_PREFIX = $(LIB_PREFIX)/mbr158 LIBGPT_PREFIX = $(LIB_PREFIX)/gpt159 159 LIBNETTL_PREFIX = $(LIB_PREFIX)/nettl 160 160 -
uspace/app/init/init.c
r5265eea4 r77a194c 337 337 srv_start("/srv/s3c24xx_ts"); 338 338 339 srv_start("/srv/vbd"); 340 srv_start("/srv/volsrv"); 341 339 342 srv_start("/srv/loopip"); 340 343 srv_start("/srv/ethip"); -
uspace/drv/block/ata_bd/main.c
r5265eea4 r77a194c 199 199 200 200 ddf_fun_add_to_category(fun, "bd"); 201 ddf_fun_add_to_category(fun, "disk"); 201 202 202 203 free(fun_name); -
uspace/lib/block/block.c
r5265eea4 r77a194c 788 788 } 789 789 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 */ 798 int 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 790 808 /** Get device block size. 791 809 * -
uspace/lib/block/block.h
r5265eea4 r77a194c 120 120 extern int block_read_bytes_direct(service_id_t, aoff64_t, size_t, void *); 121 121 extern int block_write_direct(service_id_t, aoff64_t, size_t, const void *); 122 extern int block_sync_cache(service_id_t, aoff64_t, size_t); 122 123 123 124 #endif -
uspace/lib/c/Makefile
r5265eea4 r77a194c 95 95 generic/task.c \ 96 96 generic/futex.c \ 97 generic/imath.c \ 97 98 generic/inet/addr.c \ 98 99 generic/inet/endpoint.c \ … … 152 153 generic/stats.c \ 153 154 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 155 159 156 160 ifeq ($(CONFIG_RTLD),y) -
uspace/lib/c/generic/str.c
r5265eea4 r77a194c 519 519 wchar_t c1 = 0; 520 520 wchar_t c2 = 0; 521 521 522 522 size_t off1 = 0; 523 523 size_t off2 = 0; … … 529 529 if (c1 < c2) 530 530 return -1; 531 531 532 532 if (c1 > c2) 533 533 return 1; 534 534 535 535 if (c1 == 0 || c2 == 0) 536 break; 536 break; 537 537 } 538 538 … … 566 566 wchar_t c1 = 0; 567 567 wchar_t c2 = 0; 568 568 569 569 size_t off1 = 0; 570 570 size_t off2 = 0; 571 571 572 572 size_t len = 0; 573 573 … … 578 578 c1 = str_decode(s1, &off1, STR_NO_LIMIT); 579 579 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 */ 616 int 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 */ 664 int 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)); 580 680 581 681 if (c1 < c2) -
uspace/lib/c/include/imath.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @brief Integer math functions 33 34 */ 34 35 35 #ifndef __INPUT_H__36 #define __INPUT_H__36 #ifndef LIBC_IMATH_H_ 37 #define LIBC_IMATH_H_ 37 38 38 #include < tinput.h>39 #include <stdint.h> 39 40 40 extern int get_input_line(tinput_t *, char **); 41 extern uint8_t get_input_uint8(tinput_t *); 42 extern uint32_t get_input_uint32(tinput_t *); 43 extern uint64_t get_input_uint64(tinput_t *); 44 extern size_t get_input_size_t(tinput_t *); 41 extern int ipow10_u64(unsigned, uint64_t *); 42 extern unsigned ilog10_u64(uint64_t); 45 43 46 44 #endif 45 46 /** 47 * @} 48 */ -
uspace/lib/c/include/ipc/services.h
r5265eea4 r77a194c 59 59 #define SERVICE_NAME_UDP "net/udp" 60 60 #define SERVICE_NAME_TCP "net/tcp" 61 #define SERVICE_NAME_VBD "vbd" 62 #define SERVICE_NAME_VOLSRV "volsrv" 61 63 62 64 #endif -
uspace/lib/c/include/str.h
r5265eea4 r77a194c 82 82 extern int str_cmp(const char *s1, const char *s2); 83 83 extern int str_lcmp(const char *s1, const char *s2, size_t max_len); 84 extern int str_casecmp(const char *s1, const char *s2); 85 extern int str_lcasecmp(const char *s1, const char *s2, size_t max_len); 84 86 85 87 extern bool str_test_prefix(const char *s, const char *p); -
uspace/lib/c/include/types/vol.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __COMMON_H__36 #define __COMMON_H__35 #ifndef LIBC_TYPES_VOL_H_ 36 #define LIBC_TYPES_VOL_H_ 37 37 38 #include <libmbr.h> 39 #include <libgpt.h> 38 #include <async.h> 40 39 41 40 typedef enum { 42 LYT_NONE, 43 LYT_MBR, 44 LYT_GPT, 45 } layouts_t; 41 /** Partition is empty */ 42 vpc_empty, 43 /** Partition contains a recognized filesystem */ 44 vpc_fs, 45 /** Partition contains unrecognized data */ 46 vpc_unknown 47 } vol_part_cnt_t; 46 48 47 typedef union { 48 mbr_label_t *mbr; 49 gpt_label_t *gpt; 50 } label_data_t; 49 /** File system type */ 50 typedef enum { 51 fs_exfat, 52 fs_fat, 53 fs_minix, 54 fs_ext4 55 } vol_fstype_t; 51 56 52 typedef struct label { 53 layouts_t layout; 54 aoff64_t blocks; 55 service_id_t device; 56 label_data_t data; 57 unsigned int alignment; 58 int (* destroy_label)(struct label *); 59 int (* add_part)(struct label *, tinput_t *); 60 int (* delete_part)(struct label *, tinput_t *); 61 int (* new_label)(struct label *); 62 int (* print_parts)(struct label *); 63 int (* read_parts)(struct label *); 64 int (* write_parts)(struct label *); 65 int (* extra_funcs)(struct label *, tinput_t *); 66 } label_t; 57 #define VOL_FSTYPE_LIMIT (fs_ext4 + 1) 58 #define VOL_FSTYPE_DEFAULT fs_minix 59 60 /** Volume service */ 61 typedef struct vol { 62 /** Volume service session */ 63 async_sess_t *sess; 64 } vol_t; 65 66 /** Partition information */ 67 typedef struct { 68 /** Partition content type */ 69 vol_part_cnt_t pcnt; 70 /** Filesystem type */ 71 vol_fstype_t fstype; 72 } vol_part_info_t; 67 73 68 74 #endif 75 76 /** @} 77 */ -
uspace/lib/c/include/vol.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __FUNC_NONE_H__36 #define __FUNC_NONE_H__35 #ifndef LIBC_VOL_H_ 36 #define LIBC_VOL_H_ 37 37 38 #include <async.h> 38 39 #include <loc.h> 39 #include <tinput.h> 40 #include "common.h" 40 #include <stdint.h> 41 #include <types/label.h> 42 #include <types/vol.h> 41 43 42 extern int construct_none_label(label_t *); 43 extern int add_none_part(label_t *, tinput_t *); 44 extern int delete_none_part(label_t *, tinput_t *); 45 extern int destroy_none_label(label_t *); 46 extern int new_none_label(label_t *); 47 extern int print_none_parts(label_t *); 48 extern int read_none_parts(label_t *); 49 extern int write_none_parts(label_t *); 50 extern int extra_none_funcs(label_t *, tinput_t *); 44 extern int vol_create(vol_t **); 45 extern void vol_destroy(vol_t *); 46 extern int vol_get_parts(vol_t *, service_id_t **, size_t *); 47 extern int vol_part_add(vol_t *, service_id_t); 48 extern int vol_part_info(vol_t *, service_id_t, vol_part_info_t *); 49 extern int vol_part_empty(vol_t *, service_id_t); 50 extern int vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t); 51 51 52 52 #endif 53 54 /** @} 55 */ -
uspace/lib/clui/Makefile
r5265eea4 r77a194c 32 32 33 33 SOURCES = \ 34 nchoice.c \ 34 35 tinput.c 35 36 -
uspace/lib/clui/nchoice.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 2009 Jiri Svoboda 3 * Copyright (c) 2011-2013 Dominik Taborsky 2 * Copyright (c) 2015 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup lib gpt29 /** @addtogroup libclui 31 30 * @{ 32 31 */ 33 /** @file 32 /** 33 * @file Numerical choice 34 34 */ 35 35 36 #ifndef LIBGPT_GPT_H_ 37 #define LIBGPT_GPT_H_ 36 #ifndef LIBCLUI_NCHOICE_H_ 37 #define LIBCLUI_NCHOICE_H_ 38 39 #include <adt/list.h> 40 #include <tinput.h> 38 41 39 42 typedef enum { 40 AT_REQ_PART = 0, 41 AT_NO_BLOCK_IO, 42 AT_LEGACY_BOOT, 43 AT_UNDEFINED, 44 AT_SPECIFIC = 48 45 } gpt_attr_t; 43 /** This is the default option */ 44 ncf_default = 1 45 } nchoice_flag_t; 46 46 47 /** GPT header */48 47 typedef struct { 49 uint8_t efi_signature[8]; 50 uint8_t revision[4]; 51 uint32_t header_size; 52 uint32_t header_crc32; 53 uint32_t reserved; 54 uint64_t current_lba; 55 uint64_t alternate_lba; 56 uint64_t first_usable_lba; 57 uint64_t last_usable_lba; 58 uint8_t disk_guid[16]; 59 uint64_t entry_lba; 60 uint32_t fillries; 61 uint32_t entry_size; 62 uint32_t pe_array_crc32; 63 } __attribute__((packed)) gpt_header_t; 48 /** Link to nchoice_t.opts */ 49 link_t lchoice; 50 /** Option text */ 51 char *text; 52 /** User argument */ 53 void *arg; 54 } nchoice_opt_t; 64 55 65 /** GPT partition entry */66 56 typedef struct { 67 uint8_t part_type[16]; 68 uint8_t part_id[16]; 69 uint64_t start_lba; 70 uint64_t end_lba; 71 uint64_t attributes; 72 uint8_t part_name[72]; 73 } __attribute__((packed)) gpt_entry_t; 57 /** Prompt text */ 58 char *prompt; 59 /** Options */ 60 list_t opts; /* of nchoice_opt_t */ 61 /** Text input */ 62 tinput_t *tinput; 63 /** Default option */ 64 nchoice_opt_t *def_opt; 65 } nchoice_t; 66 67 extern int nchoice_create(nchoice_t **); 68 extern void nchoice_destroy(nchoice_t *); 69 extern int nchoice_set_prompt(nchoice_t *, const char *); 70 extern int nchoice_add(nchoice_t *, const char *, void *, nchoice_flag_t); 71 extern int nchoice_get(nchoice_t *, void **); 74 72 75 73 #endif 74 75 /** @} 76 */ -
uspace/lib/clui/tinput.c
r5265eea4 r77a194c 457 457 } 458 458 459 static void tinput_set_str(tinput_t *ti, c har *str)459 static void tinput_set_str(tinput_t *ti, const char *str) 460 460 { 461 461 str_to_wstr(ti->buffer, INPUT_MAX_SIZE, str); … … 853 853 } 854 854 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 859 860 * 860 861 * @return EOK on success … … 863 864 * 864 865 */ 865 int tinput_read (tinput_t *ti, char **dstr)866 int tinput_read_i(tinput_t *ti, const char *istr, char **dstr) 866 867 { 867 868 console_flush(ti->console); … … 869 870 return EIO; 870 871 871 ti->pos = 0; 872 tinput_set_str(ti, istr); 873 872 874 ti->sel_start = 0; 873 ti->nc = 0;874 ti->buffer[0] = '\0';875 875 ti->done = false; 876 876 ti->exit_clui = false; … … 916 916 } 917 917 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 */ 928 int tinput_read(tinput_t *ti, char **dstr) 929 { 930 return tinput_read_i(ti, "", dstr); 931 } 932 918 933 static void tinput_key_ctrl(tinput_t *ti, kbd_event_t *ev) 919 934 { -
uspace/lib/clui/tinput.h
r5265eea4 r77a194c 159 159 extern void tinput_destroy(tinput_t *); 160 160 extern int tinput_read(tinput_t *, char **); 161 extern int tinput_read_i(tinput_t *, const char *, char **); 161 162 162 163 #endif -
uspace/lib/fdisk/Makefile
r5265eea4 r77a194c 1 1 # 2 # Copyright (c) 201 1 Dominik Taborsky2 # Copyright (c) 2015 Jiri Svoboda 3 3 # All rights reserved. 4 4 # … … 28 28 29 29 USPACE_PREFIX = ../.. 30 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) 31 LIBRARY = libmbr 30 EXTRA_CFLAGS = -Iinclude -I$(LIBBLOCK_PREFIX) 31 32 LIBRARY = libfdisk 32 33 33 34 SOURCES = \ 34 libmbr.c 35 src/cap.c \ 36 src/fdisk.c 35 37 36 38 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/label/Makefile
r5265eea4 r77a194c 1 1 # 2 # Copyright (c) 201 1 Dominik Taborsky2 # Copyright (c) 2015 Jiri Svoboda 3 3 # All rights reserved. 4 4 # … … 28 28 29 29 USPACE_PREFIX = ../.. 30 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBMBR_PREFIX) 31 LIBRARY = libgpt 30 EXTRA_CFLAGS = -Iinclude -I$(LIBBLOCK_PREFIX) 31 32 LIBRARY = liblabel 32 33 33 34 SOURCES = \ 34 libgpt.c \ 35 global.c 35 src/dummy.c \ 36 src/mbr.c \ 37 src/gpt.c \ 38 src/label.c 36 39 37 40 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/label/include/std/gpt.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 20 09Jiri Svoboda2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef __GPT_H__36 #define __GPT_H__35 #ifndef LIBLABEL_STD_GPT_H_ 36 #define LIBLABEL_STD_GPT_H_ 37 37 38 38 #include <sys/types.h> 39 39 40 /** Block address of GPT header. */ 41 #define GPT_HDR_BA 1 40 enum { 41 /** Block address of primary GPT header. */ 42 gpt_hdr_ba = 1, 43 44 /** Minimum size of partition table in bytes, required by std. */ 45 gpt_ptable_min_size = 16384, 46 47 /** GPT revision */ 48 gpt_revision = 0x00010000 49 }; 42 50 43 51 /** GPT header */ … … 69 77 } __attribute__((packed)) gpt_entry_t; 70 78 79 /** Microsoft Basic Data Partition */ 80 #define GPT_MS_BASIC_DATA "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" 81 /** Linux Filesystem Data */ 82 #define GPT_LINUX_FS_DATA "0FC63DAF-8483-4772-8E79-3D69D8477DE4" 83 /** I could not find any definition of Minix GUID partition type. 84 * This is a randomly generated UUID */ 85 #define GPT_MINIX_FAKE "8308e350-4e2d-46c7-8e3b-24b07e8ac674" 86 71 87 #endif 72 88 -
uspace/lib/label/include/std/mbr.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 2009 Jiri Svoboda 3 * Copyright (c) 2011-2013 Dominik Taborsky 2 * Copyright (c) 2015 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup libmbr 29 /** @addtogroup bd 31 30 * @{ 32 31 */ … … 34 33 */ 35 34 36 #ifndef LIB MBR_MBR_H_37 #define LIB MBR_MBR_H_35 #ifndef LIBLABEL_STD_MBR_H_ 36 #define LIBLABEL_STD_MBR_H_ 38 37 39 #include <s ys/types.h>38 #include <stdint.h> 40 39 41 40 enum { 41 /** Block address of Master Boot Record. */ 42 mbr_ba = 0, 43 44 /** First block allowed for allocation */ 45 mbr_ablock0 = 18, 46 42 47 /** Number of primary partition records */ 43 N_PRIMARY= 4,44 48 mbr_nprimary = 4, 49 45 50 /** Boot record signature */ 46 BR_SIGNATURE = 0xAA55 51 mbr_br_signature = 0xAA55, 52 53 /** EBR PTE slot describing partition corresponding to this EBR */ 54 mbr_ebr_pte_this = 0, 55 /** EBR PTE slot describing the next EBR */ 56 mbr_ebr_pte_next = 1 47 57 }; 48 58 49 enum { 50 /** Non-bootable */ 51 B_INACTIVE = 0x00, 52 /** Bootable */ 53 B_ACTIVE = 0x80, 54 /** Anything else means invalid */ 55 }; 56 57 enum { 59 enum mbr_ptype { 58 60 /** Unused partition entry */ 59 PT_UNUSED= 0x00,61 mbr_pt_unused = 0x00, 60 62 /** Extended partition */ 61 PT_EXTENDED= 0x05,63 mbr_pt_extended = 0x05, 62 64 /** Extended partition with LBA */ 63 PT_EXTENDED_LBA = 0x0F, 64 /** GPT Protective partition */ 65 PT_GPT = 0xEE, 65 mbr_pt_extended_lba = 0x0f, 66 /** FAT16 with LBA */ 67 mbr_pt_fat16_lba = 0x0e, 68 /** FAT32 with LBA */ 69 mbr_pt_fat32_lba = 0x0c, 70 /** IFS, HPFS, NTFS, exFAT */ 71 mbr_pt_ms_advanced = 0x07, 72 /** Minix */ 73 mbr_pt_minix = 0x81, 74 /** Linux */ 75 mbr_pt_linux = 0x83, 76 /** GPT Protective */ 77 mbr_pt_gpt_protect = 0xee 66 78 }; 67 79 … … 79 91 /** Number of blocks in partition */ 80 92 uint32_t length; 81 } __attribute__((packed)) pt_entry_t;93 } __attribute__((packed)) mbr_pte_t; 82 94 83 95 /** Structure of a boot-record block */ 84 96 typedef struct { 85 /* *Area for boot code */97 /* Area for boot code */ 86 98 uint8_t code_area[440]; 87 /** Optional media ID */ 99 100 /* Optional media ID */ 88 101 uint32_t media_id; 89 /** Padding */ 102 90 103 uint16_t pad0; 104 91 105 /** Partition table entries */ 92 pt_entry_t pte[N_PRIMARY]; 106 mbr_pte_t pte[mbr_nprimary]; 107 93 108 /** Boot record block signature (@c BR_SIGNATURE) */ 94 109 uint16_t signature; 95 } __attribute__((packed)) br_block_t;110 } __attribute__((packed)) mbr_br_block_t; 96 111 97 112 #endif 98 113 114 /** @} 115 */ -
uspace/lib/label/src/mbr.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup liblabel 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file Master Boot Record label 33 34 */ 34 35 35 #ifndef __HDISK_H__36 #define __HDISK_H__36 #ifndef LIBLABEL_MBR_H_ 37 #define LIBLABEL_MBR_H_ 37 38 38 #include "common.h"39 #include <types/liblabel.h> 39 40 40 #define init_label() \ 41 label.layout = LYT_NONE 41 extern label_ops_t mbr_label_ops; 42 42 43 43 #endif 44 45 /** @} 46 */ -
uspace/srv/bd/vbd/Makefile
r5265eea4 r77a194c 1 1 # 2 # Copyright (c) 201 0Jiri Svoboda2 # Copyright (c) 2015 Jiri Svoboda 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 USPACE_PREFIX = ../../../.. 30 LIBS = $(LIBBLOCK_PREFIX)/libblock.a 31 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) 29 USPACE_PREFIX = ../../.. 32 30 33 # Correct name is 'guid_part' but must use this because of FAT 8.3 names. 34 BINARY = g_part 31 LIBS = \ 32 $(LIBLABEL_PREFIX)/liblabel.a \ 33 $(LIBBLOCK_PREFIX)/libblock.a 34 35 EXTRA_CFLAGS = \ 36 -I$(LIBLABEL_PREFIX)/include \ 37 -I$(LIBBLOCK_PREFIX) 38 39 BINARY = vbd 35 40 36 41 SOURCES = \ 37 guid_part.c 42 disk.c \ 43 vbd.c 38 44 39 45 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/locsrv/locsrv.c
r5265eea4 r77a194c 1317 1317 categ_dir_add_cat(&cdir, cat); 1318 1318 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 1319 1325 cat = category_new("iplink"); 1320 1326 categ_dir_add_cat(&cdir, cat); -
uspace/srv/volsrv/Makefile
r5265eea4 r77a194c 1 1 # 2 # Copyright (c) 2005 Martin Decky 3 # Copyright (c) 2007 Jakub Jermar 2 # Copyright (c) 2015 Jiri Svoboda 4 3 # All rights reserved. 5 4 # … … 28 27 # 29 28 30 USPACE_PREFIX = ../../../.. 29 USPACE_PREFIX = ../.. 30 31 31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a 32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) 33 BINARY = mbr_part 32 EXTRA_CFLAGS = -I $(LIBBLOCK_PREFIX) 33 34 BINARY = volsrv 34 35 35 36 SOURCES = \ 36 mbr_part.c 37 empty.c \ 38 mkfs.c \ 39 part.c \ 40 volsrv.c 37 41 38 42 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/volsrv/empty.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup volsrv 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file 34 * @brief 33 35 */ 34 36 35 #ifndef __FUNC_GPT_H__36 #define __FUNC_GPT_H__37 #ifndef EMPTY_H_ 38 #define EMPTY_H_ 37 39 38 40 #include <loc.h> 39 #include <tinput.h>40 #include <libgpt.h>41 #include "common.h"42 41 43 extern int construct_gpt_label(label_t *); 44 extern int add_gpt_part(label_t *, tinput_t *); 45 extern int delete_gpt_part(label_t *, tinput_t *); 46 extern int destroy_gpt_label(label_t *); 47 extern int new_gpt_label(label_t *); 48 extern int print_gpt_parts(label_t *); 49 extern int read_gpt_parts(label_t *); 50 extern int write_gpt_parts(label_t *); 51 extern int extra_gpt_funcs(label_t *, tinput_t *); 42 extern int volsrv_part_is_empty(service_id_t, bool *); 43 extern int volsrv_part_empty(service_id_t); 52 44 53 45 #endif 46 47 /** @} 48 */ -
uspace/srv/volsrv/part.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 201 2-2013 Dominik Taborsky2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup hdisk29 /** @addtogroup volsrv 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file 34 * @brief 33 35 */ 34 36 35 #ifndef __FUNC_MBR_H__36 #define __FUNC_MBR_H__37 #ifndef PART_H_ 38 #define PART_H_ 37 39 38 40 #include <loc.h> 39 #include < tinput.h>40 #include < libmbr.h>41 #include " common.h"41 #include <sys/types.h> 42 #include <types/vol.h> 43 #include "types/part.h" 42 44 43 extern int construct_mbr_label(label_t *); 44 extern int add_mbr_part(label_t *, tinput_t *); 45 extern int delete_mbr_part(label_t *, tinput_t *); 46 extern int destroy_mbr_label(label_t *); 47 extern int new_mbr_label(label_t *); 48 extern int print_mbr_parts(label_t *); 49 extern int read_mbr_parts(label_t *); 50 extern int write_mbr_parts(label_t *); 51 extern int extra_mbr_funcs(label_t *, tinput_t *); 45 extern int vol_part_init(void); 46 extern int vol_part_discovery_start(void); 47 extern int vol_part_add(service_id_t); 48 extern int vol_part_get_ids(service_id_t *, size_t, size_t *); 49 extern int vol_part_find_by_id(service_id_t, vol_part_t **); 50 extern int vol_part_empty_part(vol_part_t *); 51 extern int vol_part_mkfs_part(vol_part_t *, vol_fstype_t); 52 extern int vol_part_get_info(vol_part_t *, vol_part_info_t *); 52 53 53 54 #endif 55 56 /** @} 57 */
Note:
See TracChangeset
for help on using the changeset viewer.