Changeset 77a194c in mainline for uspace/lib/label/include/std/mbr.h
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
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.