Lines Matching defs:hdd
15 #include "hdd.h"
22 calc_chs (struct hdd *hdd)
25 assert(hdd->disk_image != NULL && hdd->disk_image_size >= 516096);
36 if (hdd->disk_image_size >= 0x800000) {
37 hdd->heads = 255;
39 hdd->heads = 16;
43 hdd->sectors = 63;
46 hdd->track_size = hdd->sectors * BLOCK_SIZE;
47 hdd->cylinder_size = hdd->heads * hdd->track_size;
50 size_t real_disk_size = hdd->disk_image_size -
51 (hdd->disk_image_size % hdd->cylinder_size);
54 hdd->cylinders = real_disk_size / hdd->cylinder_size;
57 struct hdd *
60 struct hdd *ret = calloc(1, sizeof(struct hdd));
71 hdd_reset (struct hdd *hdd)
76 hdd_get_geometry_chs (struct hdd *hdd, uint16_t *cylinders, uint8_t *heads,
79 *cylinders = hdd->cylinders;
80 *heads = hdd->heads;
81 *sectors = hdd->sectors;
87 hdd_get_blocks_count (struct hdd *hdd)
89 return hdd->disk_image_size / BLOCK_SIZE;
93 hdd_read_blocks (struct hdd *hdd, size_t start_block, size_t *count,
96 if (((start_block + *count) * BLOCK_SIZE) > hdd->disk_image_size) {
97 *count = hdd->disk_image_size/BLOCK_SIZE - start_block;
100 memcpy((void *)buffer, (void *)(hdd->disk_image + start_block*BLOCK_SIZE),