Changeset 77a194c in mainline for uspace/lib/label/include
- Timestamp:
- 2015-11-04T18:55:46Z (10 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. - Location:
- uspace/lib/label/include
- Files:
-
- 2 added
- 2 moved
-
label.h (added)
-
std/gpt.h (moved) (moved from uspace/srv/bd/part/guid_part/gpt.h ) (3 diffs)
-
std/mbr.h (moved) (moved from uspace/lib/mbr/mbr.h ) (4 diffs)
-
types/liblabel.h (added)
Legend:
- Unmodified
- Added
- Removed
-
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 */
Note:
See TracChangeset
for help on using the changeset viewer.
