Age | Commit message (Collapse) | Author | |
---|---|---|---|
2016-02-01 | Un-shorten some lines that don't need breaking anymore. Remove a couple of | Kenneth R Westerback | |
indent levels by shuffling code bit. | |||
2016-01-31 | Nuke pointless map field 'physical_block' and just use 'sbBlkSize' which is | Kenneth R Westerback | |
set to the same value. | |||
2016-01-31 | Use delete_entry()/create_entry() in delete_partition_from_map() instead of | Kenneth R Westerback | |
trying to be clever and tweaking the existing entry into a free space entry by manual manipulation of the fields. | |||
2016-01-31 | Fold add_data_to_map() into create_entry() as the former is always called | Kenneth R Westerback | |
immediately after the latter, manipulating fields in the same structure. Use create_entry() in create_partition() rather than doing the same actions manually. | |||
2016-01-31 | Don't use add_data_to_map() when reading from disk, since it resets some | Kenneth R Westerback | |
of the dpme_ fields, overwriting data from disk. Add some paranoia checks for map limits when reading from disk. | |||
2016-01-31 | Just call contains_driver() when you need to know rather than carrying a | Kenneth R Westerback | |
flag around. More obviously current data. Nuke unnecessary variables when displaying a partition. | |||
2016-01-31 | Apple sets lblock_start and lblocks to 0 in free space entries. Do | Kenneth R Westerback | |
the same. Don't use lblock_start or lblocks in calculation for length@base display. We no longer display lblock info there. | |||
2016-01-30 | Move last three lines (#define's) from dpme.h to partition_map.h and | Kenneth R Westerback | |
tweak #include's as necessary. | |||
2016-01-30 | Fold struct dpme into struct entry. Same reasons as for folding | Kenneth R Westerback | |
struct block0 into struct partition_map. Easier to read code. | |||
2016-01-30 | Refactor add_partition_to_map() to be simpler if perhaps less | Kenneth R Westerback | |
performance optimized. New logic will simplify merging struct dpme into struct entry. | |||
2016-01-30 | There is not much to do if we run out of memory, so simply exit if | Kenneth R Westerback | |
a malloc() or calloc() fails. Simplifies a bunch of logic, makes add_data_to_map() always succeed or exit, so make it a void. | |||
2016-01-29 | Fold struct block0 into struct partition map. There can be only one | Kenneth R Westerback | |
and read/write_block0() can move the data from/to disk to/from appropriate fields anywhere. Removes a bunch of dereferencing, malloc'ing and pointer checking. | |||
2016-01-29 | Warn of partitions extending past the end of the media. | Kenneth R Westerback | |
2016-01-29 | Shorter names means a few whitespace adjustments. | Kenneth R Westerback | |
2016-01-29 | Rename struct partition_map_header to struct partition_map. No change to | Kenneth R Westerback | |
.o files. | |||
2016-01-29 | Rename struct partition_map to struct entry. No change to .o files. | Kenneth R Westerback | |
2016-01-29 | Conform to Apple Mac OS X's behaviour of setting dpme_flags on free | Kenneth R Westerback | |
partitions to 0, and setting them to VALID | ALLOCATED on the map partition. | |||
2016-01-29 | Conform to Apple Mac OS X's behaviour of not giving 'Apple_Free' | Kenneth R Westerback | |
partitions a name. Nuke kFreeName. | |||
2016-01-28 | Flip base_order to a LIST(). | Kenneth R Westerback | |
2016-01-28 | Delete a bunch of Morris dancing in delete_partition_from_map(). | Kenneth R Westerback | |
No need to create a new dpme. Just rename/retype the existing and let combine_entry() suck in any surrounding empty space partitions. | |||
2016-01-28 | Hand rolled lists suck. First, replace disk_order with an LIST. | Kenneth R Westerback | |
2016-01-28 | Oops. Deleted one too many lines. Need to advance pointer when traversing | Kenneth R Westerback | |
list. | |||
2016-01-28 | When adding a new partition to the map, use only existing mapped | Kenneth R Westerback | |
space. Don't try to create new free space partitions to use. If the map does not know about all of the space on the disk, it is broken. | |||
2016-01-28 | Since we don't allow maps to be created or opened with an invalid | Kenneth R Westerback | |
block0, there is no point in checking later if block0 has magically become invalid. | |||
2016-01-28 | Use consistent 'return' idiom -- no parenthesis since that was the style | Kenneth R Westerback | |
of the existing code. | |||
2016-01-28 | Make 'r' (reorder, a.k.a. swap) command work with any two existing | Kenneth R Westerback | |
partitions. Do NOT allow partition 1 to be moved! | |||
2016-01-27 | Traverse next_by_base when checking maps coverage, not next_on_disk! | Kenneth R Westerback | |
2016-01-27 | We do not support logical_block != physical_block. Remove logical_block | Kenneth R Westerback | |
field and left over code that checks for logical != physical. Removes confusion with dmpe fields lblock_start and lblocks, which have nothing to do with block sizes! lblock_start is the block offset within the partition where the data actually starts. and lblocks is the number of blocks of data within the partition. Both are in units of *physical blocks*, a.k.a. disk sectors. | |||
2016-01-27 | Check block 0 signature, physical block size and physical block count when | Kenneth R Westerback | |
reading partition map. Check for unmapped physical blocks and overlapping partitions when reading partition map. No need for duplicate checks in validate_map(), so remove validate.c from build and 'v' command from code and docs. | |||
2016-01-27 | Nuke another (and I hope final) batch of superfluous '{}' around single | Kenneth R Westerback | |
statements. | |||
2016-01-26 | dpme_name and dpme_type are NUL-terminated in Apple code, so use | Kenneth R Westerback | |
strlcpy() to fill them. They are also supposed to be NUL-padded so zap previous contents before copying in possibly shorter new values. | |||
2016-01-26 | Whitespace, line wrapping fixes. Nuke many superfluous '{}' around single | Kenneth R Westerback | |
statements. 0 -> NULL for pointer checks. | |||
2016-01-26 | Whitespace, line wrapping fixes. | Kenneth R Westerback | |
2016-01-26 | Simplify logic of read_partition_map(), junking retries with various sizes | Kenneth R Westerback | |
of logical block. Rely on read_dpme() to do the correct thing. | |||
2016-01-25 | Use new read/write_block0 and read/write_dpme which handle any | Kenneth R Westerback | |
endian or alignment issues forcefully. Removes need for convert_* functions so unhook convert.c from build. read/write_block become static functions inside file_media.c. Tweak struct block0 to stop trying to handle alignment issues by clever declaration. Rely on the new functions to accurately translate between on-disk and in-memory layouts. Enables pdisk to work on amd64 and likely other architectures if it's ever desirable. Does bring back DEV_BSIZE to pdisk.c since the in-memory structure will *not* be 512 bytes on other archs. | |||
2016-01-24 | Whitespace. | Kenneth R Westerback | |
2016-01-24 | Nuke get_align_long() and put_align_long() #define's. They don't do | Kenneth R Westerback | |
anything according to gcc & cmp. cmp suggested by & ok stefan@. | |||
2016-01-24 | Whitespace fixes. | Kenneth R Westerback | |
2016-01-24 | Delete duplicated line that was setting sbBlkCount to 0; Score one | Kenneth R Westerback | |
for the 'v' command! | |||
2016-01-23 | Nuke unused kPatchType. Nuke kStringNot and use " not' where needed. | Kenneth R Westerback | |
Nuke kStringEmpty and use "" where needed. Nuke unused static 'g'. Eliminate #include's in *.h files. Some whitespace fixes. | |||
2016-01-23 | Pass the disk sector size to open_partition_map(), eliminating it's | Kenneth R Westerback | |
internal need for DEV_BSIZE. Ditto create_partition_map(). malloc((sizeof(struct [block0|dpme])) instead of malloc(DEV_BSIZE). Remove another #include <param.h>. | |||
2016-01-23 | Add comments to ensure future spelunkers realize that struct block0 | Kenneth R Westerback | |
and struct dpme must be 512-bytes long at the moment. Use this fact to avoid using DEV_BSIZE and thus replace #include <param.h> with #include <types.h> in pdisk.c. Constrain media size to UINT32_MAX, the actual limit, instead of LONG_MAX, which could be way more on some theoretical future arch running pdisk. And do the constraint inside open_partition_map(). | |||
2016-01-23 | Avoid double prompt after creating default map on startup. | Kenneth R Westerback | |
2016-01-23 | Flip read_block() and write_block() back to taking sector addresses | Kenneth R Westerback | |
instead of off_t values. Do the DEV_BSIZE multiplication in these two functions. Easier to read code and kills two #include <sys/param.h>. Kill unused label. | |||
2016-01-23 | map->block0 is always allocated or the map is discarded. | Kenneth R Westerback | |
So stop checking for NULL. Nuke get_block_zero() and just use map->block0. | |||
2016-01-23 | Nuke sync_device_size() and do it's one-field-update in coerce_block0(), | Kenneth R Westerback | |
right after we read/allocate media->block0. Doing sync *before* media->block0 is allocated is bad. The map->physical_block is initialized correctly and never to the magic number '1'. So just use map-physical_block to initialize sbBlkSize. | |||
2016-01-23 | Always initialize media_size to provided mediasz in open_partition_map(). | Kenneth R Westerback | |
2016-01-23 | Break annoying long line. | Kenneth R Westerback | |
2016-01-22 | Change partition map field 'data' to 'dmpe'. Change 'create_data' | Kenneth R Westerback | |
to 'create_dmpe'. Sweep up some 'struct dpme *data' to struct dpme *dpme'. | |||
2016-01-22 | Rename map field 'misc' to 'block0' since that's what it is. | Kenneth R Westerback | |