Commit 42d8af43992ba3bb3e6e3c9e41908b420070de72
- Diff rendering mode:
- inline
- side by side
libdiskconfig/config_mbr.c
(10 / 3)
|   | |||
| 31 | 31 | cfg_pentry(struct pc_partition *pentry, uint8_t status, uint8_t type, | |
| 32 | 32 | uint32_t start, uint32_t len) | |
| 33 | 33 | { | |
| 34 | /* zero out the c/h/s entries.. they are not used */ | ||
| 35 | memset(&pentry->start, 0, sizeof(struct chs)); | ||
| 36 | memset(&pentry->end, 0, sizeof(struct chs)); | ||
| 34 | if (len > 0) { | ||
| 35 | /* seems that somes BIOSens can get wedged on boot while verifying | ||
| 36 | * the mbr if these are 0 */ | ||
| 37 | memset(&pentry->start, 0xff, sizeof(struct chs)); | ||
| 38 | memset(&pentry->end, 0xff, sizeof(struct chs)); | ||
| 39 | } else { | ||
| 40 | /* zero out the c/h/s entries.. they are not used */ | ||
| 41 | memset(&pentry->start, 0, sizeof(struct chs)); | ||
| 42 | memset(&pentry->end, 0, sizeof(struct chs)); | ||
| 43 | } | ||
| 37 | 44 | ||
| 38 | 45 | pentry->status = status; | |
| 39 | 46 | pentry->type = type; |
libdiskconfig/diskconfig.h
(2 / 2)
|   | |||
| 48 | 48 | #define PART_ACTIVE_FLAG 0x1 | |
| 49 | 49 | ||
| 50 | 50 | struct chs { | |
| 51 | uint8_t cylinder; | ||
| 52 | 51 | uint8_t head; | |
| 53 | 52 | uint8_t sector; | |
| 54 | }; | ||
| 53 | uint8_t cylinder; | ||
| 54 | } __attribute__((__packed__)); | ||
| 55 | 55 | ||
| 56 | 56 | /* 16 byte pc partition descriptor that sits in MBR and EPBR. | |
| 57 | 57 | * Note: multi-byte entities have little-endian layout on disk */ |

