Yi Kong | 39bbd96 | 2022-01-09 19:41:38 +0800 | [diff] [blame] | 1 | #ifndef MTOOLS_OLDDOS_H |
| 2 | #define MTOOLS_OLDDOS_H |
| 3 | /* Copyright 2021 Alain Knaff. |
| 4 | * This file is part of mtools. |
| 5 | * |
| 6 | * Mtools is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation, either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * Mtools is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with Mtools. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "device.h" |
| 21 | |
| 22 | struct OldDos_t { |
| 23 | unsigned int tracks; |
| 24 | uint16_t sectors; |
| 25 | uint16_t heads; |
| 26 | |
| 27 | uint16_t dir_len; |
| 28 | uint8_t cluster_size; |
| 29 | uint32_t fat_len; |
| 30 | |
| 31 | uint8_t media; |
| 32 | }; |
| 33 | |
| 34 | extern struct OldDos_t *getOldDosBySize(size_t size); |
| 35 | extern struct OldDos_t *getOldDosByMedia(int media); |
| 36 | extern struct OldDos_t *getOldDosByParams(unsigned int tracks, |
| 37 | unsigned int heads, |
| 38 | unsigned int sectors, |
| 39 | unsigned int dir_len, |
| 40 | unsigned int cluster_size); |
| 41 | int setDeviceFromOldDos(int media, struct device *dev); |
| 42 | |
| 43 | #endif |