1/** 2 * \file 3 */ 4 5/* 6 * Copyright (c) 2009, ETH Zurich. 7 * All rights reserved. 8 * 9 * This file is distributed under the terms in the attached LICENSE file. 10 * If you do not find this file, copies can be found by writing to: 11 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. 12 */ 13 14#ifndef DISK_H 15#define DISK_H 16 17#include <stdint.h> 18 19struct hdd { 20 void *disk_image; 21 size_t disk_image_size; 22 uint16_t cylinders; 23 uint8_t heads; 24 uint8_t sectors; 25 size_t cylinder_size; 26 size_t track_size; 27}; 28 29struct hdd * hdd_new_from_memory (void *disk_image, size_t disk_image_size); 30void hdd_reset (struct hdd *hdd); 31int hdd_get_geometry_chs (struct hdd *hdd, uint16_t *cylinders, uint8_t *heads, 32 uint8_t *sectors); 33size_t hdd_get_blocks_count (struct hdd *hdd); 34int hdd_read_blocks (struct hdd *hdd, size_t start_block, size_t *count, 35 uintptr_t buffer); 36 37#endif // DISK_H 38